Question

I 'm using coremidi all right, but I want to also support an external USB function.

I 've tried an app called Midi Monitor which indeed finds my USB interface when connected. The problem is how to enable this interface through my own app. As said in MIDIGetNumberOfExternalDevices documentation, "Their presence is completely optional, only when a UI (such as Audio MIDI Setup) adds them."

How am I supposed to add them?

Best Regards.

Was it helpful?

Solution

"External devices" are not what you want. Those are the things that a user can create in Audio MIDI Setup in OS X, to represent a synthesizer or keyboard or other device that is connected to the computer via a MIDI cable. The system does not automatically create them. (It can't, because MIDI is terribly primitive and has no device discovery protocol.)

External devices are only for the user's benefit in naming and arranging things. They can't be used to do MIDI input or output. They're especially useless in iOS, since there's no Audio MIDI Setup app.

Instead, use MIDIGetNumberOfSources and MIDIGetSource to find sources of MIDI data.

To actually get input, use MIDIInputPortCreate to create an input port, then MIDIPortConnectSource to connect one or more sources to that port. Then your port's MIDIReadProc will be called when MIDI comes in.

Similarly, for output, you would use MIDIGetNumberOfDestinations and MIDIGetDestination to find destinations, create an output port using MIDIOutputPortCreate, and MIDISend to send data through a port to a destination.

For reference, see the MIDIServices documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top