Avoiding the Pitfalls of CoreMIDI Programming (for Developers)
- Do not block the CoreMIDI realtime thread.
Do not call blocking functions like printf(), NSLog(), malloc() or Objective C method calls from any CoreMIDI I/O context such as the input callback. - Take event timestamps into account.
Consult Technical Q&A QA1643 for informations on how to deal with host time on iOS. - Schedule output in advance
Schedule outgoing messages for future delivery, especially when sending over network (see the kMIDIPropertyAdvanceScheduleTimeMuSec property).