Cantabile Development Blog

Follow the development of music software Cantabile

Articles | Full Index | RSS Feed


Constant Latency Real-time MIDI

Build 2016 has a new audio engine option called constant latency real-time MIDI.

By default real-time MIDI events all get scheduled for the very start of the next audio buffer cycle (deltaFrames=0). The idea behind this is to reduce latency and play the note as soon as possible after the player hit the key.

The problem with this is that it changes the timing of events - anything played during the previous audio buffer all gets lumped on the first sample of the next buffer instead of being spread out through the buffer as they were played. This results in the note on/off events at the same instant problem described previously.

This new constant latency option, schedules the event for the same position in the next audio buffer as they were played in this audio buffer. eg: if a note is played half way through the currently sounding audio buffer, then it's scheduled for half way through the next buffer.

By default constant latency is turned off but should generally be turned on.

Posted on February 24, 2009

Share This

Leave A Comment

All comments will be reviewed for spam before being displayed.