|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
The voices this backend started (one per NoteOn it delivered), with the host's modulation amount of every perVoice() parameter for each one. More...
#include <DSParkClap.h>
Classes | |
| struct | Voice |
| A voice's identity (the part every scan reads; kept small). More... | |
| struct | VoiceParams |
| What the host set for each perVoice() parameter of one voice. More... | |
Public Member Functions | |
| void | clear () noexcept |
| int | start (int channel, int key, int32_t noteId) noexcept |
| int | oldest () const noexcept |
| int | end () const noexcept |
| template<typename Fn > | |
| void | forEachMatching (int port, int channel, int key, int32_t noteId, Fn &&fn) noexcept |
| Voice & | operator[] (int slot) noexcept |
| VoiceParams & | paramsOf (int slot) noexcept |
| void | release (int slot) noexcept |
Static Public Attributes | |
| static constexpr int | kCapacity = 128 |
The voices this backend started (one per NoteOn it delivered), with the host's modulation amount of every perVoice() parameter for each one.
CLAP addresses voices by (port, channel, key, note id), any part -1 for "any". MidiEvent names one voice, so the backend resolves each per-voice event (note expression, polyphonic modulation, per-note automation) against this table and delivers it once per matching voice - which also covers the per-key, per-channel and per-port forms. Audio thread only; fixed capacity, no allocation. When every slot is in use, a new voice takes the slot of the oldest one (a released voice first): the backend reports that voice's end to the host first, so every voice the host started still receives exactly one NOTE_END.
Definition at line 127 of file DSParkClap.h.
|
inlinenoexcept |
Definition at line 154 of file DSParkClap.h.
|
inlinenoexcept |
One past the highest slot in use (scans stop there).
Definition at line 211 of file DSParkClap.h.
|
inlinenoexcept |
Calls fn(slot) for every voice the address matches (each part -1 for "any"; the one note port has index 0).
Definition at line 216 of file DSParkClap.h.
|
inlinenoexcept |
The slot a new voice takes when the table is full: the oldest released voice, else the oldest one; -1 when no voice is in use.
Definition at line 189 of file DSParkClap.h.
|
inlinenoexcept |
Definition at line 231 of file DSParkClap.h.
|
inlinenoexcept |
The perVoice() parameter state of voice slot.
Definition at line 234 of file DSParkClap.h.
|
inlinenoexcept |
Frees voice slot.
Definition at line 240 of file DSParkClap.h.
|
inlinenoexcept |
Starts a voice; returns its slot, or -1 when every slot is in use.
Definition at line 161 of file DSParkClap.h.
|
staticconstexpr |
Definition at line 130 of file DSParkClap.h.