set_midi_note
Edit an existing MIDI note's pitch, start, length, or channel in REAPER. Only the fields you pass change, so use it to adjust notes without recreating them.
Instructions
Edit one existing MIDI note in place: pitch, start, length and/or channel. Only the fields you pass change, and at least one is required. (Velocity: set_midi_note_velocity.)
note_index is REAPER's PPQ-sorted index from get_midi_notes / get_selected_midi_notes and is unstable - re-read after the edit, since the returned list reflects the new order.
Args: pitch: New pitch (0-127). start_beat: New start in beats from item start; length is preserved. A start before the item start clamps there and is counted in out_of_bounds, not clamped. length_beats: New length in beats (> 0), resized from the current start. channel: New MIDI channel (0-15).
Returns: {ok, notes_changed, clamped, skipped, out_of_bounds, notes:[...]}, or {ok:false, error} for a bad index, an empty edit, or an out-of-range value (nothing is written).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pitch | No | ||
| fields | No | ||
| channel | No | ||
| item_index | Yes | ||
| note_index | Yes | ||
| start_beat | No | ||
| track_index | Yes | ||
| length_beats | No | ||
| return_notes | No |