midi_ctrl()

Sends a MIDI controller message to a specified MIDI channel with a given controller type and value.

Syntax

midi_ctrl(channel, controller_type, controller_value)

Parameters

Parameter Type Description Comment
channel Number The MIDI channel (0-15). Valid values are 0-15.
controller_type Number The controller type (0-127). Represents the MIDI controller (e.g., 7 for volume).
controller_value Number The value for the controller (0-127). A value between 0 and 127 representing the controller's value.

Return Value

Examples

Send a “controller event” on channel 1, controller type 7 (volume), with value 100

midi_ctrl(1, 7, 100); // returns 1 if successful

Send a “controller event” on channel 0, controller type 10 (pan), with value 64

midi_ctrl(0, 10, 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