Contents

kAudioUnitProperty_MIDIOutputCallback

A write-only AUMIDIOutputCallbackStruct struct, valid on the audio unit global scope.

Declaration

var kAudioUnitProperty_MIDIOutputCallback: AudioUnitPropertyID { get }

Discussion

The host sets this property on the audio unit with the callback (and its user data) set appropriately.

Operational Parameters: In the render call, just as is the expected usage of the AUHostCallbacks, the audio unit can call the provided callback to provide MIDI data to the host that it will associate with the current AudioUnitRender call in process.

The audio unit in the callback provides the following:

  • the user data provided by the host when the callback was established

  • the AudioTimeStamp that was provided to the audio unit for this particular call of AudioUnitRender

  • the output number to associate this MIDI data with

  • a MIDI Packet List containing MIDI data. The time stamp values contained within the MIDIPackets in this list are **sample offsets*** from the AudioTimeStamp provided

This allows MIDI data to be time-stamped with a sample offset that is directly associated with the audio data it is generating in the current call to the AudioUnitRender function.

There is no implied or expected association between the number (or position) of an audio unit’s audio or MIDI outputs.

See Also

Properties