CoreMIDI Framework
This is a partially annotated list of some of the struct, typeref, function, and enum items contained in the CoreMIDI framework. In addition, there
are also some references to classes and methods from other frameworks that are used with CoreMIDI.
Click here to return to root page for BRossTools.).
The root of the CoreMIDI framework documention is at
https://developer.apple.com/documentation/coremidi?language=objc. I also ran the CoreMIDI headers through Doxygen and the results
are at CoreMIDI/html/index.html.
The legacy MIDI protocols are known as MIDI 1. MIDI 2 is in the process of being adopted and some of the changes to CoreMIDI are
described here.
Many of the header files contain little or no documentation. Since the documentation contained in these headers are apparently the
source of the documentation on the site, many of the
functions are very poorly defined. See CoreMidiMapping.html for some ideas
in using code from other applications to aid in documentating CoreMIDI.
For some information on various topics and related frameworks, see
Core Foundation Framework
The documentation for the Core Foundation Framework is located on the
Apple Developer Website.
The names of the functions, classes, structs, etc.
start with the letters NS, which stands for NextStep
Core Foundation functions, types, enums, and blocks: CF... : A
D
CoreMIDI Framework
The documentation for the Core MIDI Framework is located on the
Apple Developer Website.
The names of the functions, classes, structs, etc.
start with the letters NS, which stands for NextStep
Constants: kMIDI... : C I M N O P
U W
CoreMIDI functions,types, enums, and blocks: MIDI... :
1
C D E G
I M N O
P R S
T
Foundation Framework
The documentation for the Foundation Framework is located on the
Apple Developer Website.
The names of the functions, classes, structs, etc.
start with the letters NS, which stands for NextStep
Foundation software Components: NS... : S
CoreMIDI constants
Start of kMIDIC,,,
Start of kMIDII...
Start of kMIDIM...
Start of kMIDIN...
Start of kMIDIO...
- kMIDIObjectType_ExternalEntity
- kMIDIObjectType_ExternalDestination
- kMIDIObjectType_ExternalMask -- This actually appears twice in the
documentation page for MIDIObjectType
- kMIDIObjectType_ExternalSource
- kMIDIObjectType_Other
- kMIDIObjectType_Entity
- kMIDIObjectType_Destination
- kMIDIObjectType_Source
Start of kMIDIP...
Start of kMIDIU...
- kMIDIUnknownEndpoint
- kMIDIUnknownPropertyType
Start of kMIDIW...
- kMIDIWrongEndpointType
- kMIDIWrongPropertyType
Start of Core Foundation...
Start of CFA...
Start of CFD...
CoreMIDI function, typedef, struct, enum, etc.
Start of MIDI1...
-
MIDI1UPNoteOn This is a function that creates a MIDI packet for a NoteOn Message. It returns a MIDIMessage32 format
packet. What does the UP stand for? (Universal Packet? Groups appears to be a MIDI 2 concept.)
Start of MIDIC...
Start of MIDID...
Start of MIDIE...
Start of MIDIF...
Start of MIDIG...
Start of MIDII...
Start of MIDIM...
Start of MIDIN...
Start of MIDIO...
-
MIDIObjectFindByUniqueID
- MIDIObjectGetIntegerProperty
- MIDIObjectGetStringProperty
- MIDIObjectRef This is a generic pointer to a MIDI object.
There are several subclasses, such as MIDIDeviceRef, MIDIEntityRef, and MIDIPortRef, etc.
- MIDIObjectType
- kMIDIObjectType_ExternalEntity
- kMIDIObjectType_ExternalDestination
- kMIDIObjectType_ExternalMask -- This actually appears twice
in the documentation page for MIDIObjectType
- kMIDIObjectType_ExternalSource
- kMIDIObjectType_Other
- kMIDIObjectType_Entity
- kMIDIObjectType_Destination
- kMIDIObjectType_Source
- MIDIOutputPortCreate Creates an output port through which a client sends outgoing MIDI messages to any MIDI destination.
- MIDIOutputPortCreateWithProtocol - Creates an output port through which a client sends outgoing MIDI messages to any MIDI destination. Part of
the additions for MIDI 2.0
Start of MIDIP...
- MIDIPacket
Compare to MIDIEventPacket
- MIDITimeStamp timeStamp
- UInt16 lngth
- Byte data[256]
- MIDIPacketList
There appears to be a 32 bit unsigned integer at the start of the PacketList, with the rest of the PacketList structure being taken
up by a number of variable length packets. With the total number of packets given by the integer in the first four bytes. This structure is
only for use with MIDI 1 packets. Each packet can have multiple MIDI messages.
- MIDIPacketListAdd Replacement will be MIDIEventListAdd.
- MIDIPacketListInit
-
MIDIPacketNext
-
MIDIPortConnectSource The Apple documentation needs some reworking. For connRefCon, the text
reads "The data passed to the port's MIDIReadProc or MIDIReadBlock to identify the source"
where the list of items should read "MIDIReadProc, MIDIReadBlock, or MIDIReceiveBlock". For
port, only MIDIReadProc is mentioned.
-
MIDIPortDisconnectSource
- MIDIPortDispose
- MIDIPortRef
- MIDIProtocolID There are two possible values in this enum:
Start of MIDIR...
- MIDIReadBlock
Although the documentation is in the Deprecated Symbols
section of the web site, it was not marked as deprecated, although imany of the other items used
with it are marked as deprecated. There
seems to be some confusion with the connections between the MIDIReadBlock, MIDIReadProc, and
MIDIReceiveBlock. The following items
have the suffix WithBlock and seem to be associated with the MIDIReadBlock.
It may be that C functions called by MIDIReadBlock have to be defined in
header files so thar the client knows how to get to them. It is unclear if Objective-C methods
can be called within a block.
The MIDI client executes the MIDIReadBlock on a high-priority queue. A problem may be that some
functions refuse to work on a high-priority queue or only work on the main queue. In this case,
it may be necessary to set up some kind of message queue between the MIDIReadBlock block and instances of
BRossToolsTextWindow that allows concurrent operation.
- MIDIReadProc The description is confusing. When I tried using MIDIReadProc, I had a message that
a thread was started in the main queue and that that
was not allowed. However, that seemed to start when a key was pressed. Although the
documentation is in the Deprecated Symbols
section of the web site, it was not marked as deprecated, although imany of the
other items used with it are marked as deprecated.
(MIKMIDI Mapping)
-
MIDIReceiveBlock
(macOS 11.0+) This is an
Objective-C block used by the
MIDIInputPortCreateWithProtocol
and MIDIDestinationCreateWithProtocol
functions. Although it is in the deprecated symbols part of
the web site, it is not marked as deprecated. It seems like is is needed by other functions that have not been
deprecated.
The MIDIReceiveBlock is used with the MIDIInputPortCreateWithProtocol and
MIDIDestinationCreateWithProtocol objects and is
part of the additions for handling MIDI 2.0.
-
MIDIReceivedEventList
-
MIDIRestart
Start of MIDIS...
Start of MIDIT...
Foundation Framework
Functions: S T V W
Start of NSS...
Start of NST...
Start of NSV...
Start of NSW...