AKMIDISampler

open class AKMIDISampler: AKSampler

MIDI receiving Sampler

Be sure to enableMIDI if you want to receive messages

  • MIDI Input

    Declaration

    Swift

    open var midiIn = MIDIEndpointRef()
  • Name of the instrument

    Declaration

    Swift

    open var name = "AKMIDISampler"
  • Enable MIDI input from a given MIDI client This is not in the init function because it must be called AFTER you start AudioKit

    • Parameters:
      • midiClient: A refernce to the MIDI client
      • name: Name to connect with

    Declaration

    Swift

    open func enableMIDI(_ midiClient: MIDIClientRef, name: String)

    Parameters

    midiClient

    A refernce to the MIDI client

    name

    Name to connect with

  • Handle MIDI commands that come in externally

    • Parameters:
      • noteNumber: MIDI Note number
      • velocity: MIDI velocity
      • channel: MIDI channel

    Declaration

    Swift

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

    Parameters

    noteNumber

    MIDI Note number

    velocity

    MIDI velocity

    channel

    MIDI channel

  • Handle MIDI CC that come in externally

    • Parameters:
      • cc: MIDI cc number
      • value: MIDI cc value
      • channel: MIDI cc channel

    Declaration

    Swift

    open func midiCC(_ cc: Int, value: Int, channel: MIDIChannel)

    Parameters

    cc

    MIDI cc number

    value

    MIDI cc value

    channel

    MIDI cc channel

  • Start a note

    Declaration

    Swift

    open override func play(noteNumber: MIDINoteNumber,
                                velocity: MIDIVelocity,
                                channel: MIDIChannel)
  • Stop a note

    Declaration

    Swift

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