I’ve done some more work on these quantization issues, and now I have some big concerns about the way Cantabile records MIDI events. Specifically, I have found more evidence for quantization on 1ms boundaries, and I am thinking that if these recorded MIDI files are played back, this amounts to 1ms of jitter that could materially alter the sound of the recorded MIDI stream.
I wired up several “MIDI-Audio Tap Cables” described in an old Sound-on-Sound article on latency. Here’s the wiring diagram:
This cable nicely reports a MIDI event on an unbalanced Audio channel with a clear pulse. Using this [M+A] cable, I set up this test:
Results were interesting!
Here’s a side-by-side of the three recorded channels (analyzed in Reaper). Track 8 shows Cantabile’s recording of the outbound MIDI events. Track 9 shows the audio input from the unbalanced branch of the [M+A] cable and track 10 shows Cantabile’s recording of the input MIDI event that has been looped back.
MIDI events, as recorded to files by Cantabile, seem to always be aligned / quantized on 1ms boundaries. At 44.1 kHz and a buffer size of 48 samples, the MIDI return event on Track 10 is always 88 or 132 samples later than the MIDI send event on Track 8.
Furthermore, there are cases where the M+A cable reports the MIDI event arriving at the loopback cable before the event recorded by Cantabile is logged in the MIDI recording file:
Cantabile delays the recording of outbound MIDI port events played from the Media player and inbound MIDI port events so they sit on 1ms boundaries. The outbound notes themselves do not appear to be delayed, as demonstrated by this second screenshot.
This means that, at the least, MIDI files recorded by Cantabile have a substantial jitter - possibly as high as just under 1msec (specifically: 1ms less one sample’s duration, or 0.977ms @ 44.1 kHz).
One explanation is that MIDI and Audio files recorded at the same time are not synchronized. This would explain the Audio events occasionally (4 times out of 20 tests) appearing before the MIDI event counterparts. However, it would not explain the quantization of MIDI events on 1ms boundaries.
For my part, it means that recording of MIDI events in Cantabile cannot be used for latency testing, or for anything where a 1ms jitter is problematic. The M+A cable approach would be needed.