I’m tidying my first plugin and came to realise I’ve never fully understood what sampleNumber parameter is in MidiBuffer::addEvent (and didn’t grasp the offset variable calculation in the arpeggiator example). I have been calling it with a value of 0, but am I correct in thinking that inside processBlock e.g.:
const int sampleFrames = buffer.getNumSamples(); // Say 512
Should addEvent’s sampleNumber be between 0 and 512 to tell the host the exact sample no the MIDI event should be triggered on?