get_selected_midi_notes
Fetches selected MIDI notes in REAPER's editor for the active take, returning pitch, beat positions, and channel. Use it to convert a manual selection into an explicit filter for targeted MIDI edits.
Instructions
Read the MIDI notes currently SELECTED in REAPER's editor for the active take.
The escape hatch for "operate on what I've selected": select notes by hand in REAPER, call this to see which they are, then translate that into an explicit value filter (pitch range / beat window / channel) for the transform tools. Read-only, no undo.
Returns:
{ok, notes:[...], ret} - the selected notes, same shape as get_midi_notes (each note
carries item-relative start_beat/end_beat). index is REAPER's absolute PPQ-sorted
note index, so a partial selection is non-contiguous. Empty selection -> notes:[].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | ||
| item_index | Yes | ||
| track_index | Yes |