AKMIDISampler

open class AKMIDISampler : AKAppleSampler

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: String
  • Initialize the MIDI Sampler

    Declaration

    Swift

    public init(midiOutputName: String? = nil)

    Parameters

    midiOutputName

    Name of the instrument’s MIDI output

  • 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 = AudioKit.midi.client,
                         name: String = "MIDI Sampler")

    Parameters

    midiClient

    A reference to the MIDI client

    name

    Name to connect with

  • Start a note or trigger a sample

    NB: when using an audio file, noteNumber 60 will play back the file at normal speed, 72 will play back at double speed (1 octave higher), 48 will play back at half speed (1 octave lower) and so on

    Declaration

    Swift

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

    Parameters

    noteNumber

    MIDI note number

    velocity

    MIDI velocity

    channel

    MIDI channel

  • Stop a note

    Declaration

    Swift

    open override func stop(noteNumber: MIDINoteNumber, channel: MIDIChannel) throws
  • Discard all virtual ports

    Declaration

    Swift

    open func destroyEndpoint()