iPlug2 - C++ Audio Plug-in Framework
|
Public Types | |
enum | EATMode { kATModeChannel = 0 , kATModePoly , kNumATModes } |
enum | EPolyMode { kPolyModePoly = 0 , kPolyModeMono , kNumPolyModes } |
using | VoiceControlRamps = ControlRampProcessor::ProcessorArray< kNumVoiceControlRamps > |
Public Member Functions | |
VoiceAllocator (const VoiceAllocator &)=delete | |
VoiceAllocator & | operator= (const VoiceAllocator &)=delete |
void | Clear () |
void | SetSampleRateAndBlockSize (double sampleRate, int blockSize) |
void | SetNoteGlideTime (double t) |
void | SetControlGlideTime (double t) |
void | AddVoice (SynthVoice *pv, uint8_t zone) |
Add a synth voice to the allocator. More... | |
void | AddEvent (VoiceInputEvent e) |
Add a single event to the input queue for the current processing block. More... | |
void | ProcessEvents (int samples, int64_t sampleTime) |
Process all input events and generate voice outputs. More... | |
void | SoftKillAllVoices () |
Turn all voice gates off, allowing any voice envelopes to finish. More... | |
void | HardKillAllVoices () |
Stop all voices from making sound immdiately. More... | |
void | SetKeyToPitchFunction (const std::function< float(int)> &fn) |
void | SendEventToVoices (VoiceInputEvent event) |
Send the event to the voices matching its address. | |
void | ProcessVoices (sample **inputs, sample **outputs, int nInputs, int nOutputs, int startIndex, int blockSize) |
size_t | GetNVoices () const |
SynthVoice * | GetVoice (int voiceIndex) const |
void | SetPitchOffset (float offset) |
Public Attributes | |
EPolyMode | mPolyMode {kPolyModePoly} |
EATMode | mATMode {kATModeChannel} |
Static Public Attributes | |
static constexpr int | kVoiceMostRecent = 1 << 7 |
Definition at line 81 of file VoiceAllocator.h.
using VoiceAllocator::VoiceControlRamps = ControlRampProcessor::ProcessorArray<kNumVoiceControlRamps> |
Definition at line 102 of file VoiceAllocator.h.
enum VoiceAllocator::EATMode |
Definition at line 85 of file VoiceAllocator.h.
enum VoiceAllocator::EPolyMode |
Definition at line 92 of file VoiceAllocator.h.
VoiceAllocator::VoiceAllocator | ( | ) |
Definition at line 26 of file VoiceAllocator.cpp.
VoiceAllocator::~VoiceAllocator | ( | ) |
Definition at line 35 of file VoiceAllocator.cpp.
|
inline |
Add a single event to the input queue for the current processing block.
Definition at line 122 of file VoiceAllocator.h.
References IPlugQueue< T >::Push().
Referenced by MidiSynth::ProcessBlock().
void VoiceAllocator::AddVoice | ( | SynthVoice * | pv, |
uint8_t | zone | ||
) |
Add a synth voice to the allocator.
We do not take ownership ot the voice.
pv | Pointer to the voice to add. |
zone | A zone can be specified to make multitimbral synths. |
Definition at line 54 of file VoiceAllocator.cpp.
Referenced by MidiSynth::AddVoice().
void VoiceAllocator::Clear | ( | ) |
Definition at line 39 of file VoiceAllocator.cpp.
|
inline |
Definition at line 140 of file VoiceAllocator.h.
|
inline |
Definition at line 141 of file VoiceAllocator.h.
void VoiceAllocator::HardKillAllVoices | ( | ) |
Stop all voices from making sound immdiately.
Definition at line 392 of file VoiceAllocator.cpp.
References SoftKillAllVoices().
void VoiceAllocator::ProcessEvents | ( | int | samples, |
int64_t | sampleTime | ||
) |
Process all input events and generate voice outputs.
Definition at line 192 of file VoiceAllocator.cpp.
References IPlugQueue< T >::ElementsAvailable(), IPlugQueue< T >::Pop(), and SoftKillAllVoices().
Referenced by MidiSynth::ProcessBlock().
void VoiceAllocator::ProcessVoices | ( | sample ** | inputs, |
sample ** | outputs, | ||
int | nInputs, | ||
int | nOutputs, | ||
int | startIndex, | ||
int | blockSize | ||
) |
Definition at line 530 of file VoiceAllocator.cpp.
|
inline |
Definition at line 114 of file VoiceAllocator.h.
|
inline |
Definition at line 133 of file VoiceAllocator.h.
|
inline |
Definition at line 113 of file VoiceAllocator.h.
|
inline |
Definition at line 142 of file VoiceAllocator.h.
|
inline |
Definition at line 112 of file VoiceAllocator.h.
void VoiceAllocator::SoftKillAllVoices | ( | ) |
Turn all voice gates off, allowing any voice envelopes to finish.
Definition at line 379 of file VoiceAllocator.cpp.
Referenced by HardKillAllVoices(), and ProcessEvents().
|
staticconstexpr |
Definition at line 99 of file VoiceAllocator.h.
EATMode VoiceAllocator::mATMode {kATModeChannel} |
Definition at line 192 of file VoiceAllocator.h.
EPolyMode VoiceAllocator::mPolyMode {kPolyModePoly} |
Definition at line 191 of file VoiceAllocator.h.