DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::plugin::vst3::NoteIdMap Class Reference

The notes the host started, by VST3 note id. A note expression event names its note by id only, while MidiEvent names a voice by channel, key and id, so the wrapper keeps the id -> (channel, key) of every NoteOn in an open-addressed table (home slot: the id's low bits; host ids usually count up, so consecutive notes land in consecutive slots). A note keeps its entry past its NoteOff - an expression may shape the release - until a newer note needs the slot; only when every slot holds a sounding note does one give way. Slots are never emptied, so a probe chain never breaks. Audio thread only; fixed capacity, no allocation, O(1) per note in practice. More...

#include <DSParkVst3.h>

Public Member Functions

void clear () noexcept
 
void noteOn (int32_t noteId, int channel, int key) noexcept
 
void noteOff (int32_t noteId) noexcept
 
bool find (int32_t noteId, int &channel, int &key) noexcept
 

Static Public Attributes

static constexpr uint32_t kCapacity = 256
 

Detailed Description

The notes the host started, by VST3 note id. A note expression event names its note by id only, while MidiEvent names a voice by channel, key and id, so the wrapper keeps the id -> (channel, key) of every NoteOn in an open-addressed table (home slot: the id's low bits; host ids usually count up, so consecutive notes land in consecutive slots). A note keeps its entry past its NoteOff - an expression may shape the release - until a newer note needs the slot; only when every slot holds a sounding note does one give way. Slots are never emptied, so a probe chain never breaks. Audio thread only; fixed capacity, no allocation, O(1) per note in practice.

Definition at line 505 of file DSParkVst3.h.

Member Function Documentation

◆ clear()

void dspark::plugin::vst3::NoteIdMap::clear ( )
inlinenoexcept

Definition at line 510 of file DSParkVst3.h.

◆ find()

bool dspark::plugin::vst3::NoteIdMap::find ( int32_t  noteId,
int &  channel,
int &  key 
)
inlinenoexcept

The channel and key note noteId started with; false when unknown.

Definition at line 545 of file DSParkVst3.h.

◆ noteOff()

void dspark::plugin::vst3::NoteIdMap::noteOff ( int32_t  noteId)
inlinenoexcept

The NoteOff of note noteId: its entry may now give way.

Definition at line 539 of file DSParkVst3.h.

◆ noteOn()

void dspark::plugin::vst3::NoteIdMap::noteOn ( int32_t  noteId,
int  channel,
int  key 
)
inlinenoexcept

A NoteOn with host note id noteId (ignored when negative).

Definition at line 516 of file DSParkVst3.h.

Member Data Documentation

◆ kCapacity

constexpr uint32_t dspark::plugin::vst3::NoteIdMap::kCapacity = 256
staticconstexpr

Definition at line 508 of file DSParkVst3.h.


The documentation for this class was generated from the following file: