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 = "MIDI Sampler"
  • Initialize the MIDI Sampler

    Declaration

    Swift

    public override init()
  • Enable MIDI input from a given MIDI client This is not in the init function because it must be called AFTER you start AudioKit

    Declaration

    Swift

    open func enableMIDI(_ midiClient: MIDIClientRef = AKMIDI().client,
                             name: String = "MIDI Sampler")

    Parameters

    midiClient

    A refernce to the MIDI client

    name

    Name to connect with

  • Handle MIDI commands that come in externally

    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

    Declaration

    Swift

    open func midiCC(_ controller: MIDIByte, value: MIDIByte, channel: MIDIChannel)

    Parameters

    controller

    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)
  • Discard all virtual ports

    Declaration

    Swift

    open func destroyEndpoint()