midi_note_off()

Sends a “note off” MIDI message to a specified MIDI channel with a given note number and optional velocity.

Syntax

midi_note_off(channel, note_number, [velocity])

Parameters

Parameter Type Description Comment
channel Number The MIDI channel (0-15). Valid values are 0-15.
note_number Number The note number (0-127). Represents the MIDI note (e.g., 60 = Middle C).
velocity Number The velocity of the note (0.0 to 1.0). Optional. If not provided, defaults to 0 (note off).

Return Value

Examples

Send a “note off” message for channel 1, note 60 (Middle C) with velocity 0.5

midi_note_off(1, 60, 0.5); // returns 1 if successful

Send a “note off” message for channel 0, note 64 (E4) with default velocity 0

midi_note_off(0, 64); // returns 1 if successful

See also

midi_note_on
midi_note_off
midi_ctrl
midi_prog
midi_play
midi_stop
midi_is_playing

midiin_channel
midiin_prog
midiin_note
midiin_ctrl