pitch

    The pitch index number of this MIDI signal. This value ranges from 0 to 127. On a piano, middle C is 60, and A440 is 69, see the “MIDI note” column of the piano key frequency chart on Wikipedia for more information.

    InputEventMIDI.swift:57
    final var pitch: Int32 { get set }

    Other members in extension

    Type members

    Instance members

    • var channel: Int32

      The MIDI channel of this input event. There are 16 channels, so this value ranges from 0 to 15. MIDI channel 9 is reserved for the use with percussion instruments, the rest of the channels are for non-percussion instruments.

    • var controllerNumber: Int32

      If the message is controlChange, this indicates the controller number, otherwise this is zero. Controllers include devices such as pedals and levers.

    • var controllerValue: Int32

      If the message is controlChange, this indicates the controller value, otherwise this is zero. Controllers include devices such as pedals and levers.

    • var instrument: Int32

      The instrument of this input event. This value ranges from 0 to 127. Refer to the instrument list on the General MIDI wikipedia article to see a list of instruments, except that this value is 0-index, so subtract one from every number on that chart. A standard piano will have an instrument number of 0.

    • var message: MIDIMessage

      Returns a value indicating the type of message for this MIDI signal. This is a member of the MIDIMessage enum.

    • var pressure: Int32

      The pressure of the MIDI signal. This value ranges from 0 to 127. For many devices, this value is always zero.

    • var velocity: Int32

      The velocity of the MIDI signal. This value ranges from 0 to 127. For a piano, this corresponds to how quickly the key was pressed, and is rarely above about 110 in practice.