Timing issue with midi for large buffsize


#1

Hello,
From my understanding, the processBlock method deals with both audio and midi.
But what if midi needs to be delivered more often than audio ?
With big buffer size the processBlock is being called with a long delay, which can make the timing of the midi messages innacurate.

(EX :
Samplerate=44100.0 BufferSize=6912
156.7ms between each call of processBlock.
Bpm=200 means that an eighth note is about 150ms)

How to handle it ?

Many thanks


#2

Each midi-event has a time-stamp that refers to it’s start offset from the beginning of the audio-buffer. With your example you could realistically get a midi-event that has on offset of 6911 and thus should only be interpreted from that sample onward.


#3

Ok ! So when we are in processBlock, the time stamp of messages in the midibuffer are meaningfull, and plugins should use them at the right place in the current buffer


#4

Correct.