MIDI Services
Communicate with hardware using Universal MIDI Packets.
Overview
MIDI drivers own and control physical MIDI devices, which include hardware such as USB interfaces, MIDI keyboards, and so on. A MIDI device may have multiple logically distinct subcomponents. For example, one device may contain a MIDI synthesizer and a pair of MIDI ports, both addressable over a USB port. Each element of a device is a MIDI entity.
A MIDI entity can have any number of MIDI endpoints, each of which is a source or destination of a 16-channel MIDI stream. Grouping a device’s endpoints into entities provides the system enough information for an app to make reasonable default assumptions about how to communicate bidirectionally with each entity, as is necessary in MIDI librarian apps.
Core MIDI attaches a collection of properties to each object it manages. Object properties can be:
Dynamic characteristics of a device, such as MIDI receive channel and system-exclusive (SysEx) IDs.
Determined by user preference; for example, choice of icon, and whether or not the device appears in lists of possible controllers.
Static properties that you can’t look up in a database using the device’s manufacturer and model name.
The Core MIDI framework uses interprocess communication (IPC) to communicate with a server process, the MIDI server. The server process in turn loads the MIDI driver and manages all communication with it.
Topics
MIDI object configuration
Client management
Incorporating MIDI 2 into your appsMIDIClientCreate(_:_:_:_:)MIDIClientCreateWithBlock(_:_:_:)MIDIClientDispose(_:)MIDIClientRef
Device lookup
MIDIGetNumberOfDevices()MIDIGetDevice(_:)MIDIGetNumberOfExternalDevices()MIDIGetExternalDevice(_:)MIDIDeviceGetNumberOfEntities(_:)MIDIDeviceGetEntity(_:_:)MIDIDeviceRef
Entity lookup
MIDIEntityGetDevice(_:_:)MIDIEntityGetNumberOfSources(_:)MIDIEntityGetSource(_:_:)MIDIEntityGetNumberOfDestinations(_:)MIDIEntityGetDestination(_:_:)MIDIEntityRef
Port management
MIDIInputPortCreateWithProtocol(_:_:_:_:_:)MIDIOutputPortCreate(_:_:_:)MIDIPortDispose(_:)MIDIPortConnectSource(_:_:_:)MIDIPortDisconnectSource(_:_:)MIDIPortRefMIDIReceiveBlock
Endpoint management
MIDIEndpointDispose(_:)MIDIEndpointGetEntity(_:_:)MIDIEndpointGetRefCons(_:_:_:)MIDIEndpointSetRefCons(_:_:_:)MIDISourceCreateWithProtocol(_:_:_:_:)MIDIGetSource(_:)MIDIGetNumberOfSources()MIDIDestinationCreateWithProtocol(_:_:_:_:_:)MIDIGetDestination(_:)MIDIGetNumberOfDestinations()MIDIEndpointRef
Event list management
MIDIEventListInit(_:_:)MIDIEventListAdd(_:_:_:_:_:_:)MIDIEventPacketNext(_:)MIDISendEventList(_:_:_:)MIDIReceivedEventList(_:_:)MIDIEventListMIDIEventPacketUnsafeMutableMIDIEventListPointerUnsafeMutableMIDIEventPacketPointer
Packet list management
MIDIPacketNext(_:)MIDIPacketMIDIPacketListMIDITimeStampUnsafeMutableMIDIPacketListPointerUnsafeMutableMIDIPacketPointer