Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

ArgumentTypeDescription
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
name (required)stringFX name as REAPER shows it, for example VST: ReaEQ (Cockos) or just ReaEQ.
track (required)integerZero-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.

ArgumentTypeDescription
clearbooleanDelete all existing markers and regions first (default false).
markers (required)arrayMarkers 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.

ArgumentTypeDescription
events (required)arrayThe events to add.
item (required)integerZero-based index of the MIDI item on the track.
track (required)integerZero-based track index.

add_midi_notes

Add notes to an existing MIDI item (times in project seconds).

ArgumentTypeDescription
item (required)integerZero-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.

ArgumentTypeDescription
activatebooleanMake the new take the active one (default false: the current take stays active).
item (required)integerZero-based item index from list_items.
path (required)stringAbsolute path of the audio file the new take plays.
track (required)integerZero-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.

ArgumentTypeDescription
end_secondsnumberAnalyse only up to this time in seconds (default: end of the file).
path (required)stringAbsolute path of a WAV file (16, 24 or 32-bit integer, or 32-bit float).
start_secondsnumberAnalyse 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.

ArgumentTypeDescription
end_secondsnumberEnd in seconds from the item start; default: the item end.
item (required)integerItem index on the track; its active take is read, with take FX, volume and pitch.
peak_windowsintegerNumber of windows in the peak overview (default 20).
start_secondsnumberStart 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.

ArgumentTypeDescription
end_secondsnumberEnd in project seconds; default: the end of the track’s last item.
peak_windowsintegerNumber of windows in the peak overview (default 20).
start_secondsnumberStart 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.

ArgumentTypeDescription
modestringFX chain operation: replace (default) or append source FX after existing FX.
source_track (required)stringExact source track name inside the template.
target_track (required)integerZero-based destination track index; -1 addresses the master track.
template_path (required)stringPath 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.

ArgumentTypeDescription
action (required)AudioDeviceActionRead 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.

ArgumentTypeDescription
calls (required)array
continue_on_errorbooleanKeep going after a failed call (default false: stop at the first error).
timeout_secondsintegerGive 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.

ArgumentTypeDescription
index (required)integerZero-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.

ArgumentTypeDescription
title_prefix (required)stringExact 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.

ArgumentTypeDescription
a (required)stringReference file A (for example the professional mix or stem).
a_start_secondsnumberStart time in A in seconds (default 0). Use it with b_start_seconds to line up the two files.
b (required)stringFile B, compared against A (for example your render).
b_start_secondsnumberStart time in B in seconds (default 0).
duration_secondsnumberLength 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.

ArgumentTypeDescription
containerintegerContainer to create it in (top-level index or address from list_fx_tree); default: the top level of the chain.
namestringName shown for the container.
track (required)integerZero-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.

ArgumentTypeDescription
modeinteger0 post-fader (default), 1 pre-FX, 3 post-FX.
monobooleanMix to mono on the output channel.
muteboolean
output_channelintegerFirst output channel, starting at 1 (see list_outputs); default 1.
pannumberPan from -1 to 1.
source_channelintegerFirst track channel to send, 0 = channels 1/2, 2 = 3/4 …; -1 sends no audio.
track (required)integerZero-based track index; -1 is the master track.
volume_dbnumberLevel in dB (0 = unity).

create_midi_item

Create an empty MIDI item on a track between two project times.

ArgumentTypeDescription
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.

ArgumentTypeDescription
folderstringPut the new tracks into a new folder track with this name.
instrument_to_parentbooleanfalse turns off the instrument’s own send to its parent, so only the new tracks are heard.
outputs (required)arrayOne new track per output pair, created right after the instrument in this order.
send_modeintegerSend mode: 0 post-fader (default), 1 pre-FX, 3 post-FX before the fader.
track (required)integerTrack with the multi-out instrument (Kontakt, ML Drums …).

create_send

Create a send between two tracks, optionally with level (dB) and pan.

ArgumentTypeDescription
dest_channelintegerFirst destination channel of the pair (0 = channels 1/2).
destination (required)integerDestination track index.
modeintegerWhere the send taps the track: 0 = post-fader, 1 = pre-FX, 3 = post-FX before the fader.
monoboolean
pannumber
phase_invertedboolean
source (required)integerSource track index.
source_channelintegerFirst source channel of the pair: 0 = channels 1/2, 2 = 3/4, 4 = 5/6 …; -1 = no audio.
volume_dbnumber

create_track

Create a named track at the end of the current REAPER project.

ArgumentTypeDescription
name (required)stringName to assign to the new track.

delete_automation_item

Delete one automation item from an envelope. Returns the remaining automation items.

ArgumentTypeDescription
envelope (required)ParamRefTrack envelope name (Volume, Pan …), or with fx the parameter name or index.
fxintegerFX index when the envelope belongs to an FX parameter.
index (required)integerAutomation item index from list_automation_items.
track (required)integerZero-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.

ArgumentTypeDescription
envelope (required)ParamRefTrack envelope name (Volume, Pan …), or with fx the parameter name or index.
fxintegerFX index when the envelope belongs to an FX parameter.
track (required)integerZero-based track index; -1 is the master track.

delete_ext_state

Delete an ExtState key, in the project (default) or global scope.

ArgumentTypeDescription
key (required)string
scopestring“project” (default) or “global”.
section (required)string

delete_item

Delete one media item from a track (indexes from list_items).

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
track (required)integerZero-based track index.

delete_marker

Delete one marker or region by its number. Returns the remaining markers.

ArgumentTypeDescription
is_regionbooleanPick the region (true) or the marker (false) when both have this number; default: the marker.
number (required)integerThe 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.

ArgumentTypeDescription
allbooleanDelete every event that is not a note.
controllerintegerOnly CC events of this controller.
end_secondsnumberOnly events before this time.
item (required)integerZero-based index of the MIDI item on the track.
kindMidiEventKindOnly events of this kind.
start_secondsnumberOnly events at or after this time.
track (required)integerZero-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.

ArgumentTypeDescription
allbooleanDelete every note.
end_secondsnumberInstead of indexes: delete notes starting before this time.
indexesarrayNote indexes from list_midi_notes.
item (required)integerZero-based index of the MIDI item on the track.
pitchintegerInstead of indexes: delete the notes of this pitch.
start_secondsnumberInstead of indexes: delete notes starting at or after this time.
track (required)integerZero-based track index.

delete_track

Delete a track. With with_children also everything inside a folder track. The master track cannot be deleted.

ArgumentTypeDescription
track (required)integerZero-based track index from list_tracks (the master track cannot be deleted).
with_childrenbooleanFor 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.

ArgumentTypeDescription
track (required)integerZero-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.

ArgumentTypeDescription
fxarrayOnly these plugins: FX indexes or parts of their names. Default: the whole chain.
path (required)stringPath of the .RfxChain file to write.
track (required)integerZero-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.

ArgumentTypeDescription
directory (required)stringDestination directory for the .RTrackTemplate files.
groupsarrayOptional track groups. Defaults to DRUMS, BASS, GUITARS, VOCALS, MIX BUS, RETURNS.
include_master_chainbooleanWhether 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.

ArgumentTypeDescription
fx (required)integer
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
param (required)ParamRefParameter index or name.
track (required)integer
value (required)numberNormalized 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.

ArgumentTypeDescription
command_id (required)ActionIdNumeric 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.

ArgumentTypeDescription
keystringKey to read; without it every key of the section (project scope only).
scopestring“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.

ArgumentTypeDescription
fx (required)integerZero-based FX index from list_fx.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
track (required)integerZero-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.

ArgumentTypeDescription
barintegerAlternative to seconds: bar number, starting at 1.
beatnumberBeat within the bar, starting at 1. Default 1.
secondsnumberReport 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.

ArgumentTypeDescription
secondsnumberProject 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.

ArgumentTypeDescription
fx (required)integerFX index, or an address inside a container from list_fx_tree.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
param (required)ParamRefParameter index or name.
track (required)integerZero-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.

ArgumentTypeDescription
track (required)integerZero-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.

ArgumentTypeDescription
track (required)integerZero-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.

ArgumentTypeDescription
is_regionbooleantrue for a region, false for a marker; without it a marker is preferred.
namestringMarker or region name; with number, both must match.
numberintegerMarker 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.

ArgumentTypeDescription
end_secondsnumberOnly notes starting before this project time in seconds.
item (required)integerZero-based index of the MIDI item on the track.
length_percentnumberLargest change of a note length, shorter or longer, in percent (0-99).
pitchintegerOnly notes of this pitch.
seedintegerSeed of the random numbers: the same seed on the same notes gives the same result. Default: a new seed, returned in the result.
start_secondsnumberOnly notes starting at or after this project time in seconds.
timing_msnumberLargest shift of a note start, earlier or later, in milliseconds (0-1000).
track (required)integerZero-based track index.
velocitynumberLargest 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.

ArgumentTypeDescription
modestringappend (default, after the FX the track has) or replace.
path (required)stringPath of an .RfxChain file.
track (required)integerZero-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.

ArgumentTypeDescription
envelope (required)ParamRefTrack envelope name (Volume, Pan …), or with fx the parameter name or index.
fxintegerFX index when the envelope belongs to an FX parameter.
length (required)numberLength in seconds.
pool_idintegerPool to make a new instance of (shares its contents); default: a new item from the envelope points in its range.
position (required)numberPosition in project seconds.
track (required)integerZero-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.

ArgumentTypeDescription
path (required)stringAbsolute path of the audio file.
positionnumberItem position in seconds (default 0).
track (required)integerZero-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.

ArgumentTypeDescription
envelope (required)ParamRefTrack envelope name (Volume, Pan …), or with fx the parameter name or index.
fxintegerFX index when the envelope belongs to an FX parameter.
track (required)integerZero-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.

ArgumentTypeDescription
itemintegerItem index on the track: list the FX of its active take instead of the track’s.
track (required)integerZero-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.

ArgumentTypeDescription
fx (required)integer
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
param (required)ParamRefParameter index or name.
stepsintegerSampling 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).

ArgumentTypeDescription
fx (required)integerZero-based FX index from list_fx.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
track (required)integerZero-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.

ArgumentTypeDescription
fx (required)integerZero-based FX index from list_fx.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
track (required)integerZero-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.

ArgumentTypeDescription
track (required)integerZero-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.

ArgumentTypeDescription
track (required)integerZero-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.

ArgumentTypeDescription
track (required)integerZero-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).

ArgumentTypeDescription
item (required)integerZero-based index of the MIDI item on the track.
kindsarrayOnly these kinds (default: all events except notes).
track (required)integerZero-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.

ArgumentTypeDescription
item (required)integerZero-based index of the MIDI item on the track (list_items).
limitintegerReturn at most this many notes (default 5000).
offsetintegerSkip this many notes first.
pitchintegerOnly notes of this MIDI pitch (the per-pitch counts always cover all notes).
track (required)integerZero-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.

ArgumentTypeDescription
filterstringOnly 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.

ArgumentTypeDescription
track (required)integerZero-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.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
track (required)integerZero-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.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
track (required)integerZero-based track index.

list_take_markers

List the take markers of an item’s active take: source position, name and color.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
track (required)integerZero-based track index.

list_takes

List the takes of an item: name, source file and which one is active.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
track (required)integerZero-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).

ArgumentTypeDescription
include_all_parametersbooleanAlso scan every plugin parameter for automation (slow on plugins with thousands of MIDI parameters).
track (required)integerZero-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.

ArgumentTypeDescription
fx (required)integerCurrent zero-based FX index.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
to_index (required)integerFinal 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.

ArgumentTypeDescription
fx (required)integerAddress of the FX inside a container, from list_fx_tree.
positionintegerTop-level position to put it at, from 0 (default: the end of the chain).
track (required)integerZero-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.

ArgumentTypeDescription
container (required)integerContainer: top-level index or address from list_fx_tree, at any depth.
fx (required)integerFX to move: top-level index or address from list_fx_tree.
positionintegerPosition inside the container, from 0 (default: the end).
track (required)integerZero-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.

ArgumentTypeDescription
dry_runbooleanOnly report what would move.
include_envelopesbooleanMove the automation points of the tracks by the same musical distance (default true).
itemintegerMove only this item (index from list_items); needs exactly one track.
snap_tostringRound every new position to this grid (same units as unit).
tracks (required)arrayZero-based indexes of the tracks whose items move.
unitstringbar, beat, grid (the project grid), 1/1, 1/2, 1/4, 1/8, 1/16, 1/32 or 1/64. Default bar.
value (required)numberHow many units to move: positive later, negative earlier, fractions allowed (0.5 bar).
with_childrenbooleanAlso 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.

ArgumentTypeDescription
before_index (required)integerZero-based index the track should end up before; the track count moves it to the end.
index (required)integerZero-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.

ArgumentTypeDescription
dry_runbooleanOnly report what would change.
exclude_tracksarrayZero-based track indexes to leave alone.
modestringpeak (default), true_peak, lufs_i, lufs_m, lufs_s or rms.
target_db (required)numberNormalization target in dB (0 or lower): dBFS for peak and true_peak, LUFS for the lufs modes, dB for rms.
tracksarrayZero-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.

ArgumentTypeDescription
discard_unsavedbooleanOpen even if the current project has unsaved changes (they are lost).
path (required)stringAbsolute 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).

ArgumentTypeDescription
channelsintegerHow many instrument channels to probe; default: the largest output count of the track’s FX.
directory (required)stringFolder for the probe files (one WAV per output pair).
end_secondsnumber
start_secondsnumber
track (required)integerTrack 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.

ArgumentTypeDescription
endsbooleanQuantize note ends too (default false: the length is kept).
gridstringgrid (the project grid, default), 1/1 … 1/64, or triplets 1/4T, 1/8T, 1/16T.
item (required)integerZero-based index of the MIDI item on the track.
pitchintegerOnly notes of this pitch.
strengthnumberHow far to move toward the grid, 0-100 percent (default 100).
track (required)integerZero-based track index.

redo

Redo steps undone before (default one). Returns the names of the redone steps and the next undo and redo.

ArgumentTypeDescription
stepsintegerHow 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.

ArgumentTypeDescription
fx (required)integerZero-based FX index from list_fx.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
track (required)integerZero-based track index; -1 is the master track.

remove_hardware_output

Remove a hardware output from a track. Returns the remaining hardware outputs.

ArgumentTypeDescription
index (required)integerHardware output index from list_hardware_outputs.
track (required)integerZero-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.

ArgumentTypeDescription
send_index (required)integerSend index from list_sends.
source (required)integerSource track index.

rename_track

Rename a REAPER track by its zero-based index from list_tracks.

ArgumentTypeDescription
index (required)integerZero-based track index from list_tracks.
name (required)stringNew 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.

ArgumentTypeDescription
directory (required)stringOutput directory.
end_secondsnumberRender only up to this time (seconds).
formatstringOutput format: pcm16, pcm24, float32 (keeps levels above 0 dBFS) or a raw base64 render config. Default: the project’s saved format.
freshbooleanSave the project and open it again before rendering, so the render sees the saved state (default false).
name (required)stringFile name without extension; the extension comes from the project’s render format.
overwritebooleanDelete 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_rateinteger
start_secondsnumberRender only from this time (seconds); give together with end_seconds. Default: the whole project.
timeout_secondsintegerGive 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.

ArgumentTypeDescription
directory (required)stringOutput directory.
formatstringOutput format: pcm16, pcm24, float32 or a raw base64 render config. Default: the project’s.
overwritebooleanDelete the files this render is about to write (default true).
patternstringFile name pattern with REAPER wildcards; default $region (with the matrix $region-$track).
timeout_secondsintegerGive up waiting after this many seconds (default 1800).
use_matrixbooleanRender 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.

ArgumentTypeDescription
directory (required)stringOutput directory.
end_secondsnumberRender only up to this time (seconds).
formatstringOutput format: pcm16, pcm24, float32 (keeps levels above 0 dBFS) or a raw base64 render config. Default: the project’s saved format.
freshbooleanSave the project and open it again before rendering, so the render sees the saved state (default false).
overwritebooleanDelete 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.
patternstringFile name pattern; defaults to $track.
start_secondsnumberRender only from this time (seconds); give together with end_seconds. Default: the whole project.
timeout_secondsintegerGive up waiting after this many seconds (default 3600).
tracks (required)arrayZero-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.

ArgumentTypeDescription
directory (required)stringOutput directory.
end_secondsnumber
formatstring
freshbooleanSave and reopen the project before each render (default true).
overwritebooleanDelete the files a render is about to write (default true).
patternstringFile name pattern, default $track-{variant}.
start_secondsnumber
timeout_secondsintegerGive up waiting after this many seconds (default 3600).
tracks (required)arrayZero-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.

ArgumentTypeDescription
command_id (required)ActionIdNumeric 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.

ArgumentTypeDescription
pathstringSave 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.

ArgumentTypeDescription
limitintegerMost actions to return (default 50).
query (required)stringWords 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.

ArgumentTypeDescription
addbooleanAdd to the current selection instead of replacing it.
items (required)arrayItems 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.

ArgumentTypeDescription
addbooleanAdd to the current selection instead of replacing it.
tracks (required)arrayZero-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.

ArgumentTypeDescription
command_id (required)ActionIdNumeric action ID or a named command such as _SWS_SAVEALLSELTRK.
on (required)booleanThe 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.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
take (required)integerZero-based take index from list_takes.
track (required)integerZero-based track index.

set_automation_item

Change an automation item: position, length, start offset, rate, baseline, amplitude or loop. Returns the automation items.

ArgumentTypeDescription
amplitudenumberAmplitude, -1 to 1.
baselinenumberBaseline, 0 to 1.
envelope (required)ParamRefTrack envelope name (Volume, Pan …), or with fx the parameter name or index.
fxintegerFX index when the envelope belongs to an FX parameter.
index (required)integerAutomation item index from list_automation_items.
lengthnumberLength in seconds.
loopbooleanLoop the contents over the item length.
play_ratenumberPlayback rate of the contents.
positionnumberPosition in project seconds.
start_offsetnumberStart offset into the contents in seconds.
track (required)integerZero-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.

ArgumentTypeDescription
barintegerAlternative to seconds: bar number, starting at 1.
beatnumberBeat within the bar, starting at 1 (fractions allowed). Default 1.
move_viewbooleanScroll the arrange view to the cursor (default false).
secondsnumberPosition in seconds.
seek_playbooleanWhile 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.

ArgumentTypeDescription
active (required)booleantrue switches the envelope on, false off (the points are kept).
envelope (required)stringTrack envelope name (Volume, Pan, Mute, Trim Volume, Volume (Pre-FX) …), or the parameter name when fx is given.
fxintegerPlugin index when the envelope belongs to a plugin parameter.
track (required)integerZero-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.

ArgumentTypeDescription
clearbooleanDelete the existing points first (default true).
envelope (required)valueVolume or Pan (created and shown if it does not exist), or, with fx, the parameter name or index.
fxintegerFX 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).

ArgumentTypeDescription
key (required)string
persistbooleanGlobal scope: true keeps the value after REAPER restarts (default false).
scopestring“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.

ArgumentTypeDescription
enabled (required)boolean
fx (required)integer
itemintegerItem 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).

ArgumentTypeDescription
fx (required)integer
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
param (required)ParamRefParameter index or name.
points (required)arrayReplaces 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.

ArgumentTypeDescription
display_textstringText the plugin shows, for choice and switch parameters (for example “Clean” or “On”).
display_valuenumberNumber 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
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
param (required)ParamRefParameter index or name.
track (required)integer
valuenumberNormalized 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.

ArgumentTypeDescription
fx (required)integer
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
params (required)arrayParameters 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.

ArgumentTypeDescription
fx (required)integer
itemintegerItem 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).

ArgumentTypeDescription
fx (required)integer
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
preset (required)stringPreset 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.

ArgumentTypeDescription
mode (required)AutomationOverridenone 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.

ArgumentTypeDescription
index (required)integerHardware output index from list_hardware_outputs.
modeinteger0 post-fader, 1 pre-FX, 3 post-FX.
monobooleanMix to mono on the output channel.
muteboolean
output_channelintegerFirst output channel, starting at 1.
pannumberPan from -1 to 1.
source_channelintegerFirst track channel to send, 0 = channels 1/2, 2 = 3/4 …; -1 sends no audio.
track (required)integerZero-based track index; -1 is the master track.
volume_dbnumberLevel 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.

ArgumentTypeDescription
channel_modestringActive take channel mode: normal, reverse_stereo, mono_mix, left or right.
fade_innumberFade-in length in seconds (0 removes the fade).
fade_in_shapeFadeShapeFade-in curve.
fade_outnumberFade-out length in seconds (0 removes the fade).
fade_out_shapeFadeShapeFade-out curve.
item (required)integerZero-based item index on the track, from list_items.
lengthnumberItem length in seconds.
muteboolean
pitchnumberActive take pitch in semitones (-12 one octave down, 12 one octave up; fractions allowed).
play_ratenumberActive take playback rate: 0.5 half speed, 1 normal, 2 double speed.
positionnumberItem position on the timeline in seconds (use move_items or set_item_position for bars and beats).
preserve_pitchbooleanKeep the pitch when the play rate changes.
set_lengthbooleanWith source: set the item length to the new file’s length (default true).
sourcestringPath of an audio file to play instead of the current source.
start_offsetnumberStart 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_pannumberActive take pan from -1 (left) to 1 (right); acts before the track FX.
track (required)integerZero-based track index from list_tracks.
volume_dbnumberItem 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.

ArgumentTypeDescription
barintegerBar number, starting at 1.
beatnumberBeat within the bar, starting at 1 (fractions allowed). Default 1.
item (required)integerZero-based item index from list_items.
secondsnumberAlternative to bar: a position in seconds.
snap_tostringRound 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.

ArgumentTypeDescription
time_basestringtime (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).
tracksarrayZero-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.

ArgumentTypeDescription
colorstringNew color as #rrggbb.
end_secondsnumberNew end in project seconds (regions only).
is_regionbooleanPick the region (true) or the marker (false) when both have this number; default: the marker.
namestringNew name (an empty string clears it).
number (required)integerThe marker or region number REAPER shows (number in list_markers).
position_secondsnumberNew 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.

ArgumentTypeDescription
offline (required)booleantrue closes the file (so it can be overwritten), false opens it again.
path (required)stringPath 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.

ArgumentTypeDescription
item (required)integerZero-based index of the MIDI item on the track.
notes (required)arrayThe notes to change, by index; fields that are not given keep their value.
track (required)integerZero-based track index.

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.

ArgumentTypeDescription
activebooleanfalse removes the link.
fx (required)integerFX whose parameter follows.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
offsetnumberOffset added to the follower, -1 to 1.
param (required)ParamRefParameter that follows, index or name.
scalenumberHow far the follower moves per unit of the leader (negative inverts).
source_fxintegerFX that leads (required unless active is false).
source_paramParamRefParameter that leads, index or name.
track (required)integerZero-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.

ArgumentTypeDescription
acsAcsSettingsAudio control signal (envelope follower) settings; fields that are not given keep their value.
activebooleanTurn the parameter’s modulation on or off (turning on an LFO or ACS turns it on).
baselinenumberBase value the modulation moves around, 0 to 1.
fx (required)integerFX index, or an address inside a container from list_fx_tree.
itemintegerItem index on the track: work on the FX of its active take instead of the track’s.
lfoLfoSettingsLFO settings; fields that are not given keep their value.
param (required)ParamRefParameter index or name.
track (required)integerZero-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.

ArgumentTypeDescription
authorstring
notesstringThe project notes (Project Settings / Notes); replaces them.
titlestring

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.

ArgumentTypeDescription
sample_rate (required)integerProject 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.

ArgumentTypeDescription
clearbooleanRemove every track from the region first.
region (required)integerRegion number as REAPER shows it (number in list_markers).
removebooleanRemove these tracks from the region instead of adding them.
tracks (required)arrayTrack 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).

ArgumentTypeDescription
dest_channelintegerFirst destination channel of the pair (0 = channels 1/2).
modeintegerWhere the send taps the track: 0 = post-fader, 1 = pre-FX, 3 = post-FX before the fader.
monoboolean
muteboolean
pannumber
phase_invertedboolean
send_index (required)integerSend index from list_sends.
source (required)integerSource track index.
source_channelintegerFirst source channel of the pair: 0 = channels 1/2, 2 = 3/4, 4 = 5/6 …; -1 = no audio.
volume_dbnumber

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.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
markers (required)arrayThe stretch markers of the active take; replaces the existing ones, an empty list removes them.
track (required)integerZero-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.

ArgumentTypeDescription
clearbooleanDelete the existing points first (default true); an empty list then clears the envelope.
envelope (required)TakeEnvelopeNameTake envelope of the active take: Volume, Pan, Mute or Pitch (created if missing).
item (required)integerZero-based item index from list_items.
points (required)arrayPoints with times in seconds from the item start; Volume takes value_db, Pitch semitones as value.
track (required)integerZero-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.

ArgumentTypeDescription
item (required)integerZero-based item index from list_items.
markers (required)arrayThe take markers of the active take; replaces the existing ones, an empty list removes them.
track (required)integerZero-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.

ArgumentTypeDescription
clearbooleanRemove the existing tempo markers first (default true).
markers (required)arrayTempo 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.

ArgumentTypeDescription
clearbooleanRemove the time selection (or, with loop, the loop range).
end_barintegerAlternative to end_seconds: bar number, starting at 1 (bar 5 ends the range at the start of bar 5).
end_beatnumberBeat within end_bar, starting at 1. Default 1.
end_secondsnumberEnd in seconds.
loopbooleanSet the loop range instead of the time selection (default false).
start_barintegerAlternative to start_seconds: bar number, starting at 1.
start_beatnumberBeat within start_bar, starting at 1. Default 1.
start_secondsnumberStart 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.

ArgumentTypeDescription
automation_modeAutomationModeTrack automation mode.
channelsintegerNumber 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.
colorstringTrack color as #rrggbb, or none to remove the custom color.
fx_enabledbooleanWhether the track’s entire FX chain is enabled.
master_sendbooleanWhether the track feeds its parent / master.
monitorMonitorInput monitoring: off, on, or tape (not while playing).
muteboolean
namestring
pannumberPan from -1 (left) to 1 (right).
phase_invertedboolean
record_armbooleanArm the track for recording.
record_inputRecordInputWhat the track records from; see list_inputs for the inputs of this machine.
record_modeRecordModeWhat recording captures: the input, the track output, or MIDI overdub / replace.
soloboolean
track (required)integerZero-based track index from list_tracks; -1 is the master track.
volume_dbnumberTrack 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.

ArgumentTypeDescription
depth (required)integer1 starts a folder, 0 is a normal track, -1 (or lower, down to -16) closes that many folder levels.
index (required)integerZero-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.

ArgumentTypeDescription
group (required)integerGroup number, 1-64.
memberbooleanfalse removes the track from the group for these parameters (default true).
params (required)arrayWhich parameters the group links.
roleGroupRolelead (changes on this track move the group), follow, or both (default).
track (required)integerZero-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.

ArgumentTypeDescription
barintegerAlternative to seconds: bar number, starting at 1.
beatnumberBeat within the bar, starting at 1 (fractions allowed). Default 1.
secondsnumberSplit position in seconds.
tracks (required)arrayZero-based indexes of the tracks whose items are split.

switch_project

Make another open project tab the active one.

ArgumentTypeDescription
index (required)integerZero-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.

ArgumentTypeDescription
actionTransportActionplay, stop, pause (toggles pause) or record (starts recording on armed tracks).
repeatbooleanTurn 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.

ArgumentTypeDescription
stepsintegerHow many steps to undo or redo (default 1). Stops early when the history ends.