Send raw MIDI message

midi_raw  a (byte), b (byte), c (byte)

Sends the raw MIDI message to all connected MIDI devices. Gives you direct access to the individual bytes of a MIDI message. Typically this should be rarely used - prefer the other midi_ fns where possible.

A raw MIDI message consists of 3 separate bytes - the Status Byte and two Data Bytes. These may be passed as base 10 decimal integers between 0 and 255, in hex form by prefixing 0x such as 0xb0 which in decimal is 176 or binary form by prefixing 0b such as 0b01111001 which represents 121 in decimal.

Floats will be rounded up or down to the nearest whole number e.g. 176.1 -> 176, 120.5 -> 121, 0.49 -> 0.

Non-number values will be automatically turned into numbers prior to sending the event if possible (if this conversion does not work an Error will be thrown).

See https://www.midi.org/specifications/item/table-1-summary-of-midi-message for a summary of MIDI messages and their corresponding byte structures.

Introduced in v3.0

Options

port:

Port(s) to send the raw MIDI message events to

on:

If specified and false/nil/0 will stop the raw midi message from being sent out. (Ensures all opts are evaluated in this call to midi_raw regardless of value).

Examples

# Example 1

midi_raw 176, 121, 0 



#=> Sends the MIDI reset command



# Example 2

midi_raw 176.1, 120.5, 0.49 



#=> Sends the MIDI reset command (values are rounded down, up and down respectively)



# Example 3

midi_raw 0xb0, 0x79, 0x0 



#=> Sends the MIDI reset command



# Example 4

midi_raw 0b10110000, 0b01111001, 0b00000000 



#=> Sends the MIDI reset command