midi_insert_program_change
Insert a MIDI Program Change event into a track, optionally adding Bank Select CCs first, to switch hardware-style instrument sounds at a precise position.
Instructions
Insert a MIDI Program Change, optionally preceded by Bank Select.
This is how emulations of classic hardware switch sounds. Their program list is often inert through the FX preset selector while Program Change works — check with midi_list_programs which programs a track offers.
Bank Select (CC 0 / CC 32) is written before the Program Change when given, one tick apart so the order cannot be reordered away. Omit both for instruments with a single bank.
Args: track_index: 0-based track index. item_index: MIDI item index. channel: 0-15, 0-based (REAPER's UI shows 1-16). program: 0-127, 0-based (the UI usually shows 1-128). position: Seconds. Place it before the notes it should affect. bank_msb: Optional Bank Select MSB (CC 0), 0-127. bank_lsb: Optional Bank Select LSB (CC 32), 0-127.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| program | Yes | ||
| bank_lsb | No | ||
| bank_msb | No | ||
| position | Yes | ||
| item_index | Yes | ||
| track_index | Yes |