|
iPlug2 - C++ Audio Plug-in Framework
|
A monophonic/polyphonic synthesiser base class which can be supplied with a custom voice. More...
#include <MidiSynth.h>
Public Member Functions | |
| MidiSynth (VoiceAllocator::EPolyMode mode, int blockSize=kDefaultBlockSize) | |
| MidiSynth (const MidiSynth &)=delete | |
| MidiSynth & | operator= (const MidiSynth &)=delete |
| void | Reset () |
| void | SetSampleRateAndBlockSize (double sampleRate, int blockSize) |
| void | SetVoicesActive (bool active) |
| If you are using this class in a non-traditional mode of polyphony (e.g.to stack loads of voices) you might want to manually SetVoicesActive() usually this would happen when you trigger notes. More... | |
| void | InitBasicMPE () |
| void | SetPitchBendRange (int pitchBendRange) |
| Set the pitch bend range for non-MPE mode. More... | |
| void | SetPolyMode (VoiceAllocator::EPolyMode mode) |
| void | SetATMode (VoiceAllocator::EATMode mode) |
| void | SetKeyToPitchFn (const std::function< float(int)> &fn) |
| Set this function to something other than the default if you need to implement a tuning table for microtonal support. More... | |
| void | SetNoteOffset (double offset) |
| void | SetNoteGlideTime (double t) |
| void | SetControlGlideTime (double t) |
| SynthVoice * | GetVoice (int voiceIdx) |
| void | ForEachVoice (std::function< void(SynthVoice &voice)> func) |
| size_t | NVoices () const |
| void | AddVoice (SynthVoice *pVoice, uint8_t zone) |
| adds a SynthVoice to this MidiSynth, taking ownership of the object. More... | |
| void | AddMidiMsgToQueue (const IMidiMsg &msg) |
| bool | ProcessBlock (sample **inputs, sample **outputs, int nInputs, int nOutputs, int nFrames) |
| Processes a block of audio samples. More... | |
Static Public Attributes | |
| static constexpr int | kDefaultBlockSize = 32 |
| This defines the size in samples of a single block of processing that will be done by the synth. More... | |
| static constexpr int | kDefaultPitchBendRange = 12 |
A monophonic/polyphonic synthesiser base class which can be supplied with a custom voice.
Supports different kinds of after touch, pitch bend, velocity and after touch curves, unison (currently monophonic mode only)
Definition at line 37 of file MidiSynth.h.
| MidiSynth::MidiSynth | ( | VoiceAllocator::EPolyMode | mode, |
| int | blockSize = kDefaultBlockSize |
||
| ) |
Definition at line 15 of file MidiSynth.cpp.
| MidiSynth::~MidiSynth | ( | ) |
Definition at line 34 of file MidiSynth.cpp.
|
inline |
Definition at line 143 of file MidiSynth.h.
|
inline |
adds a SynthVoice to this MidiSynth, taking ownership of the object.
Definition at line 138 of file MidiSynth.h.
References VoiceAllocator::AddVoice().
|
inline |
Definition at line 126 of file MidiSynth.h.
|
inline |
Definition at line 121 of file MidiSynth.h.
|
inline |
Definition at line 68 of file MidiSynth.h.
|
inline |
Definition at line 132 of file MidiSynth.h.
| bool MidiSynth::ProcessBlock | ( | sample ** | inputs, |
| sample ** | outputs, | ||
| int | nInputs, | ||
| int | nOutputs, | ||
| int | nFrames | ||
| ) |
Processes a block of audio samples.
| inputs | Pointer to input Arrays |
| outputs | Pointer to output Arrays |
| nInputs | The number of input channels that contain valid data |
| nOutputs | input channels that contain valid data |
| nFrames | The number of sample frames to process |
true if the synth is silent Definition at line 402 of file MidiSynth.cpp.
References VoiceAllocator::AddEvent(), SynthVoice::GetBusy(), and VoiceAllocator::ProcessEvents().
|
inline |
Definition at line 52 of file MidiSynth.h.
|
inline |
Definition at line 92 of file MidiSynth.h.
|
inline |
Definition at line 116 of file MidiSynth.h.
|
inline |
Set this function to something other than the default if you need to implement a tuning table for microtonal support.
| fn | A function taking an integer key value and returning a double-precision pitch value, where 0.5 = 220Hz, 1.0 = 440 Hz, 2.0 = 880 Hz ("1v / octave"). |
Definition at line 101 of file MidiSynth.h.
|
inline |
Definition at line 111 of file MidiSynth.h.
|
inline |
Definition at line 106 of file MidiSynth.h.
|
inline |
Set the pitch bend range for non-MPE mode.
Definition at line 74 of file MidiSynth.h.
|
inline |
Definition at line 87 of file MidiSynth.h.
| void MidiSynth::SetSampleRateAndBlockSize | ( | double | sampleRate, |
| int | blockSize | ||
| ) |
Definition at line 477 of file MidiSynth.cpp.
|
inline |
If you are using this class in a non-traditional mode of polyphony (e.g.to stack loads of voices) you might want to manually SetVoicesActive() usually this would happen when you trigger notes.
| active | should the class report that voices are active |
Definition at line 63 of file MidiSynth.h.
|
staticconstexpr |
This defines the size in samples of a single block of processing that will be done by the synth.
Definition at line 41 of file MidiSynth.h.
|
staticconstexpr |
Definition at line 42 of file MidiSynth.h.