-
+
THE DIFFICULTIES OF HANDLING MIDI CORRECTLY
- MIDI:
- non-streaming
- synchronous wire protocol
- bandwidth utilization varies dramatically
- maximum 1 byte/0.33 msec.
- Audio
- streaming
- abstract memory access protocol
- constant bandwidth
- typically 100's-1000's bytes/msec.
- correct MIDI timing:
- 0.3 msec resolution required
- MIDI msg received at a given audio transport position should
be on wire when we return to that position.
- can't be done from audio thread: mutual blocking issues
- can't be done from GUI thread: GUI operations block MIDI I/O
- scheduler can be in user-space or in kernel (eg. ALSA sequencer)
- standard kernels: can't accurately schedule queued MIDI data
- standard kernel timer: 0.01secs or 0.001secs
- RTC: power-of-2 Hz
- audio interrupt stream: multiples of 1/{44100,48000,96000} secs.