Avoiding the Pitfalls of CoreMIDI Programming (for Developers)

  1. 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.
  2. Take event timestamps into account.
    Consult Technical Q&A QA1643 for informations on how to deal with host time on iOS.
  3. Schedule output in advance
    Schedule outgoing messages for future delivery, especially when sending over network (see the kMIDIPropertyAdvanceScheduleTimeMuSec property).