AKMIDIEvent

public struct AKMIDIEvent

A container for the values that define a MIDI event

  • Internal data

    Declaration

    Swift

    public var internalData = [MIDIByte](zeros: 128)
  • Status

    Declaration

    Swift

    public var status: AKMIDIStatus?
  • System Command

    Declaration

    Swift

    public var command: AKMIDISystemCommand?
  • MIDI Channel

    Declaration

    Swift

    public var channel: MIDIChannel?
  • MIDI Note Number

    Declaration

    Swift

    public var noteNumber: MIDINoteNumber?
  • First data byte

    Declaration

    Swift

    public var data1: MIDIByte
  • Second data byte

    Declaration

    Swift

    public var data2: MIDIByte
  • Initialize the MIDI Event from a MIDI Packet

    Declaration

    Swift

    public init(packet: MIDIPacket)

    Parameters

    packet

    MIDIPacket that is potentially a known event type

  • Generate array of MIDI events from Bluetooth data

    Declaration

    Swift

    public static func generateFrom(bluetoothData: [MIDIByte]) -> [AKMIDIEvent]
  • Initialize the MIDI Event from a raw MIDIByte packet (ie. from Bluetooth)

    Declaration

    Swift

    public init(data: [MIDIByte])

    Parameters

    data

    [MIDIByte] bluetooth packet

  • Create note on event

    Declaration

    Swift

    public init(noteOn noteNumber: MIDINoteNumber,
                    velocity: MIDIVelocity,
                    channel: MIDIChannel)

    Parameters

    noteNumber

    MIDI Note number

    velocity

    MIDI Note velocity (0-127)

    channel

    Channel on which the note appears

  • Create note off event

    Declaration

    Swift

    public init(noteOff noteNumber: MIDINoteNumber,
                    velocity: MIDIVelocity,
                    channel: MIDIChannel)

    Parameters

    noteNumber

    MIDI Note number

    velocity

    MIDI Note velocity (0-127)

    channel

    Channel on which the note appears

  • Create program change event

    Declaration

    Swift

    public init(programChange data: MIDIByte,
                    channel: MIDIChannel)

    Parameters

    data

    Program change byte

    channel

    Channel on which the program change appears

  • Create controller event

    Declaration

    Swift

    public init(controllerChange controller: MIDIByte,
                    value: MIDIByte,
                    channel: MIDIChannel)

    Parameters

    controller

    Controller number

    value

    Value of the controller

    channel

    Channel on which the controller value has changed

  • Array of MIDI events from a MIDI packet list poionter

    Declaration

    Swift

    static public func midiEventsFrom(packetListPointer: UnsafePointer< MIDIPacketList>) -> [AKMIDIEvent]