MIDI

  • MIDI input and output handler

    You add MIDI listeners like this:

    var midiIn = AKMIDI()
    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.

    See more

    Declaration

    Swift

    open class AKMIDI
  • A container for the values that define a MIDI event

    See more

    Declaration

    Swift

    public struct AKMIDIEvent
  • Value of byte 2 in conjunction with AKMIDIStatusControllerChange

    • ModulationWheel: Modulation Control
    • BreathControl: Breath Control (in MIDI Saxophones for example)
    • FootControl: Foot Control
    • Portamento: Portamento effect
    • DataEntry: Data Entry
    • MainVolume: Volume (Overall)
    • Balance
    • Pan: Stereo Panning
    • Expression: Expression Pedal
    • LSB: Least Significant Byte
    • DamperOnOff: Damper Pedal, also known as Hold or Sustain
    • PortamentoOnOff: Portamento Toggle
    • SustenutoOnOff: Sustenuto Toggle
    • SoftPedalOnOff: Soft Pedal Toggle
    • DataEntryPlus: Data Entry Addition
    • DataEntryMinus: Data Entry Subtraction
    • LocalControlOnOff: Enable local control
    • AllNotesOff: MIDI Panic
    • CC# (0, 3, 9, 12-31) Unnamed Continuous Controllers
    See more

    Declaration

    Swift

    public enum AKMIDIControl: MIDIByte
  • Protocol that must be adhered to if you want your class to respond to MIDI

    Implement the AKMIDIListener protocol on any classes that need to respond to incoming MIDI events. Every method in the protocol is optional to allow the classes complete freedom to respond to only the particular MIDI messages of interest.

    See more

    Declaration

    Swift

    public protocol AKMIDIListener
  • A version of AKInstrument specifically targeted to instruments that should be triggerable via MIDI or sequenced with the sequencer.

    See more

    Declaration

    Swift

    open class AKMIDINode: AKNode, AKMIDIListener
  • MIDI receiving Sampler

    Be sure to enableMIDI if you want to receive messages

    See more

    Declaration

    Swift

    open class AKMIDISampler: AKSampler
  • Potential MIDI Status messages

    • NoteOff: something resembling a keyboard key release
    • NoteOn: triggered when a new note is created, or a keyboard key press
    • PolyphonicAftertouch: rare MIDI control on controllers in which every key has separate touch sensing
    • ControllerChange: wide range of control types including volume, expression, modulation and a host of unnamed controllers with numbers
    • ProgramChange: messages are associated with changing the basic character of the sound preset
    • ChannelAftertouch: single aftertouch for all notes on a given channel (most common aftertouch type in keyboards)
    • PitchWheel: common keyboard control that allow for a pitch to be bent up or down a given number of semitones
    • SystemCommand: differ from system to system
    See more

    Declaration

    Swift

    public enum AKMIDIStatus: Int
  • MIDI System Command

    • None: Trivial Case
    • Sysex: System Exclusive
    • SongPosition: Song Position
    • SongSelect: Song Selection
    • TuneRequest: Request Tune
    • SysexEnd: End System Exclusive
    • Clock
    • Start
    • Continue
    • Stop
    • ActiveSensing: Active Sensing
    • SysReset: System Reset
    See more

    Declaration

    Swift

    public enum AKMIDISystemCommand: MIDIByte
  • Allows a MIDIPacket to be iterated through with a for statement. This is necessary because MIDIPacket can contain multiple midi events, but Swift makes this unnecessarily hard because the MIDIPacket struct uses a tuple for the data field. Grrr!

    Example usage: let packet: MIDIPacket for message in packet { // message is a Message }

    See more

    Declaration

    Swift

    struct MIDIPacket