insert_midi_file
Insert a .mid file onto a REAPER track at a chosen position. Write MIDI externally, then add it without overwriting existing items unless replace is enabled.
Instructions
Insert a .mid file from disk onto a track at a position. Write the MIDI yourself, then insert. Never overwrites existing items unless replace_existing_in_range is true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| loop | No | ||
| track | No | Exact track name (case-insensitive). | |
| length | No | {type: bars|region|time_selection|seconds|as_generated, ...} | |
| dry_run | No | Preview: return what would run without changing the project. | |
| position | No | Position object, e.g. {"type":"cursor"}, {"type":"bar","bar":33}, {"type":"time","seconds":12.5}, {"type":"marker","name":"Chorus"}, {"type":"region","name":"Verse 1"}, {"type":"time_selection"} | |
| midi_path | Yes | Absolute path to the .mid file. | |
| track_contains | No | Case-insensitive substring; errors if it matches more than one track. | |
| target_track_guid | No | Stable REAPER track GUID; preferred when available. | |
| use_selected_track | No | Target the currently selected track instead of naming one. | |
| replace_existing_in_range | No |