midi_prog()

Sends a MIDI program change message to a specified MIDI channel with a given program number.

Syntax

midi_prog(channel, program_number)

Parameters

Parameter Type Description Comment
channel Number The MIDI channel (0-15). Valid values are 0-15.
program_number Number The program number (0-127) to change the instrument to. A value between 0 and 127, representing the program change (instrument patch).

Return Value

Examples

Send a “program change” on channel 1, with program number 45 (a specific instrument)

midi_prog(1, 45); // returns 1 if successful

Send a “program change” on channel 0, with program number 10 (a different instrument)

midi_prog(0, 10); // 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