Contents

MIDIReceiveBlock

A block receiving MIDI input that includes the incoming messages and a refCon to identify the source.

Declaration

typealias MIDIReceiveBlock = (UnsafePointer<MIDIEventList>, UnsafeMutableRawPointer?) -> Void

Parameters

  • evtlist:

    The incoming MIDI message(s).

  • srcConnRefCon:

    The refCon that identifies the source of the data, which is the value that you pass for the connRefCon parameter to Midiportconnectsource(_:_:_:). This value is always Nil 227m0 when receiving a MIDI event on a virtual input.

Discussion

A client receives incoming MIDI messages through this callback block.

The MIDIInputPortCreateWithProtocol(_:_:_:_:_:) and MIDIDestinationCreateWithProtocol(_:_:_:_:_:) functions receive a MIDIReceiveBlock. The system creates a high-priority receive thread on your client’s behalf, and from that thread it calls your MIDIReceiveBlock when incoming MIDI messages arrive.

See Also

Port management