Handy class to help keep audio buffer in sync with incoming MIDI events. To use it, create a local variable (on the stack) and call nextEvent() until it returns false.
{
float* const outL = amsh.outputs[0];
float* const outR = amsh.outputs[1];
for (uint32_t i=0; i<amsh.midiEventCount; ++i)
{
}
renderSynth(outL, outR, amsh.frames);
}
float * outputs[2]
Definition DafPluginUtils.hpp:137
AudioMidiSyncHelper(float **const o, uint32_t f, const MidiEvent *m, uint32_t mc)
Definition DafPluginUtils.hpp:145
Definition DafDetails.hpp:939
Some important notes when using this class:
- MidiEvent::frame retains its original value, but it is useless, do not use it.
- The class variable names are the same as the default ones in the run function. Keep that in mind and try to avoid typos. :)