AKCallbackInstrument

open class AKCallbackInstrument: AKMIDIInstrument

MIDI Instrument that triggers functions on MIDI note on/off commands

  • All callbacks that will get triggered by MIDI events

    Declaration

    Swift

    open var callback: AKMIDICallback?
  • Initialize the callback instrument

    Declaration

    Swift

    public init(callback: AKMIDICallback? = nil)

    Parameters

    callback

    Initial callback

  • Will trigger in response to any noteOn Message

    • Parameters:
      • noteNumber: MIDI Note Number being started
      • velocity: MIDI Velocity (0-127)
      • channel: MIDI Channel

    Declaration

    Swift

    override open func start(noteNumber: MIDINoteNumber,
                                              velocity: MIDIVelocity,
                                              channel: MIDIChannel)

    Parameters

    noteNumber

    MIDI Note Number being started

    velocity

    MIDI Velocity (0-127)

    channel

    MIDI Channel

  • Will trigger in response to any noteOff Message

    • Parameters:
      • noteNumber: MIDI Note Number being stopped
      • velocity: MIDI Velocity (0-127)
      • channel: MIDI Channel

    Declaration

    Swift

    override open func stop(noteNumber: MIDINoteNumber, channel: MIDIChannel)

    Parameters

    noteNumber

    MIDI Note Number being stopped

    velocity

    MIDI Velocity (0-127)

    channel

    MIDI Channel