configure_midi_input
Set a track's record input to a MIDI device and channel, arm or monitor as needed, then verify the settings. Use after get_midi_inputs to specify a device.
Instructions
Set one track's record input to a MIDI device and channel, optionally record-arm it and turn input monitoring on or off, then read the values back. Omitted arm/monitor are left unchanged; the record input is always set (device 63, channel 0 when omitted). Returns {track_guid, input, armed, monitoring}, where input is REAPER's I_RECINPUT code (4096 + device*32 + channel). Errors: NO_MIDI_INPUT (device index not present), BAD_PAYLOAD (value out of range), VERIFY_FAILED (REAPER did not keep the setting), NO_TARGET_TRACK / AMBIGUOUS_TARGET_TRACK. Undoable. Use get_midi_inputs first to find the device index.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arm | No | true arms the track for recording, false disarms; omit to leave as is. | |
| track | No | Exact track name (case-insensitive); "master" targets the master track. Used when no GUID is given; errors if two tracks share the name. | |
| device | No | Device index from get_midi_inputs; 62 = virtual MIDI keyboard, 63 = all devices (default). | |
| channel | No | MIDI channel to record: 0 = all channels (default), 1..16 = that channel only. | |
| dry_run | No | Preview: return what would run without changing the project. | |
| monitor | No | true turns input monitoring on, false off; omit to leave as is. | |
| track_contains | No | Case-insensitive substring; used only when no GUID or exact name is given. Errors if it matches more than one track. | |
| target_track_guid | No | Stable REAPER track GUID; preferred when available. Wins over every other track selector. | |
| use_selected_track | No | Target the first selected track; ignored when any other track selector is given. Errors if nothing is selected. |