AKMIDI

open class AKMIDI

MIDI input and output handler

You add MIDI listeners like this:

var midiIn = AudioKit.midi
midi.openInput()
midi.addListener(someClass)

…where someClass conforms to the AKMIDIListener protocol

You then implement the methods you need from AKMIDIListener and use the data how you need.

  • MIDI Client Reference

    Declaration

    Swift

    open var client: MIDIClientRef
  • Virtual MIDI Input destination

    Declaration

    Swift

    open var virtualInput: MIDIPortRef
  • Virtual MIDI output

    Declaration

    Swift

    open var virtualOutput: MIDIPortRef
  • Array of MIDI Endpoints

    Declaration

    Swift

    open var endpoints: [String : MIDIEndpointRef]
  • Initialize the AKMIDI system

    Declaration

    Swift

    @objc
    public init()
  • Create set of virtual MIDI ports

    Declaration

    Swift

    open func createVirtualPorts(_ uniqueID: Int32 = 2_000_000, name: String? = nil)
  • Create a virtual MIDI input port

    Declaration

    Swift

    open func createVirtualInputPort(_ uniqueID: Int32 = 2_000_000, name: String? = nil)
  • Create a virtual MIDI output port

    Declaration

    Swift

    open func createVirtualOutputPort(_ uniqueID: Int32 = 2_000_000, name: String? = nil)
  • Discard all virtual ports

    Declaration

    Swift

    open func destroyVirtualPorts()
  • Closes the virtual input port, if created one already.

    Declaration

    Swift

    @discardableResult
    open func destroyVirtualInputPort() -> Bool

    Return Value

    Returns true if virtual input closed.

  • Closes the virtual output port, if created one already.

    Declaration

    Swift

    @discardableResult
    open func destroyVirtualOutputPort() -> Bool

    Return Value

    Returns true if virtual output closed.

  • Array of input names

    Declaration

    Swift

    public var inputNames: [String] { get }
  • Add a listener to the listeners

    Declaration

    Swift

    public func addListener(_ listener: AKMIDIListener)
  • Remove all listeners

    Declaration

    Swift

    public func clearListeners()
  • Add a transformer to the transformers list

    Declaration

    Swift

    public func addTransformer(_ transformer: AKMIDITransformer)
  • Remove all transformers

    Declaration

    Swift

    public func clearTransformers()
  • Open a MIDI Input port

    Declaration

    Swift

    public func openInput(_ namedInput: String = "")

    Parameters

    namedInput

    String containing the name of the MIDI Input

  • Close a MIDI Input port

    Declaration

    Swift

    public func closeInput(_ namedInput: String = "")

    Parameters

    namedInput

    String containing the name of the MIDI Input

  • Close all MIDI Input ports

    Declaration

    Swift

    public func closeAllInputs()