Tool reference
All 142 tools with their arguments, generated from the tool definitions. To change a
description, edit src/server/mod.rs or src/args/ and run
REAPER_MCP_UPDATE_DOCS=1 cargo test.
Track indexes start at 0; -1 is the master track.
add_fx
Append an FX to a track by name, or with item to that item’s active take (take FX). Returns the new FX index and parameter count.
| Argument | Type | Description |
|---|---|---|
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
name (required) | string | FX name as REAPER shows it, for example VST: ReaEQ (Cockos) or just ReaEQ. |
track (required) | integer | Zero-based track index; -1 is the master track. |
add_markers
Add markers (a position) and regions (a position and an end) by name at project times in seconds, for navigating a long project. Existing markers are kept unless clear is true.
| Argument | Type | Description |
|---|---|---|
clear | boolean | Delete all existing markers and regions first (default false). |
markers (required) | array | Markers and regions to add. |
add_midi_events
Add MIDI events to an item: CC (with an optional curve shape), pitch bend, program change, channel pressure, poly aftertouch, text, lyric, marker, cue or sysex.
| Argument | Type | Description |
|---|---|---|
events (required) | array | The events to add. |
item (required) | integer | Zero-based index of the MIDI item on the track. |
track (required) | integer | Zero-based track index. |
add_midi_notes
Add notes to an existing MIDI item (times in project seconds).
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based index of the MIDI item on the track. |
notes (required) | array | |
track (required) | integer |
add_take
Add a take that plays another audio file to an item (for comp takes or alternatives). The active take stays unless activate is true. Returns the takes.
| Argument | Type | Description |
|---|---|---|
activate | boolean | Make the new take the active one (default false: the current take stays active). |
item (required) | integer | Zero-based item index from list_items. |
path (required) | string | Absolute path of the audio file the new take plays. |
track (required) | integer | Zero-based track index. |
analyze_audio
Analyse a rendered WAV file: integrated loudness (LUFS), loudness range, sample peak, samples above full scale (overloads), crest factor, stereo width and the spectrum in third-octave and coarse mixing bands. Reads 32-bit float files without cutting off levels above 0 dBFS. Warns about overloads and missing headroom.
| Argument | Type | Description |
|---|---|---|
end_seconds | number | Analyse only up to this time in seconds (default: end of the file). |
path (required) | string | Absolute path of a WAV file (16, 24 or 32-bit integer, or 32-bit float). |
start_seconds | number | Analyse only from this time in seconds (default: start of the file). |
analyze_item
Analyse an item’s active take without rendering, read through REAPER’s audio accessor (with take FX, take volume and pitch, not track FX): integrated loudness, loudness range, sample peak, crest factor, stereo width, spectrum in third-octave and coarse mixing bands, and a peak overview in project time that shows where the item is loud or silent. Seconds count from the item start.
| Argument | Type | Description |
|---|---|---|
end_seconds | number | End in seconds from the item start; default: the item end. |
item (required) | integer | Item index on the track; its active take is read, with take FX, volume and pitch. |
peak_windows | integer | Number of windows in the peak overview (default 20). |
start_seconds | number | Start in seconds from the item start; default: the item start. |
track (required) | integer |
analyze_track
Analyse a track’s items without rendering, read through REAPER’s audio accessor in project time (the items as the track plays them, before track FX, sends and the fader; render for the processed sound): integrated loudness, loudness range, sample peak, crest factor, stereo width, spectrum in third-octave and coarse mixing bands, and a peak overview that shows where the track is loud or silent.
| Argument | Type | Description |
|---|---|---|
end_seconds | number | End in project seconds; default: the end of the track’s last item. |
peak_windows | integer | Number of windows in the peak overview (default 20). |
start_seconds | number | Start in project seconds; default: the project start. |
track (required) | integer |
apply_track_fx_template
Apply static FX state from a named source track in an exported .RTrackTemplate. mode defaults to replace (existing behavior); append adds source FX after the destination chain and preserves all existing FX automation. Both modes preserve destination media, routing, pan and fader. Source timeline automation is never copied. Target -1 is the master track.
| Argument | Type | Description |
|---|---|---|
mode | string | FX chain operation: replace (default) or append source FX after existing FX. |
source_track (required) | string | Exact source track name inside the template. |
target_track (required) | integer | Zero-based destination track index; -1 addresses the master track. |
template_path (required) | string | Path to an exported .RTrackTemplate file. |
audio_device
Read, close, or open REAPER’s audio and MIDI devices. Reports observed running state before and after the action; open/close do not imply the device successfully changed state.
| Argument | Type | Description |
|---|---|---|
action (required) | AudioDeviceAction | Read status or close/open REAPER’s audio and MIDI devices. |
batch
Run several tools in one call: calls is a list of {tool, args}. Stops at the first error unless continue_on_error is true. Each call has its own undo step.
| Argument | Type | Description |
|---|---|---|
calls (required) | array | |
continue_on_error | boolean | Keep going after a failed call (default false: stop at the first error). |
timeout_seconds | integer | Give up waiting after this many seconds (default 3600). |
close_project_tab
Close the project tab with the given index (see list_projects). The index is required; the previously active tab stays active. Refuses if that tab has unsaved changes or if it is the last tab.
| Argument | Type | Description |
|---|---|---|
index (required) | integer | Zero-based project tab index from list_projects. Required: only the tab you name is closed. |
close_reaper_fx_windows
Post WM_CLOSE only to visible, owned REAPER #32770 dialogs whose title starts exactly with title_prefix (for example ’VST3: MyPlugin (Vendor) - Track ’). Reports messages posted, not verified closure; never targets REAPER’s main window or other dialogs. Windows only.
| Argument | Type | Description |
|---|---|---|
title_prefix (required) | string | Exact start of the dialog title to close, for example “VST3: MyPlugin (Vendor) - Track “. Must not be empty. |
compare_audio
Frequency and level comparison of two WAV files, for example your render against a professional reference. File B is turned to the loudness of A, so the per-band differences (third-octave and coarse mixing bands) describe tone, not volume; positive means B has more energy there. Also loudness, crest, width and overload differences. Use a_start_seconds and b_start_seconds to line up files that start at different times.
| Argument | Type | Description |
|---|---|---|
a (required) | string | Reference file A (for example the professional mix or stem). |
a_start_seconds | number | Start time in A in seconds (default 0). Use it with b_start_seconds to line up the two files. |
b (required) | string | File B, compared against A (for example your render). |
b_start_seconds | number | Start time in B in seconds (default 0). |
duration_seconds | number | Length of the compared part in seconds (default: as much as both files have after their start). |
create_fx_container
Add an empty FX container (REAPER 7+) at the end of a track’s FX chain, or with container at the end of another container at any depth. Returns it with its address.
| Argument | Type | Description |
|---|---|---|
container | integer | Container to create it in (top-level index or address from list_fx_tree); default: the top level of the chain. |
name | string | Name shown for the container. |
track (required) | integer | Zero-based track index; -1 is the master track. |
create_hardware_output
Send a track straight to a hardware output (for a click track, a headphone mix or outboard gear). Returns the new hardware output.
| Argument | Type | Description |
|---|---|---|
mode | integer | 0 post-fader (default), 1 pre-FX, 3 post-FX. |
mono | boolean | Mix to mono on the output channel. |
mute | boolean | |
output_channel | integer | First output channel, starting at 1 (see list_outputs); default 1. |
pan | number | Pan from -1 to 1. |
source_channel | integer | First track channel to send, 0 = channels 1/2, 2 = 3/4 …; -1 sends no audio. |
track (required) | integer | Zero-based track index; -1 is the master track. |
volume_db | number | Level in dB (0 = unity). |
create_midi_item
Create an empty MIDI item on a track between two project times.
| Argument | Type | Description |
|---|---|---|
end_seconds (required) | number | |
start_seconds (required) | number | |
track (required) | integer |
create_multiout_tracks
Route a multi-out instrument (Kontakt with Krimh, ML Drums …) to separate tracks: gives the instrument track enough channels and creates one track per output pair right after it (optionally in a new folder), each receiving its pair through a send. Use probe_instrument_outputs first to see which pairs carry which drum.
| Argument | Type | Description |
|---|---|---|
folder | string | Put the new tracks into a new folder track with this name. |
instrument_to_parent | boolean | false turns off the instrument’s own send to its parent, so only the new tracks are heard. |
outputs (required) | array | One new track per output pair, created right after the instrument in this order. |
send_mode | integer | Send mode: 0 post-fader (default), 1 pre-FX, 3 post-FX before the fader. |
track (required) | integer | Track with the multi-out instrument (Kontakt, ML Drums …). |
create_send
Create a send between two tracks, optionally with level (dB) and pan.
| Argument | Type | Description |
|---|---|---|
dest_channel | integer | First destination channel of the pair (0 = channels 1/2). |
destination (required) | integer | Destination track index. |
mode | integer | Where the send taps the track: 0 = post-fader, 1 = pre-FX, 3 = post-FX before the fader. |
mono | boolean | |
pan | number | |
phase_inverted | boolean | |
source (required) | integer | Source track index. |
source_channel | integer | First source channel of the pair: 0 = channels 1/2, 2 = 3/4, 4 = 5/6 …; -1 = no audio. |
volume_db | number |
create_track
Create a named track at the end of the current REAPER project.
| Argument | Type | Description |
|---|---|---|
name (required) | string | Name to assign to the new track. |
delete_automation_item
Delete one automation item from an envelope. Returns the remaining automation items.
| Argument | Type | Description |
|---|---|---|
envelope (required) | ParamRef | Track envelope name (Volume, Pan …), or with fx the parameter name or index. |
fx | integer | FX index when the envelope belongs to an FX parameter. |
index (required) | integer | Automation item index from list_automation_items. |
track (required) | integer | Zero-based track index; -1 is the master track. |
delete_envelope
Delete a track envelope (Volume, Pan …) or an FX parameter envelope with all its points and automation items: the lane is removed from the track.
| Argument | Type | Description |
|---|---|---|
envelope (required) | ParamRef | Track envelope name (Volume, Pan …), or with fx the parameter name or index. |
fx | integer | FX index when the envelope belongs to an FX parameter. |
track (required) | integer | Zero-based track index; -1 is the master track. |
delete_ext_state
Delete an ExtState key, in the project (default) or global scope.
| Argument | Type | Description |
|---|---|---|
key (required) | string | |
scope | string | “project” (default) or “global”. |
section (required) | string |
delete_item
Delete one media item from a track (indexes from list_items).
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
track (required) | integer | Zero-based track index. |
delete_marker
Delete one marker or region by its number. Returns the remaining markers.
| Argument | Type | Description |
|---|---|---|
is_region | boolean | Pick the region (true) or the marker (false) when both have this number; default: the marker. |
number (required) | integer | The marker or region number REAPER shows (number in list_markers). |
delete_midi_events
Delete non-note MIDI events matching a kind, a CC controller and/or a time range, or all of them. Returns how many were deleted.
| Argument | Type | Description |
|---|---|---|
all | boolean | Delete every event that is not a note. |
controller | integer | Only CC events of this controller. |
end_seconds | number | Only events before this time. |
item (required) | integer | Zero-based index of the MIDI item on the track. |
kind | MidiEventKind | Only events of this kind. |
start_seconds | number | Only events at or after this time. |
track (required) | integer | Zero-based track index. |
delete_midi_notes
Delete MIDI notes by index, or every note matching a pitch and/or time range, or all notes. Returns how many were deleted.
| Argument | Type | Description |
|---|---|---|
all | boolean | Delete every note. |
end_seconds | number | Instead of indexes: delete notes starting before this time. |
indexes | array | Note indexes from list_midi_notes. |
item (required) | integer | Zero-based index of the MIDI item on the track. |
pitch | integer | Instead of indexes: delete the notes of this pitch. |
start_seconds | number | Instead of indexes: delete notes starting at or after this time. |
track (required) | integer | Zero-based track index. |
delete_track
Delete a track. With with_children also everything inside a folder track. The master track cannot be deleted.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks (the master track cannot be deleted). |
with_children | boolean | For a folder track: also delete everything inside it. Default false (the children stay). |
describe_track
Everything that sets the level and sound of one track: fader, pan, whole-chain FX enable state, FX chain with pin mappings, automation envelopes (volume, pan, mute, plugin parameters), sends, receives, parent. Notes call out what acts after the plugins, such as an active volume envelope that shifts a limiter’s ceiling.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
export_fx_chain
Write the FX of a track (all, or the ones named in fx) to an .RfxChain file with the plugin states inside: the way to keep a plugin sound (an amp setting, a vocal chain) as a file. REAPER has no function that writes plugin preset files.
| Argument | Type | Description |
|---|---|---|
fx | array | Only these plugins: FX indexes or parts of their names. Default: the whole chain. |
path (required) | string | Path of the .RfxChain file to write. |
track (required) | integer | Zero-based track index; -1 is the master track. |
export_mix_template
Export item-free REAPER track templates for named mix groups (default: DRUMS, BASS, GUITARS, VOCALS, MIX BUS, RETURNS). Preserves track FX, envelopes, folder descendants and internal receives; receives from tracks outside a group are omitted and reported. Also exports the master chain to master.RfxChain by default; set include_master_chain=false to skip it.
| Argument | Type | Description |
|---|---|---|
directory (required) | string | Destination directory for the .RTrackTemplate files. |
groups | array | Optional track groups. Defaults to DRUMS, BASS, GUITARS, VOCALS, MIX BUS, RETURNS. |
include_master_chain | boolean | Whether to also write the active project’s master FX chain to master.RfxChain (defaults to true). |
format_fx_param
Show the text a plugin displays for a normalized parameter value, without changing the parameter.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
param (required) | ParamRef | Parameter index or name. |
track (required) | integer | |
value (required) | number | Normalized value 0..1 to format. |
get_action_state
Read an action’s name and on/off state (on, off, or null for an action without one), by numeric ID or named command.
| Argument | Type | Description |
|---|---|---|
command_id (required) | ActionId | Numeric action ID or a named command such as _SWS_SAVEALLSELTRK. |
get_ext_state
Read ExtState: named values scripts keep by section and key. Scope project (default) is saved in the project file; without a key it lists every key of the section. REAPER keeps project keys in upper case and finds them in any case. Scope global is kept by REAPER for every project and needs a key. A missing key reads as value null.
| Argument | Type | Description |
|---|---|---|
key | string | Key to read; without it every key of the section (project scope only). |
scope | string | “project” (default): saved in the project file. “global”: saved in REAPER’s settings. |
section (required) | string |
get_fx_pins
Read an FX’s pin mappings: which track channels (bitmask) feed each input pin and receive each output pin.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | Zero-based FX index from list_fx. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
track (required) | integer | Zero-based track index; -1 is the master track. |
get_grid
Project tempo, time signature, grid size and the length of a bar in seconds: what one grid step or one bar means before moving anything. Give seconds or a bar to read the tempo and time signature in effect there.
| Argument | Type | Description |
|---|---|---|
bar | integer | Alternative to seconds: bar number, starting at 1. |
beat | number | Beat within the bar, starting at 1. Default 1. |
seconds | number | Report the tempo and time signature in effect at this time in seconds (default: the project start). |
get_markers_at
The last marker at or before a time and the region around it (null when there is none), at the edit cursor by default: where in the song a position is.
| Argument | Type | Description |
|---|---|---|
seconds | number | Project time in seconds; default: the edit cursor. |
get_param_modulation
Read the modulation of an FX parameter: on/off and baseline, the LFO (shape, speed, strength, phase, tempo sync), the audio control signal (attack, release, dB range, channel) and a parameter link.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | FX index, or an address inside a container from list_fx_tree. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
param (required) | ParamRef | Parameter index or name. |
track (required) | integer | Zero-based track index; -1 is the master track. |
get_project_info
Read the current REAPER project: name, path, tempo, time signature, length, play rate (a render lasts length / play rate), sample rate and track count.
No arguments.
get_project_notes
Read the project notes, title and author (Project Settings / Notes), and show_on_load: whether the saved project file opens the notes window on load, which blocks REAPER until it is closed (null for a project never saved). REAPER’s API cannot change show_on_load.
No arguments.
get_region_render_matrix
Read the region render matrix: every region (number, name, position, end) with the tracks it renders (-1 = master mix).
No arguments.
get_render_settings
Read the project’s current render settings (output folder, pattern, sample rate, bounds).
No arguments.
get_selection
Read the selected tracks and items (track indexes, and track and item index pairs).
No arguments.
get_tempo_map
List the tempo map: every tempo and time signature marker with its time (seconds and bar.beat), BPM and the time signature in effect there.
No arguments.
get_track
Read one track in detail: fader, pan, mute/solo, whole-chain FX enabled state, folder depth, parent, channels, FX/send/receive/item counts. Track -1 is master.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
get_track_groups
List the track groups a track belongs to, with the parameters it leads and follows in each.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
get_transport
Read the transport: state (stopped, playing, paused, recording), play position, edit cursor (seconds and bar.beat), time selection and loop range (null when empty) and whether repeat is on.
No arguments.
go_to_marker
Move the edit cursor (and the play position while playing) to a marker or region, given by number or name. Returns the cursor position and the marker.
| Argument | Type | Description |
|---|---|---|
is_region | boolean | true for a region, false for a marker; without it a marker is preferred. |
name | string | Marker or region name; with number, both must match. |
number | integer | Marker or region number, as REAPER shows it (list_markers). |
health
Check whether the REAPER Lua bridge is running.
No arguments.
humanize_midi
Humanize MIDI notes: move starts by up to timing_ms earlier or later, change lengths by up to length_percent and velocities by up to velocity, at random but seeded (the same seed on the same notes gives the same result; the seed is returned). Optionally only one pitch or notes starting in a time range. Notes never start before the item.
| Argument | Type | Description |
|---|---|---|
end_seconds | number | Only notes starting before this project time in seconds. |
item (required) | integer | Zero-based index of the MIDI item on the track. |
length_percent | number | Largest change of a note length, shorter or longer, in percent (0-99). |
pitch | integer | Only notes of this pitch. |
seed | integer | Seed of the random numbers: the same seed on the same notes gives the same result. Default: a new seed, returned in the result. |
start_seconds | number | Only notes starting at or after this project time in seconds. |
timing_ms | number | Largest shift of a note start, earlier or later, in milliseconds (0-1000). |
track (required) | integer | Zero-based track index. |
velocity | number | Largest change of a velocity, lower or higher (0-127); results stay within 1-127. |
import_fx_chain
Put the FX of an .RfxChain file on a track, after its existing FX (append) or instead of them (replace). Plugin states come with the file.
| Argument | Type | Description |
|---|---|---|
mode | string | append (default, after the FX the track has) or replace. |
path (required) | string | Path of an .RfxChain file. |
track (required) | integer | Zero-based track index; -1 is the master track. |
insert_automation_item
Insert an automation item on an existing track or FX parameter envelope: from the envelope points in its range, or as a new instance of a pool. Returns the automation items.
| Argument | Type | Description |
|---|---|---|
envelope (required) | ParamRef | Track envelope name (Volume, Pan …), or with fx the parameter name or index. |
fx | integer | FX index when the envelope belongs to an FX parameter. |
length (required) | number | Length in seconds. |
pool_id | integer | Pool to make a new instance of (shares its contents); default: a new item from the envelope points in its range. |
position (required) | number | Position in project seconds. |
track (required) | integer | Zero-based track index; -1 is the master track. |
insert_media
Put an audio file on a track as a new item at a position in seconds.
| Argument | Type | Description |
|---|---|---|
path (required) | string | Absolute path of the audio file. |
position | number | Item position in seconds (default 0). |
track (required) | integer | Zero-based track index; -1 is the master track. |
inspect_reaper_windows
Inspect REAPER process windows and visible owned dialogs without using the Lua bridge. Reports window titles, class names, static child text, and whether the main window responds.
No arguments.
list_automation_items
List the automation items on a track or FX parameter envelope: pool, position, length, start offset, rate, baseline, amplitude, loop.
| Argument | Type | Description |
|---|---|---|
envelope (required) | ParamRef | Track envelope name (Volume, Pan …), or with fx the parameter name or index. |
fx | integer | FX index when the envelope belongs to an FX parameter. |
track (required) | integer | Zero-based track index; -1 is the master track. |
list_fx
List the FX chain of a track, or with item of that item’s active take (take FX), with indexes, names, bypass state and parameter counts. The other FX tools take the same item argument.
| Argument | Type | Description |
|---|---|---|
item | integer | Item index on the track: list the FX of its active take instead of the track’s. |
track (required) | integer | Zero-based track index; -1 is the master track. |
list_fx_param_choices
List the distinct texts a choice parameter can show (shapes, modes, styles) with the normalized value for each.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
param (required) | ParamRef | Parameter index or name. |
steps | integer | Sampling resolution across 0..1 (default 400). |
track (required) | integer |
list_fx_params
List all parameters of an FX with names, normalized values and formatted values (real units).
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | Zero-based FX index from list_fx. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
track (required) | integer | Zero-based track index; -1 is the master track. |
list_fx_presets
List the presets of an FX by name, with the count and the current preset (empty when the parameters no longer match it). REAPER only names the current preset, so each one is selected in turn and the plugin is put back as it was.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | Zero-based FX index from list_fx. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
track (required) | integer | Zero-based track index; -1 is the master track. |
list_fx_tree
List a track’s FX as a tree: containers with the FX inside them, each with its address. An address inside a container works as fx in the other FX tools.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
list_hardware_outputs
List a track’s hardware outputs: output channel (1-based) and its name, mono, source channel, level, pan, mute, mode.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
list_inputs
List the audio inputs (1-based channel and name) and MIDI input devices (index and name) REAPER can record from, for set_track record_input.
No arguments.
list_items
List media items on a track with position, length, gain, mute, take pan, take channel mode, source channel count and source file. Take pan acts before the track FX.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
list_markers
List project markers and regions with list index, marker number, name, position and region end (seconds) and color.
No arguments.
list_midi_events
List the non-note MIDI events of an item in time order: CC (with shape), pitch bend (-8192..8191), program change, channel pressure, poly aftertouch, text, lyric, marker, cue and sysex (hex).
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based index of the MIDI item on the track. |
kinds | array | Only these kinds (default: all events except notes). |
track (required) | integer | Zero-based track index. |
list_midi_notes
List the notes of a MIDI item: start/end in project seconds, pitch, velocity, channel, plus the note count per pitch.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based index of the MIDI item on the track (list_items). |
limit | integer | Return at most this many notes (default 5000). |
offset | integer | Skip this many notes first. |
pitch | integer | Only notes of this MIDI pitch (the per-pitch counts always cover all notes). |
track (required) | integer | Zero-based track index. |
list_outputs
List the audio outputs of the machine (1-based channel and name), for hardware outputs.
No arguments.
list_plugins
Plugins used in the project (instances, first tracks) with the VST3 version found on disk. REAPER keeps old DLLs loaded after an update, so restart it when the version on disk is newer than expected.
| Argument | Type | Description |
|---|---|---|
filter | string | Only plugins whose name contains this text. |
list_projects
List open project tabs with path, dirty state and track count. All other tools act on the active tab.
No arguments.
list_sends
List sends and receives of a track.
| Argument | Type | Description |
|---|---|---|
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
list_stretch_markers
List the stretch markers of an item’s active take: position on the item and the source position that plays there.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
track (required) | integer | Zero-based track index. |
list_take_envelopes
List the envelopes of an item’s active take (Volume, Pan, Mute, Pitch, take FX parameters) with their state, point count and value range.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
track (required) | integer | Zero-based track index. |
list_take_markers
List the take markers of an item’s active take: source position, name and color.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
track (required) | integer | Zero-based track index. |
list_takes
List the takes of an item: name, source file and which one is active.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
track (required) | integer | Zero-based track index. |
list_track_envelopes
List automation envelopes of a track: volume, trim, pan, width and mute envelopes and plugin parameter envelopes, with active state, point count and value range (dB for volume).
| Argument | Type | Description |
|---|---|---|
include_all_parameters | boolean | Also scan every plugin parameter for automation (slow on plugins with thousands of MIDI parameters). |
track (required) | integer | Zero-based track index; -1 is the master track. |
list_tracks
List current REAPER tracks with zero-based indexes, names, GUIDs, and volume.
No arguments.
move_fx
Move an FX to another position in the same chain; to_index is its final index.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | Current zero-based FX index. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
to_index (required) | integer | Final zero-based FX index in the chain. |
track (required) | integer |
move_fx_out_of_container
Move an FX from inside a container (its address from list_fx_tree) to the top level of the track’s chain, at a position (default: the end). Returns the FX tree.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | Address of the FX inside a container, from list_fx_tree. |
position | integer | Top-level position to put it at, from 0 (default: the end of the chain). |
track (required) | integer | Zero-based track index; -1 is the master track. |
move_fx_to_container
Move an FX (top-level index or address from list_fx_tree) into a container at any depth, at a position inside it (default: the end). Moving a container into itself or into a container inside it is refused. Addresses inside containers change after a move: use the returned FX tree.
| Argument | Type | Description |
|---|---|---|
container (required) | integer | Container: top-level index or address from list_fx_tree, at any depth. |
fx (required) | integer | FX to move: top-level index or address from list_fx_tree. |
position | integer | Position inside the container, from 0 (default: the end). |
track (required) | integer | Zero-based track index; -1 is the master track. |
move_items
Move the items of tracks (or one item) in musical time: by bars, beats, the project grid or note values, optionally snapped to a grid, with the automation points. Negative values move earlier. dry_run only reports the from/to positions as seconds and bar.beat. Prefer this to moving by seconds: it stays on the grid.
| Argument | Type | Description |
|---|---|---|
dry_run | boolean | Only report what would move. |
include_envelopes | boolean | Move the automation points of the tracks by the same musical distance (default true). |
item | integer | Move only this item (index from list_items); needs exactly one track. |
snap_to | string | Round every new position to this grid (same units as unit). |
tracks (required) | array | Zero-based indexes of the tracks whose items move. |
unit | string | bar, beat, grid (the project grid), 1/1, 1/2, 1/4, 1/8, 1/16, 1/32 or 1/64. Default bar. |
value (required) | number | How many units to move: positive later, negative earlier, fractions allowed (0.5 bar). |
with_children | boolean | Also move everything inside the folder tracks listed. |
move_track
Move one track before another position (0-based before_index; the track count moves it to the end). Folder state is left alone: reorder first, then call set_track_folder_depth.
| Argument | Type | Description |
|---|---|---|
before_index (required) | integer | Zero-based index the track should end up before; the track count moves it to the end. |
index (required) | integer | Zero-based index of the track to move (from list_tracks). |
new_project_tab
Open a new empty project tab and make it active (the other tabs stay open).
No arguments.
normalize_items
Normalize the audio items of the chosen tracks with REAPER’s own normalization (the one behind Item processing > Normalize): the item gain is set so that the part of the source the item plays reaches target_db in peak, true_peak, lufs_i, lufs_m, lufs_s or rms. Replaces the existing item gain; take volume is kept. Use dry_run to see the gains first, exclude_tracks to skip drums or a reference.
| Argument | Type | Description |
|---|---|---|
dry_run | boolean | Only report what would change. |
exclude_tracks | array | Zero-based track indexes to leave alone. |
mode | string | peak (default), true_peak, lufs_i, lufs_m, lufs_s or rms. |
target_db (required) | number | Normalization target in dB (0 or lower): dBFS for peak and true_peak, LUFS for the lufs modes, dB for rms. |
tracks | array | Zero-based track indexes to normalize (default: every track). |
open_project
Open an .rpp project in REAPER. Refuses when the current project has unsaved changes unless discard_unsaved is true. Loading can take minutes for heavy projects.
| Argument | Type | Description |
|---|---|---|
discard_unsaved | boolean | Open even if the current project has unsaved changes (they are lost). |
path (required) | string | Absolute path of the .rpp file to open. |
probe_instrument_outputs
Find out what a multi-out instrument plays on each output pair: renders every pair (outputs 1/2, 3/4 …) of the track to its own file through temporary tracks, measures them and reports loudness, peak and the loudest frequency band per pair (silent pairs are marked). Temporary tracks are removed and the track’s channels and mute are restored. Render a short busy range (start_seconds/end_seconds).
| Argument | Type | Description |
|---|---|---|
channels | integer | How many instrument channels to probe; default: the largest output count of the track’s FX. |
directory (required) | string | Folder for the probe files (one WAV per output pair). |
end_seconds | number | |
start_seconds | number | |
track (required) | integer | Track with the multi-out instrument; it must have MIDI to play in the range. |
project_snapshot
The whole project in one call: tracks with folder structure, fader, pan, mute, FX, sends and item counts, plus the master FX. Compare two snapshots to see what changed.
No arguments.
quantize_midi
Quantize MIDI note starts to the project grid or a note value (1/1 to 1/64, triplets) with a strength in percent; lengths are kept unless ends is true.
| Argument | Type | Description |
|---|---|---|
ends | boolean | Quantize note ends too (default false: the length is kept). |
grid | string | grid (the project grid, default), 1/1 … 1/64, or triplets 1/4T, 1/8T, 1/16T. |
item (required) | integer | Zero-based index of the MIDI item on the track. |
pitch | integer | Only notes of this pitch. |
strength | number | How far to move toward the grid, 0-100 percent (default 100). |
track (required) | integer | Zero-based track index. |
redo
Redo steps undone before (default one). Returns the names of the redone steps and the next undo and redo.
| Argument | Type | Description |
|---|---|---|
steps | integer | How many steps to undo or redo (default 1). Stops early when the history ends. |
reload_bridge
Re-read the bridge’s Lua handlers inside REAPER after the bridge files were updated, without restarting REAPER.
No arguments.
remove_fx
Delete an FX from a track by index.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | Zero-based FX index from list_fx. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
track (required) | integer | Zero-based track index; -1 is the master track. |
remove_hardware_output
Remove a hardware output from a track. Returns the remaining hardware outputs.
| Argument | Type | Description |
|---|---|---|
index (required) | integer | Hardware output index from list_hardware_outputs. |
track (required) | integer | Zero-based track index; -1 is the master track. |
remove_send
Remove one send from a track. The later sends of that track move down by one index; the result lists the sends that remain.
| Argument | Type | Description |
|---|---|---|
send_index (required) | integer | Send index from list_sends. |
source (required) | integer | Source track index. |
rename_track
Rename a REAPER track by its zero-based index from list_tracks.
| Argument | Type | Description |
|---|---|---|
index (required) | integer | Zero-based track index from list_tracks. |
name (required) | string | New track name. |
render_project
Render the whole project master mix to directory/name.<ext> using the project’s saved render format. Deletes an old file with that name first (overwrite=false keeps it), lists the written files and warns when one is missing. Blocks until the render finishes.
| Argument | Type | Description |
|---|---|---|
directory (required) | string | Output directory. |
end_seconds | number | Render only up to this time (seconds). |
format | string | Output format: pcm16, pcm24, float32 (keeps levels above 0 dBFS) or a raw base64 render config. Default: the project’s saved format. |
fresh | boolean | Save the project and open it again before rendering, so the render sees the saved state (default false). |
name (required) | string | File name without extension; the extension comes from the project’s render format. |
overwrite | boolean | Delete the files this render is about to write (default true). REAPER itself never overwrites: it writes NAME-001.wav and leaves the old file, which a caller would then read by mistake. |
sample_rate | integer | |
start_seconds | number | Render only from this time (seconds); give together with end_seconds. Default: the whole project. |
timeout_seconds | integer | Give up waiting after this many seconds (default 1800). |
render_regions
Render every region to its own file, through the master mix or the region render matrix. Deletes the files about to be written first (overwrite=false keeps them), lists the written files and warns when one is missing. Blocks until done.
| Argument | Type | Description |
|---|---|---|
directory (required) | string | Output directory. |
format | string | Output format: pcm16, pcm24, float32 or a raw base64 render config. Default: the project’s. |
overwrite | boolean | Delete the files this render is about to write (default true). |
pattern | string | File name pattern with REAPER wildcards; default $region (with the matrix $region-$track). |
timeout_seconds | integer | Give up waiting after this many seconds (default 1800). |
use_matrix | boolean | Render the tracks the region render matrix assigns to each region instead of the master mix. |
render_stems
Render the given tracks as separate stem files (each track’s own output including its children), using the project’s saved render format. Deletes old stems with the same names first (overwrite=false keeps them), lists the written files, warns when one is missing and restores render settings and track selection afterwards. Blocks until done.
| Argument | Type | Description |
|---|---|---|
directory (required) | string | Output directory. |
end_seconds | number | Render only up to this time (seconds). |
format | string | Output format: pcm16, pcm24, float32 (keeps levels above 0 dBFS) or a raw base64 render config. Default: the project’s saved format. |
fresh | boolean | Save the project and open it again before rendering, so the render sees the saved state (default false). |
overwrite | boolean | Delete the files this render is about to write (default true). REAPER itself never overwrites: it writes NAME-001.wav and leaves the old file, which a caller would then read by mistake. |
pattern | string | File name pattern; defaults to $track. |
start_seconds | number | Render only from this time (seconds); give together with end_seconds. Default: the whole project. |
timeout_seconds | integer | Give up waiting after this many seconds (default 3600). |
tracks (required) | array | Zero-based indexes of the tracks to render, each as its own file named after the track. |
render_variants
Render the same tracks as stems several times with different tracks muted or unmuted per variant (for example live only, trigger only, both). Saves and reopens the project before each render and restores the original mutes at the end.
| Argument | Type | Description |
|---|---|---|
directory (required) | string | Output directory. |
end_seconds | number | |
format | string | |
fresh | boolean | Save and reopen the project before each render (default true). |
overwrite | boolean | Delete the files a render is about to write (default true). |
pattern | string | File name pattern, default $track-{variant}. |
start_seconds | number | |
timeout_seconds | integer | Give up waiting after this many seconds (default 3600). |
tracks (required) | array | Zero-based indexes of the tracks to render as stems in every variant. |
variants (required) | array |
restart_bridge
Launch a fresh REAPER bridge instance using the installed fixed bridge loader. This only reports that launch was requested; it does not verify bridge recovery or terminate any process.
No arguments.
run_action
Run a REAPER action by numeric ID or named command. Escape hatch for features without a dedicated tool; prefer adding a real tool.
| Argument | Type | Description |
|---|---|---|
command_id (required) | ActionId | Numeric action ID or a named command such as _SWS_SAVEALLSELTRK. |
save_project
Save the current project in place, or save a copy to path (the project keeps its own path). Returns path (the file written) and project_path; fails when the copy was not written.
| Argument | Type | Description |
|---|---|---|
path | string | Save a copy to this path instead of saving in place. |
search_actions
Search REAPER’s action list (main section) for actions whose name holds every word of the query, in any order and case. Returns command_id, name, named_command for scripts and extensions, and state (on, off, or null for an action without an on/off state). truncated is true when more actions matched than the limit.
| Argument | Type | Description |
|---|---|---|
limit | integer | Most actions to return (default 50). |
query (required) | string | Words that must all be in the action’s name, in any order and case. |
select_items
Select items by track and item index (replacing the selection, or adding with add=true); an empty list clears it. Returns the selection.
| Argument | Type | Description |
|---|---|---|
add | boolean | Add to the current selection instead of replacing it. |
items (required) | array | Items to select by track and item index; an empty list clears the selection. |
select_tracks
Select tracks (replacing the selection, or adding with add=true); an empty list clears it. Some REAPER actions work on the selected tracks. Returns the selection.
| Argument | Type | Description |
|---|---|---|
add | boolean | Add to the current selection instead of replacing it. |
tracks (required) | array | Zero-based track indexes to select; an empty list clears the selection. |
set_action_state
Switch a toggle action on or off: it runs only when its state differs from the one asked for, so calling twice is safe. Refuses an action without an on/off state (use run_action). Returns the state and whether it changed.
| Argument | Type | Description |
|---|---|---|
command_id (required) | ActionId | Numeric action ID or a named command such as _SWS_SAVEALLSELTRK. |
on (required) | boolean | The state wanted: the action runs only when its state differs. |
set_active_take
Choose the active take of an item by its index from list_takes. Returns the takes.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
take (required) | integer | Zero-based take index from list_takes. |
track (required) | integer | Zero-based track index. |
set_automation_item
Change an automation item: position, length, start offset, rate, baseline, amplitude or loop. Returns the automation items.
| Argument | Type | Description |
|---|---|---|
amplitude | number | Amplitude, -1 to 1. |
baseline | number | Baseline, 0 to 1. |
envelope (required) | ParamRef | Track envelope name (Volume, Pan …), or with fx the parameter name or index. |
fx | integer | FX index when the envelope belongs to an FX parameter. |
index (required) | integer | Automation item index from list_automation_items. |
length | number | Length in seconds. |
loop | boolean | Loop the contents over the item length. |
play_rate | number | Playback rate of the contents. |
position | number | Position in project seconds. |
start_offset | number | Start offset into the contents in seconds. |
track (required) | integer | Zero-based track index; -1 is the master track. |
set_edit_cursor
Move the edit cursor to a time in seconds or to a bar and beat. Returns the transport state.
| Argument | Type | Description |
|---|---|---|
bar | integer | Alternative to seconds: bar number, starting at 1. |
beat | number | Beat within the bar, starting at 1 (fractions allowed). Default 1. |
move_view | boolean | Scroll the arrange view to the cursor (default false). |
seconds | number | Position in seconds. |
seek_play | boolean | While playing, jump playback to the cursor (default false). |
set_envelope_active
Switch an automation envelope on or off without deleting its points, to check what it does to the level.
| Argument | Type | Description |
|---|---|---|
active (required) | boolean | true switches the envelope on, false off (the points are kept). |
envelope (required) | string | Track envelope name (Volume, Pan, Mute, Trim Volume, Volume (Pre-FX) …), or the parameter name when fx is given. |
fx | integer | Plugin index when the envelope belongs to a plugin parameter. |
track (required) | integer | Zero-based track index; -1 is the master track. |
set_envelope_points
Write automation points to a track envelope (Volume with value_db, Pan, or an FX parameter with fx). Replaces the existing points unless clear is false. Use set_envelope_active to switch the envelope on or off.
| Argument | Type | Description |
|---|---|---|
clear | boolean | Delete the existing points first (default true). |
envelope (required) | value | Volume or Pan (created and shown if it does not exist), or, with fx, the parameter name or index. |
fx | integer | FX index when the envelope belongs to an FX parameter. |
points (required) | array | |
track (required) | integer |
set_ext_state
Set an ExtState value, for state an agent keeps for the next session: scope project (default) is saved with the project, scope global is kept by REAPER for every project (until REAPER quits, or for good with persist).
| Argument | Type | Description |
|---|---|---|
key (required) | string | |
persist | boolean | Global scope: true keeps the value after REAPER restarts (default false). |
scope | string | “project” (default): saved in the project file. “global”: saved in REAPER’s settings. |
section (required) | string | |
value (required) | string |
set_fx_enabled
Enable or bypass an FX.
| Argument | Type | Description |
|---|---|---|
enabled (required) | boolean | |
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
track (required) | integer |
set_fx_envelope
Replace the automation envelope of an FX parameter with the given points (normalized values).
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
param (required) | ParamRef | Parameter index or name. |
points (required) | array | Replaces all existing points of the parameter’s automation envelope. |
track (required) | integer |
set_fx_param
Set one FX parameter by index or name, with value (0..1), display_value (plugin units, e.g. -18 for -18 dB) or display_text (e.g. Clean). The result shows the formatted value.
| Argument | Type | Description |
|---|---|---|
display_text | string | Text the plugin shows, for choice and switch parameters (for example “Clean” or “On”). |
display_value | number | Number as the plugin shows it, in the plugin’s own unit (for example -18 for “-18.0 dB”, 1200 for “1.2 kHz”). Solved by bisection; the result shows the achieved formatted value. |
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
param (required) | ParamRef | Parameter index or name. |
track (required) | integer | |
value | number | Normalized value from 0 to 1. |
set_fx_params
Set many parameters of one FX at once. Each entry uses value (0..1), display_value (plugin units) or display_text. Per-entry failures are reported.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
params (required) | array | Parameters to set; a failed entry is reported and the rest still apply. |
track (required) | integer |
set_fx_pins
Set FX pin mappings (track-channel bitmask per input or output pin), for example to run a mono plugin on one channel of a stereo track.
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
pins (required) | array | |
track (required) | integer |
set_fx_preset
Load a named FX preset (as REAPER lists it for the plugin).
| Argument | Type | Description |
|---|---|---|
fx (required) | integer | |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
preset (required) | string | Preset name as REAPER lists it for the plugin. |
track (required) | integer |
set_global_automation_override
Set the global automation override for all tracks (none, trim_read, read, touch, write, latch, bypass). Track modes are set with set_track automation_mode.
| Argument | Type | Description |
|---|---|---|
mode (required) | AutomationOverride | none lets each track use its own mode; bypass turns all automation off. |
set_hardware_output
Change a hardware output of a track: output channel, mono, source channel, level, pan, mute, mode.
| Argument | Type | Description |
|---|---|---|
index (required) | integer | Hardware output index from list_hardware_outputs. |
mode | integer | 0 post-fader, 1 pre-FX, 3 post-FX. |
mono | boolean | Mix to mono on the output channel. |
mute | boolean | |
output_channel | integer | First output channel, starting at 1. |
pan | number | Pan from -1 to 1. |
source_channel | integer | First track channel to send, 0 = channels 1/2, 2 = 3/4 …; -1 sends no audio. |
track (required) | integer | Zero-based track index; -1 is the master track. |
volume_db | number | Level in dB (0 = unity). |
set_item
Change one media item: gain (dB), mute, position, length, fades (length and shape), active take pan, channel mode, start offset, play rate, preserve pitch, pitch or source file. Only the given fields change.
| Argument | Type | Description |
|---|---|---|
channel_mode | string | Active take channel mode: normal, reverse_stereo, mono_mix, left or right. |
fade_in | number | Fade-in length in seconds (0 removes the fade). |
fade_in_shape | FadeShape | Fade-in curve. |
fade_out | number | Fade-out length in seconds (0 removes the fade). |
fade_out_shape | FadeShape | Fade-out curve. |
item (required) | integer | Zero-based item index on the track, from list_items. |
length | number | Item length in seconds. |
mute | boolean | |
pitch | number | Active take pitch in semitones (-12 one octave down, 12 one octave up; fractions allowed). |
play_rate | number | Active take playback rate: 0.5 half speed, 1 normal, 2 double speed. |
position | number | Item position on the timeline in seconds (use move_items or set_item_position for bars and beats). |
preserve_pitch | boolean | Keep the pitch when the play rate changes. |
set_length | boolean | With source: set the item length to the new file’s length (default true). |
source | string | Path of an audio file to play instead of the current source. |
start_offset | number | Start offset of the take in its file (a slip edit), seconds. The audio appears on the timeline at position - start_offset; 0 plays the file from its start at the item position. |
take_pan | number | Active take pan from -1 (left) to 1 (right); acts before the track FX. |
track (required) | integer | Zero-based track index from list_tracks. |
volume_db | number | Item gain in dB (0 = unity). |
set_item_position
Put one item at an absolute position given as bar and beat (or seconds), optionally snapped to a grid.
| Argument | Type | Description |
|---|---|---|
bar | integer | Bar number, starting at 1. |
beat | number | Beat within the bar, starting at 1 (fractions allowed). Default 1. |
item (required) | integer | Zero-based item index from list_items. |
seconds | number | Alternative to bar: a position in seconds. |
snap_to | string | Round the position to this grid (bar, beat, 1/16 …). |
track (required) | integer |
set_items_time_base
Set the time base of the items of the chosen tracks: time (stay at their seconds when the tempo map changes, the safe setting for recorded audio), beats, beats_position or default. Use before set_tempo_map on a project whose items must not move.
| Argument | Type | Description |
|---|---|---|
time_base | string | time (default: items stay at their position in seconds when the tempo map changes), beats, beats_position (only the position follows the beats) or default (the project’s setting). |
tracks | array | Zero-based track indexes (default: every track). |
set_marker
Change one marker or region by its number: name, position, end (regions) or color. Fields that are not given keep their value. Returns all markers.
| Argument | Type | Description |
|---|---|---|
color | string | New color as #rrggbb. |
end_seconds | number | New end in project seconds (regions only). |
is_region | boolean | Pick the region (true) or the marker (false) when both have this number; default: the marker. |
name | string | New name (an empty string clears it). |
number (required) | integer | The marker or region number REAPER shows (number in list_markers). |
position_seconds | number | New position in project seconds. |
set_media_offline
Set every item that plays a media file offline (REAPER closes the file, so it can be overwritten) or online again. Use before rewriting a WAV the project plays.
| Argument | Type | Description |
|---|---|---|
offline (required) | boolean | true closes the file (so it can be overwritten), false opens it again. |
path (required) | string | Path of the media file the items play. |
set_midi_notes
Change MIDI notes by index (from list_midi_notes): pitch, velocity, channel, start, end, mute. Fields that are not given keep their value.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based index of the MIDI item on the track. |
notes (required) | array | The notes to change, by index; fields that are not given keep their value. |
track (required) | integer | Zero-based track index. |
set_param_link
Link an FX parameter to another FX parameter on the same track (it follows with a scale and offset), or remove the link with active=false.
| Argument | Type | Description |
|---|---|---|
active | boolean | false removes the link. |
fx (required) | integer | FX whose parameter follows. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
offset | number | Offset added to the follower, -1 to 1. |
param (required) | ParamRef | Parameter that follows, index or name. |
scale | number | How far the follower moves per unit of the leader (negative inverts). |
source_fx | integer | FX that leads (required unless active is false). |
source_param | ParamRef | Parameter that leads, index or name. |
track (required) | integer | Zero-based track index; -1 is the master track. |
set_param_modulation
Modulate an FX parameter with an LFO and/or an audio control signal (an envelope follower, for example from a sidechain), or turn modulation off. Fields that are not given keep their value.
| Argument | Type | Description |
|---|---|---|
acs | AcsSettings | Audio control signal (envelope follower) settings; fields that are not given keep their value. |
active | boolean | Turn the parameter’s modulation on or off (turning on an LFO or ACS turns it on). |
baseline | number | Base value the modulation moves around, 0 to 1. |
fx (required) | integer | FX index, or an address inside a container from list_fx_tree. |
item | integer | Item index on the track: work on the FX of its active take instead of the track’s. |
lfo | LfoSettings | LFO settings; fields that are not given keep their value. |
param (required) | ParamRef | Parameter index or name. |
track (required) | integer | Zero-based track index; -1 is the master track. |
set_project_notes
Set the project notes, title or author; only the given fields change. The notes are saved with the project, a place to leave notes for the next session. Returns them.
| Argument | Type | Description |
|---|---|---|
author | string | |
notes | string | The project notes (Project Settings / Notes); replaces them. |
title | string |
set_project_sample_rate
Set the project sample rate in Hz (Project Settings, ‘Project sample rate’), for example 48000 or 96000. Marks the project as using its own rate.
| Argument | Type | Description |
|---|---|---|
sample_rate (required) | integer | Project sample rate in Hz, a whole number such as 44100, 48000 or 96000. |
set_region_render_matrix
Add tracks to (or remove them from) a region in the region render matrix; clear empties the region first. Returns the matrix.
| Argument | Type | Description |
|---|---|---|
clear | boolean | Remove every track from the region first. |
region (required) | integer | Region number as REAPER shows it (number in list_markers). |
remove | boolean | Remove these tracks from the region instead of adding them. |
tracks (required) | array | Track indexes to add (or remove); -1 is the master mix. |
set_send
Change level, pan, mute, source/destination channel pair, mono or phase of an existing send. Channel pairs are given by their first channel: 0 = 1/2, 2 = 3/4, 4 = 5/6 … (a multi-out plugin such as Kontakt sends its outputs on channel pairs).
| Argument | Type | Description |
|---|---|---|
dest_channel | integer | First destination channel of the pair (0 = channels 1/2). |
mode | integer | Where the send taps the track: 0 = post-fader, 1 = pre-FX, 3 = post-FX before the fader. |
mono | boolean | |
mute | boolean | |
pan | number | |
phase_inverted | boolean | |
send_index (required) | integer | Send index from list_sends. |
source (required) | integer | Source track index. |
source_channel | integer | First source channel of the pair: 0 = channels 1/2, 2 = 3/4, 4 = 5/6 …; -1 = no audio. |
volume_db | number |
set_stretch_markers
Replace the stretch markers of an item’s active take (an empty list removes them). Moving a marker’s source_position away from its position stretches the audio between markers. Returns the markers.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
markers (required) | array | The stretch markers of the active take; replaces the existing ones, an empty list removes them. |
track (required) | integer | Zero-based track index. |
set_take_envelope_points
Write the points of a take envelope of an item’s active take (Volume with value_db, Pan, Mute, Pitch in semitones), creating it if missing. Times are seconds from the item start.
| Argument | Type | Description |
|---|---|---|
clear | boolean | Delete the existing points first (default true); an empty list then clears the envelope. |
envelope (required) | TakeEnvelopeName | Take envelope of the active take: Volume, Pan, Mute or Pitch (created if missing). |
item (required) | integer | Zero-based item index from list_items. |
points (required) | array | Points with times in seconds from the item start; Volume takes value_db, Pitch semitones as value. |
track (required) | integer | Zero-based track index. |
set_take_markers
Replace the take markers of an item’s active take (named points in its source, an empty list removes them). Returns the markers.
| Argument | Type | Description |
|---|---|---|
item (required) | integer | Zero-based item index from list_items. |
markers (required) | array | The take markers of the active take; replaces the existing ones, an empty list removes them. |
track (required) | integer | Zero-based track index. |
set_tempo_map
Write the project tempo map from markers given in quarter notes (the unit of a MIDI file or a Cubase tempo track): the first marker at 0, each marker’s time follows from the tempi before it. Replaces the existing tempo markers unless clear is false. Use it before importing MIDI so notes land on the same bars as the audio.
| Argument | Type | Description |
|---|---|---|
clear | boolean | Remove the existing tempo markers first (default true). |
markers (required) | array | Tempo markers in increasing quarter-note order, the first at 0. |
set_time_selection
Set or clear the time selection, or with loop=true the loop range, by seconds or by bars and beats. With REAPER’s default setting (loop points linked to time selection) the other range follows. Returns the transport state with both ranges.
| Argument | Type | Description |
|---|---|---|
clear | boolean | Remove the time selection (or, with loop, the loop range). |
end_bar | integer | Alternative to end_seconds: bar number, starting at 1 (bar 5 ends the range at the start of bar 5). |
end_beat | number | Beat within end_bar, starting at 1. Default 1. |
end_seconds | number | End in seconds. |
loop | boolean | Set the loop range instead of the time selection (default false). |
start_bar | integer | Alternative to start_seconds: bar number, starting at 1. |
start_beat | number | Beat within start_bar, starting at 1. Default 1. |
start_seconds | number | Start in seconds. |
set_track
Change track name, fader (dB), pan, mute, solo, phase, master send, channel count, the whole FX-chain enabled state, color, record arm, record input, monitoring or record mode. Only the given fields change. Track -1 is master.
| Argument | Type | Description |
|---|---|---|
automation_mode | AutomationMode | Track automation mode. |
channels | integer | Number of track channels (even, 2-128), for example 34 so a multi-out instrument such as Kontakt can feed separate kit tracks through sends from channel pairs. |
color | string | Track color as #rrggbb, or none to remove the custom color. |
fx_enabled | boolean | Whether the track’s entire FX chain is enabled. |
master_send | boolean | Whether the track feeds its parent / master. |
monitor | Monitor | Input monitoring: off, on, or tape (not while playing). |
mute | boolean | |
name | string | |
pan | number | Pan from -1 (left) to 1 (right). |
phase_inverted | boolean | |
record_arm | boolean | Arm the track for recording. |
record_input | RecordInput | What the track records from; see list_inputs for the inputs of this machine. |
record_mode | RecordMode | What recording captures: the input, the track output, or MIDI overdub / replace. |
solo | boolean | |
track (required) | integer | Zero-based track index from list_tracks; -1 is the master track. |
volume_db | number | Track fader in dB (0 = unity). |
set_track_folder_depth
Set a track’s folder depth: 1 starts a folder (the following tracks are its children), 0 is a normal track, -1 or lower closes that many folder levels after this track. Routing is not changed: a child with its parent send on feeds the folder track.
| Argument | Type | Description |
|---|---|---|
depth (required) | integer | 1 starts a folder, 0 is a normal track, -1 (or lower, down to -16) closes that many folder levels. |
index (required) | integer | Zero-based track index. |
set_track_group
Add a track to a track group (1-64) for some parameters (volume, pan, mute, solo, record_arm …) as lead, follower or both, or remove it with member=false. Returns the track’s groups.
| Argument | Type | Description |
|---|---|---|
group (required) | integer | Group number, 1-64. |
member | boolean | false removes the track from the group for these parameters (default true). |
params (required) | array | Which parameters the group links. |
role | GroupRole | lead (changes on this track move the group), follow, or both (default). |
track (required) | integer | Zero-based track index. |
split_items
Split every item of the given tracks that crosses a position (seconds, or bar and beat). The right part plays on from where the left part stops. Returns how many items were split.
| Argument | Type | Description |
|---|---|---|
bar | integer | Alternative to seconds: bar number, starting at 1. |
beat | number | Beat within the bar, starting at 1 (fractions allowed). Default 1. |
seconds | number | Split position in seconds. |
tracks (required) | array | Zero-based indexes of the tracks whose items are split. |
switch_project
Make another open project tab the active one.
| Argument | Type | Description |
|---|---|---|
index (required) | integer | Zero-based project tab index from list_projects. |
transport
Play, stop, pause or record, and/or turn repeat on or off. Record starts recording on the armed tracks. Returns the transport state afterwards.
| Argument | Type | Description |
|---|---|---|
action | TransportAction | play, stop, pause (toggles pause) or record (starts recording on armed tracks). |
repeat | boolean | Turn repeat (loop playback) on or off. |
undo
Undo the last steps in REAPER’s undo history (default one). Returns the names of the undone steps and the next undo and redo.
| Argument | Type | Description |
|---|---|---|
steps | integer | How many steps to undo or redo (default 1). Stops early when the history ends. |