Accurate scheduling of MIDI messages

This is a basic question but I’d like to see the iPlug2 way of solving it.
I see this example code in a Process block:

// inputs to the synthesizer can just fetch a value every block, like this:
double pitchBend = mInputs[kVoiceControlPitchBend].endValue;

If my block size is large, such as 2048 samples, then I will get a stair-stepped pitch bend sound. How do I inject MIDI events into my synthesizer at sub-block granularity, based on the timestamp of the event? I’ve looked into ControlRamp but I don’t think it solves this particular problem.

The MPE synth class that is in iPlug2 was written by Randy Jones, and I haven’t fully explored it myself yet. I have an older synth class that doesn’t support MPE that I may also include which is a bit simpler.

I think you need to write a control ramp, like what is done with the kVoiceControlTimbre , then use that in the sample loop

The blocksize here will be MidiSynth::kDefaultBlockSize samples (32) BTW not 2048

Thanks Oli, I will try this.

I understand the synth block size is independent from output buffer size, but the granularity/update rate of mInputs[...].endValue seems to be determined by the output buffer size.