ioscoremidi

How to use CoreMIDI on iOS?


I have been unable to find much information on CoreMIDI for iOS. Is it even possible to play a MIDI sound by sending a message to the device itself. Does the iPhone or iPad have a MIDI device installed or do you have to have a device connected to interface with?


Solution

  • You should give a look at pete goodliffe's blog and he generously provides an example project. It helped me a lot to start programming CoreMIDI.

    Now about your questions, on iOS, mostly CoreMIDI network sessions are used. The participants to a same "Network Session" send messages to each others.

    For example, you configure a network session on your Mac (using Audio MIDI Setup tool) and you can connect your iOS devices to it. This way, you can sent messages from iOS to your OSX host and vice versa.

    CoreMIDI network sessions relies on the RTP protocol to transport MIDI messages and Bonjour to discover hosts.

    Next to that, CoreMIDI can also handle MIDI interface connected to the system, but iOS devices don't have physical MIDI interface by default. You have to buy external hardware if you want connect directly your iPhone to a synthesizer. However, the iPad can be connected to an USB class compliant Midi interface via the camera kit.

    Another thing, on a standalone iOS device, you can send use the local CoreMIDI session to send or receive messages from/to another CoreMIDI compatible application.