AKMIDIListener

public protocol AKMIDIListener

Protocol that must be adhered to if you want your class to respond to MIDI

Implement the AKMIDIListener protocol on any classes that need to respond to incoming MIDI events. Every method in the protocol is optional to allow the classes complete freedom to respond to only the particular MIDI messages of interest.

  • Receive the MIDI note on event

    • Parameters:
      • noteNumber: MIDI Note number of activated note
      • velocity: MIDI Velocity (0-127)
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive the MIDI note on event

    • Parameters:
      • noteNumber: Note number of activated note
      • velocity: MIDI Velocity (0-127)
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDINoteOn(noteNumber: MIDINoteNumber,

    Parameters

    noteNumber

    MIDI Note number of activated note

    velocity

    MIDI Velocity (0-127)

    channel

    MIDI Channel (1-16)

  • Receive the MIDI note off event

    • Parameters:
      • noteNumber: MIDI Note number of released note
      • velocity: MIDI Velocity (0-127) usually speed of release, often 0.
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive the MIDI note off event

    • Parameters:
      • noteNumber: Note number of released note
      • velocity: MIDI Velocity (0-127) usually speed of release, often 0.
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDINoteOff(noteNumber: MIDINoteNumber,

    Parameters

    noteNumber

    MIDI Note number of released note

    velocity

    MIDI Velocity (0-127) usually speed of release, often 0.

    channel

    MIDI Channel (1-16)

  • Receive a generic controller value

    • Parameters:
      • controller: MIDI Controller Number
      • value: Value of this controller
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive a generic controller value

    • Parameters:
      • controller: MIDI Controller Number
      • value: Value of this controller
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDIController(_ controller: MIDIByte, value: MIDIByte, channel: MIDIChannel)

    Parameters

    controller

    MIDI Controller Number

    value

    Value of this controller

    channel

    MIDI Channel (1-16)

  • Receive single note based aftertouch event

    • Parameters:
      • noteNumber: Note number of touched note
      • pressure: Pressure applied to the note (0-127)
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive single note based aftertouch event

    • Parameters:
      • noteNumber: Note number of touched note
      • pressure: Pressure applied to the note (0-127)
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDIAftertouch(noteNumber: MIDINoteNumber,

    Parameters

    noteNumber

    Note number of touched note

    pressure

    Pressure applied to the note (0-127)

    channel

    MIDI Channel (1-16)

  • receivedMIDIAfterTouch(_:channel:) Default implementation

    Receive global aftertouch

    • Parameters:
      • pressure: Pressure applied (0-127)
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive global aftertouch

    • Parameters:
      • pressure: Pressure applied (0-127)
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDIAfterTouch(_ pressure: MIDIByte, channel: MIDIChannel)

    Parameters

    pressure

    Pressure applied (0-127)

    channel

    MIDI Channel (1-16)

  • receivedMIDIPitchWheel(_:channel:) Default implementation

    Receive pitch wheel value

    • Parameters:
      • pitchWheelValue: MIDI Pitch Wheel Value (0-16383)
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive pitch wheel value

    • Parameters:
      • pitchWheelValue: MIDI Pitch Wheel Value (0-16383)
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDIPitchWheel(_ pitchWheelValue: MIDIWord, channel: MIDIChannel)

    Parameters

    pitchWheelValue

    MIDI Pitch Wheel Value (0-16383)

    channel

    MIDI Channel (1-16)

  • receivedMIDIProgramChange(_:channel:) Default implementation

    Receive program change

    • Parameters:
      • program: MIDI Program Value (0-127)
      • channel: MIDI Channel (1-16)

    Default Implementation

    Receive program change

    • Parameters:
      • program: MIDI Program Value (0-127)
      • channel: MIDI Channel (1-16)

    Declaration

    Swift

    func receivedMIDIProgramChange(_ program: MIDIByte, channel: MIDIChannel)

    Parameters

    program

    MIDI Program Value (0-127)

    channel

    MIDI Channel (1-16)

  • receivedMIDISystemCommand(_:) Default implementation

    Receive a midi system command (such as clock, sysex, etc)

    Default Implementation

    Receive a midi system command (such as clock, sysex, etc)

    Declaration

    Swift

    func receivedMIDISystemCommand(_ data: [MIDIByte])

    Parameters

    data

    Array of integers

  • receivedMIDISetupChange() Default implementation

    MIDI Setup has changed

    Default Implementation

    MIDI Setup has changed

    Declaration

    Swift

    func receivedMIDISetupChange()