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

reaper-mcp-rs

reaper-mcp-rs is a Model Context Protocol server for REAPER. It lets an AI agent, such as Claude Code or Claude Desktop, work on a real REAPER project the way an engineer does: create and route tracks, place and move media by bars and beats, set FX parameters, write automation, render stems and check the result with loudness and spectrum analysis.

Unofficial: not affiliated with or endorsed by Cockos. REAPER is a trademark of Cockos Incorporated.

How it works

MCP client ──stdio──▶ reaper-mcp-rs ──files──▶ Lua bridge inside REAPER ──▶ ReaScript API
(Claude Code,          (Rust binary)   request.json      (reaper_mcp_bridge.lua,
 Claude Desktop, …)                    response.json      reaper_mcp_handlers.lua)
                                       heartbeat
  • The server is a single Rust binary. The MCP client starts it and talks to it over stdio.
  • The bridge is a Lua ReaScript that runs inside REAPER. REAPER stays the only process that calls its own API, so a crash in the server cannot corrupt a project.
  • They exchange versioned JSON files in an IPC directory. The bridge writes a heartbeat every second, so the server can tell when REAPER is busy or the bridge has stopped.
  • The bridge runs a fixed set of handlers. It never executes code sent by the client.

Status

Early (0.x): the tools grew out of real mixing work and are used on real projects, but argument names can still change between minor versions. See the changelog.

PlatformState
WindowsMain platform; extra tools inspect REAPER’s windows and restart the bridge when REAPER hangs.
LinuxSupported; set up with the same installer.
macOSBuilds and passes CI; not yet tried with REAPER. Reports are welcome.

What the tools cover, and what not yet, is in REAPER API coverage; the order of the next steps is in the roadmap.

Installation

You need a current REAPER and an MCP client. The bridge is a Lua ReaScript, tested with Lua 5.4, the version current REAPER releases embed. Installing puts two things in place: the server binary and the Lua bridge in REAPER’s Scripts folder.

One-line installer

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/ansromanov/reaper-mcp-rs/main/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/ansromanov/reaper-mcp-rs/main/install.ps1 | iex

The installer downloads the latest release for your platform, checks its SHA-256 checksum, installs the server and the bridge, and prints the command that registers the server with your MCP client.

PlatformServer binaryBridge
Linux~/.local/bin/reaper-mcp-rs~/.config/REAPER/Scripts/reaper-mcp/
macOS~/.local/bin/reaper-mcp-rs~/Library/Application Support/REAPER/Scripts/reaper-mcp/
Windows%LOCALAPPDATA%\Programs\reaper-mcp-rs\reaper-mcp-rs.exe%APPDATA%\REAPER\Scripts\reaper-mcp\

Environment variables change what the installer does:

VariableEffect
REAPER_MCP_STARTUP=1Start the bridge with REAPER (adds one line to Scripts/__startup.lua).
REAPER_MCP_VERSION=v0.2.0Install that release instead of the latest.
REAPER_MCP_BIN_DIR=…Put the server binary somewhere else.
REAPER_RESOURCE_PATH=…REAPER resource directory, for a portable REAPER install.

For example, to install and start the bridge with REAPER on Linux:

curl -fsSL https://raw.githubusercontent.com/ansromanov/reaper-mcp-rs/main/install.sh | REAPER_MCP_STARTUP=1 sh

Start the bridge in REAPER

If you did not choose to start it with REAPER, start it once per REAPER session: Actions > Show action list > New action > Load ReaScript, choose Scripts/reaper-mcp/reaper_mcp_bridge.lua and run it. Keep REAPER open.

Starting the bridge again replaces the running copy, and the reload_bridge tool re-reads the handlers after an update without restarting REAPER.

From a release archive

Every release has an archive per platform with the binary, the bridge (lua/), the install scripts and SHA256SUMS. Unpack it and run:

  • Linux, macOS: scripts/install-bridge.sh [--startup] [REAPER resource directory]
  • Windows: scripts\install-bridge.ps1 [-Startup] [-ResourceDir <dir>]

Then put the binary anywhere and point your MCP client at it.

On Windows the installer scripts work in Windows PowerShell 5 and PowerShell 7, with a clean profile and with spaces or non-ASCII characters in the paths (checked on Windows 11). -Startup writes the __startup.lua line once, however often you run the script. For a portable REAPER, start it with -cfgfile <dir>\reaper.ini: otherwise REAPER takes %APPDATA%\REAPER as its resource directory and never loads the bridge installed in the portable folder. For the MCP client config see Clients.

From source

git clone https://github.com/ansromanov/reaper-mcp-rs
cd reaper-mcp-rs
cargo build --release
scripts/install-bridge.sh            # Windows: scripts\install-bridge.ps1

The binary is target/release/reaper-mcp-rs. Building needs a stable Rust toolchain.

Check the installation

reaper-mcp-rs --version

Then connect an MCP client and call the health tool: it reports whether the bridge heartbeat is fresh and which IPC directory the server uses.

Updating and removing

Run the installer again to update; restart the bridge (or call reload_bridge) afterwards. To remove, delete the server binary, the Scripts/reaper-mcp folder and, if you added it, the bridge line in Scripts/__startup.lua.

Connecting an MCP client

reaper-mcp-rs is a stdio MCP server: the client starts the binary and talks to it over stdin and stdout. It takes no arguments. Use the full path printed by the installer.

Claude Code

claude mcp add reaper -- ~/.local/bin/reaper-mcp-rs

On Windows:

claude mcp add reaper -- "$env:LOCALAPPDATA\Programs\reaper-mcp-rs\reaper-mcp-rs.exe"

Add --scope user to make it available in every project.

Claude Desktop

Open Settings > Developer > Edit Config and add the server to claude_desktop_config.json:

{
  "mcpServers": {
    "reaper": {
      "command": "/home/you/.local/bin/reaper-mcp-rs"
    }
  }
}

On Windows, escape the backslashes: "command": "C:\\Users\\you\\AppData\\Local\\Programs\\reaper-mcp-rs\\reaper-mcp-rs.exe". Restart Claude Desktop afterwards.

Other clients

Any client that runs stdio MCP servers works. The usual configuration is the same mcpServers entry as above: a name, the command, and optionally environment variables.

A different IPC directory

The server and the bridge find each other through an IPC directory, by default <REAPER resource directory>/reaper-mcp-bridge. To move it, set REAPER_MCP_DIR to the same path for both REAPER and the server:

{
  "mcpServers": {
    "reaper": {
      "command": "/home/you/.local/bin/reaper-mcp-rs",
      "env": { "REAPER_MCP_DIR": "/tmp/reaper-mcp" }
    }
  }
}

To let the server close REAPER’s blocking windows on load (an old project’s load warning, a project’s notes), add "REAPER_MCP_CLOSE_DIALOGS": "1" to the same env (Configuration).

See Configuration and IPC.

Quick start

  1. Open REAPER with a project and make sure the bridge is running (Installation).

  2. In your MCP client, ask for the bridge state. The agent calls health:

    { "connected": true, "heartbeat_age_seconds": 0, "ipc_directory": "…/REAPER/reaper-mcp-bridge" }
    
  3. Ask for an overview. project_snapshot returns the whole project in one call: tracks, folders, faders, FX, sends, item counts and the master FX.

Things to ask

  • “List the tracks and their FX, and tell me which ones have no output to the master.”
  • “Create a BASS folder with DI and AMP tracks, and send both to the BASS bus.”
  • “Set the vocal compressor’s threshold to -18 dB and its ratio to 4:1.” The agent finds the parameters by name and can set them by the value the plugin displays.
  • “Move every item on the drum tracks two bars later.” Items move by bars and beats, so they stay on the grid when the tempo is not round.
  • “Render the drum and bass stems as float32 WAV, then compare the mix to reference.wav.” analyze_audio and compare_audio report loudness, peaks, stereo width and the spectrum.

Good habits

  • Save or back up first. Edits run inside REAPER undo blocks, so Ctrl+Z works, but an agent can make many changes quickly.
  • Render analysis files as float32, so that levels above 0 dBFS are not cut off.
  • Prefer real tools over run_action. It runs any REAPER action by ID and is meant as a stop-gap until a feature gets its own tool.

Next: What the tools do, or the full tool reference.

What the tools do

A tour of the tools by task. Every tool with every argument is in the tool reference. Track index -1 is the master track everywhere; edits run inside REAPER undo blocks.

Bridge and REAPER

health reports whether the bridge heartbeat is fresh. reload_bridge re-reads the Lua handlers after an update, without restarting REAPER. audio_device reads, closes or opens REAPER’s audio and MIDI devices.

On Windows, three tools work even when REAPER’s Lua thread is stuck, because they do not go through the bridge: inspect_reaper_windows reports REAPER processes, visible windows, owned dialog text and whether the main window responds; close_reaper_fx_windows posts WM_CLOSE to visible owned dialogs whose title starts with the given title_prefix; restart_bridge asks the installed REAPER to load the bridge again. None of them terminates REAPER.

Projects and tabs

get_project_info (name, tempo, time signature, track count, sample rate, length, and the play rate: a render lasts length / play rate), open_project, save_project, set_project_sample_rate. Project tabs: list_projects, switch_project, new_project_tab and close_project_tab. Closing requires index, keeps the active tab active and refuses a tab with unsaved changes or the last tab.

get_project_notes and set_project_notes read and write the project notes, title and author (Project Settings / Notes), saved with the project: a place to leave notes for the next session. show_on_load says whether the saved file opens the notes window on load, which blocks REAPER (see Configuration); REAPER’s API cannot change it, so it is read from the saved file and is null for a project never saved.

get_ext_state, set_ext_state and delete_ext_state keep named values by section and key. Scope project (the default) is saved in the project file, and get_ext_state without a key lists a section; REAPER keeps project keys in upper case and finds them in any case. Scope global is kept by REAPER for every project, until it quits or, with persist, for good; it cannot be listed.

project_snapshot returns the whole project in one call: tracks, folders, faders, FX, sends, item counts and master FX. Compare two snapshots to see what changed. list_plugins lists the plugins in use with their instance count and the VST3 version on disk. REAPER keeps an old DLL loaded after an update, so a newer version on disk needs a REAPER restart.

Transport, cursor and undo

get_transport reads the play state (stopped, playing, paused, recording), the play position, the edit cursor in seconds and bar.beat, the time selection, the loop range and whether repeat is on. transport plays, stops, pauses or records (on the armed tracks) and turns repeat on or off. set_edit_cursor moves the cursor to seconds or to a bar and beat; set_time_selection sets or clears the time selection, or with loop the loop range, by seconds or bars. With REAPER’s default setting the loop points are linked to the time selection, so the other range follows.

undo and redo step through REAPER’s undo history (steps, default one) and return the names of the steps, for example MCP: rename track, so an agent can take back its own edits.

Tracks and folders

list_tracks, get_track, create_track, rename_track, delete_track, and set_track for the fader in dB, pan, mute, solo, phase, master send, channel count and the whole FX chain’s enable state. describe_track shows everything that sets the level and sound of one track (fader, pan, FX chain with pin mappings, envelopes, sends, receives) and notes what acts after the plugins, for example an active volume envelope that shifts a limiter’s ceiling.

set_track also sets the track color (#rrggbb, or none) and recording: record_arm, record_input ({"kind": "audio", "channel": 1, "channels": "stereo"}, {"kind": "midi", "device": "all", "channel": 0} or {"kind": "none"}), monitor (off, on, tape) and record_mode (input, the track output in stereo or mono, midi_overdub, midi_replace …). list_inputs names the audio inputs and MIDI devices of the machine. Track descriptions report all of them.

set_track also sets the automation mode (trim_read, read, touch, write, latch, latch_preview); set_global_automation_override overrides it for all tracks (none or bypass among others). set_track_group puts a track in one of 64 track groups for chosen parameters (volume, pan, mute, solo, record_arm, polarity …) as lead, follower or both, and get_track_groups reads them back. select_tracks, select_items and get_selection set and read the selection that some REAPER actions work on.

Folders: move_track reorders one track (before_index); set_track_folder_depth sets the folder depth (1 starts a folder, 0 normal, -1..-16 closes levels). Reorder first, then set depths; routing is not changed. delete_track with with_children also removes the inside of a folder.

Multi-output instruments such as Kontakt: probe_instrument_outputs renders a short range of every output pair to its own file and reports what plays there (loudness, peak, loudest band; silent pairs are marked), and create_multiout_tracks creates one track per output pair, each fed by a send from the instrument.

Templates and FX chains

export_mix_template writes item-free .RTrackTemplate files for the mix groups DRUMS, BASS, GUITARS, VOCALS, MIX BUS and RETURNS, plus master.RfxChain unless include_master_chain is false. It keeps FX, folder contents and the receives inside a group (remapped to template-local indexes); receives from outside a group are dropped and counted in the result.

apply_track_fx_template copies only the static FX state of a named template track to a project track. It keeps the destination’s media, routing, pan, fader and non-FX envelopes. The default mode is replace; append adds the FX after the existing chain and keeps its automation.

REAPER has no function that writes a plugin preset, so export_fx_chain writes the FX of a track (all, or the ones named in fx) to an .RfxChain file with the plugin states inside, and import_fx_chain puts such a file on a track (append or replace). Use a chain file for “this guitar amp sound”; a whole group with its tracks, routing and FX is a track template.

FX and parameters

list_fx, add_fx, remove_fx, move_fx, set_fx_enabled, presets with list_fx_presets (names every preset and leaves the plugin as it was) and set_fx_preset, and pin mappings with get_fx_pins and set_fx_pins.

Parameters: list_fx_params, set_fx_param and set_fx_params (several in one undo step). A parameter is found by index, exact name or a case-insensitive part of the name, and set by normalized value, by the number the plugin displays (display_value, solved by bisection) or by its displayed text (display_text, for switches and choices). list_fx_param_choices lists the texts a switch can show, and format_fx_param shows how the plugin would display a value.

FX containers (REAPER 7): create_fx_container adds one at the end of the chain, or with container inside another container. move_fx_to_container moves an FX into a container at any depth at a position, and move_fx_out_of_container moves one back to the top level. list_fx_tree shows the chain as a tree with an address for every FX. An address inside a container works as fx in the other FX tools. Addresses inside containers depend on the FX counts of the chains above, so they change when FX are added, removed or moved: take them from the tree the move tools return.

Modulation: set_param_modulation drives a parameter from an LFO (shape, speed, strength, phase, tempo sync) and/or an audio control signal (an envelope follower with attack, release and a dB range, for example from a sidechain on channels 3/4) around a baseline; set_param_link makes a parameter follow another FX parameter with a scale and offset; get_param_modulation reads all of it.

Take FX: every tool in this section, the FX envelope and the modulation tools also take item; with it they work on the FX chain of that item’s active take instead of the track’s (add_fx {"track": 2, "item": 0, "name": "ReaEQ"}). FX chain files and containers are for tracks only.

Sends and routing

list_sends, create_send, set_send, remove_send. A send takes source_channel and dest_channel (the first channel of a pair: 0 = 1/2, 2 = 3/4, 4 = 5/6 …; this is how a multi-out plugin feeds several tracks), mono, phase_inverted and mode (0 post-fader, 1 pre-FX, 3 post-FX). REAPER cannot change the destination of a send: create the new one and remove the old one.

Hardware outputs send a track straight to an output of the audio interface (a click for the drummer, a headphone mix, outboard gear): list_hardware_outputs, create_hardware_output, set_hardware_output and remove_hardware_output take a 1-based output_channel (see list_outputs), mono, source_channel, level, pan, mute and mode like sends.

Items and media

list_items reports position (also as bar.beat), length, gain, mute, take pan, channel mode, source file, source channels and the take start_offset: a slip edit, so the file’s audio appears at position - start_offset. set_item changes gain, mute, position, length, start_offset, take pan, channel mode and source (play another file). insert_media and delete_item add and remove items; set_items_time_base sets how items follow tempo changes.

normalize_items uses REAPER’s own normalization (the calculation behind Item processing > Normalize): it sets the item gain so that the part of the source an item plays reaches target_db in peak, true_peak, lufs_i, lufs_m, lufs_s or rms. dry_run only reports.

split_items splits 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. set_item also sets fades (length and shape: linear, fast_start, fast_end, fast_start_steep, fast_end_steep, slow_start_end, slow_start_end_steep), the take’s play rate with or without preserving pitch, and its pitch in semitones; list_items reports them.

Takes: list_takes, add_take (another file as a new take; the active take stays unless activate) and set_active_take. Stretch markers (list_stretch_markers, set_stretch_markers) pin a source position to a position on the item, so the audio between markers stretches; take markers (list_take_markers, set_take_markers) are named points in a take’s source. Both set tools replace the markers of the active take; an empty list removes them.

set_media_offline closes (or reopens) the file of every item that plays it, so the file can be rewritten; otherwise REAPER holds it open (PermissionError on Windows).

Musical time, tempo and markers

Move by musical time instead of seconds, which leave the grid as soon as the tempo is not round. move_items moves the items of tracks (or one item) by bars, beats, the project grid or note values (1/4..1/64), optionally snapped to a grid, with the automation points (include_envelopes) and folder contents (with_children); dry_run shows the positions first. set_item_position puts one item at a bar and beat; get_grid shows tempo, time signature, grid size and the length of a bar.

set_tempo_map writes tempo markers given in quarter notes (the unit of a MIDI file or a Cubase tempo track), so MIDI placed by seconds lands on the bars of the audio. add_markers adds markers and regions by project seconds with an optional #rrggbb color; list_markers lists them. Each marker can also change the time signature (numerator, denominator); get_tempo_map lists the markers with their bar.beat position and the signature in effect, and get_grid with seconds or bar reports the tempo and signature at that point. set_marker changes one marker or region by its number (name, position, end, color) and delete_marker removes one. go_to_marker moves the edit cursor (and the play position while playing) to a marker or region by number or name, and get_markers_at names the last marker at or before a time and the region around it, at the edit cursor by default.

MIDI

create_midi_item, add_midi_notes and list_midi_notes (start and end in project seconds, pitch, velocity, note count per pitch, pitch filter). set_midi_notes changes notes by index (pitch, velocity, channel, start, end, mute) and delete_midi_notes removes them by index, by pitch and time range, or all. MIDI channels are 0-15 in these tools.

list_midi_events, add_midi_events and delete_midi_events handle everything that is not a note: CC (with the curve to the next point: square, linear, slow, fast_start, fast_end, bezier), pitch bend (-8192 to 8191), program change, channel pressure, poly aftertouch, text, lyric, marker, cue and sysex events (bytes in hex without F0 and F7). quantize_midi moves note starts toward the project grid or a note value (triplets too) with a strength in percent, keeping lengths unless ends is true.

humanize_midi loosens notes at random within limits: starts move by up to timing_ms either way, lengths change by up to length_percent and velocities by up to velocity (kept within 1-127), and no note moves before the item start. The random numbers come from seed: the same seed on the same notes gives the same result, and the result reports the seed used. pitch and a range of note starts (start_seconds, end_seconds) limit which notes change.

Automation

set_envelope_points writes the points of a track envelope: Volume with value_db, Pan, or an FX parameter with fx; a missing envelope is created and shown. set_fx_envelope does the same for one FX parameter. list_track_envelopes lists volume, trim, pan, width, mute and plugin envelopes with their state and range; set_envelope_active switches one on or off without deleting it, and delete_envelope removes a track or FX parameter envelope with its lane.

Take envelopes: set_take_envelope_points writes the Volume (value_db), Pan, Mute or Pitch (semitones) envelope of an item’s active take, creating it if missing; point times are seconds from the item start. list_take_envelopes lists them.

Automation items on an existing track or FX parameter envelope: insert_automation_item (from the envelope points in its range, or as a new instance of a pool with pool_id), set_automation_item (position, length, start offset, rate, baseline, amplitude, loop), delete_automation_item and list_automation_items.

Rendering

get_render_settings, render_project, render_stems and render_variants. Render tools delete the files they are about to write (overwrite: false keeps them), because REAPER never overwrites and writes NAME-001.wav next to the old file, which a caller then reads by mistake. The result lists the written files with their sizes and warns when one is missing. fresh: true saves and reopens the project before rendering. render_variants renders the same stems several times with different tracks muted per variant and restores the mutes.

render_regions renders every region to its own file (pattern $region by default), through the master mix or, with use_matrix, through the region render matrix, with the same safe behaviour: the files REAPER is about to write are deleted first and the written files are listed. get_region_render_matrix and set_region_render_matrix read and set which tracks each region renders (-1 is the master mix).

Audio analysis

These work on WAV files and need no REAPER. analyze_audio reports integrated loudness, loudness range, sample peak, samples above full scale, crest factor, stereo width and the spectrum in third-octave and mixing bands, for a whole file or a time range. compare_audio compares two files (for example a render against a reference) with the second turned to the loudness of the first, so the band differences describe tone and not volume. Render analysis files as float32 (render_project and render_stems take a format) so that levels above 0 dBFS are not cut off.

analyze_item and analyze_track give the same numbers without a render: the bridge reads the audio through REAPER’s audio accessors at the project sample rate and the server analyses it. An item is read from its active take, with take FX, take volume and pitch, in seconds from the item start; a track is read in project time as its items play, before track FX, sends and the fader (render to hear those). Both add peaks, an overview of peak_windows (default 20) stretches in project time with the peak of each and silent below -60 dBFS, to find where something is loud or quiet. One call reads at most 30 minutes.

Batches and actions

batch runs a list of {tool, args} in one call and stops at the first error (continue_on_error goes on). It runs the Lua handlers directly, so the arguments are the tools’ own. run_action runs a REAPER action by numeric ID or named command: a stop-gap until a feature gets its own tool.

To find an action and use it safely, search_actions looks up REAPER’s action list (main section) by words in the name and reports each action’s ID, named command and on/off state. get_action_state reads one action’s state, and set_action_state switches a toggle action on or off, running it only when its state differs, so calling it twice does not flip it back.

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.

Configuration and IPC

Environment variables

VariableRead byMeaning
REAPER_MCP_DIRserver and bridgeIPC directory. Default: <REAPER resource directory>/reaper-mcp-bridge. Set the same value for both.
REAPER_MCP_CLOSE_DIALOGSserver1 lets the server close REAPER’s blocking windows while it waits (see below). Off by default.

The default REAPER resource directory is ~/.config/REAPER on Linux, %APPDATA%\REAPER on Windows and ~/Library/Application Support/REAPER on macOS. The installers also read the variables listed in Installation.

IPC contract

The server and the bridge exchange files in the IPC directory:

FileWritten byContent
request.jsonserver{"id": "<uuid>", "command": "<name>", "args": {…}}
response.jsonbridge{"id": "<same uuid>", "ok": true, "result": …} or {"id": …, "ok": false, "error": "…"}
heartbeatbridgeUnix time in seconds, rewritten every second
generationbridgeID of the running bridge copy; a newer copy makes the older one stop

Both sides publish files with an atomic rename, so the other side never reads half a file. The server serializes requests and removes a request that timed out.

Timeouts

SituationTimeout
Most commands5 seconds
Slow commands: opening, saving and switching projects, adding FX, run_action and others5 minutes
Rendering30 to 60 minutes depending on the tool; timeout_seconds changes it
HeartbeatA heartbeat older than 5 seconds counts as stale. Before giving up the server waits another 5 seconds, because a long REAPER operation stalls the heartbeat.

Several agents and several REAPER instances

Several MCP clients on one REAPER. Each client starts its own server process; they take turns through a lock file (client.lock) in the IPC directory, so every request gets its own answer. A long command (a render, opening a big project) makes the others wait; waiting for the turn counts against a command’s timeout, and a command that never gets its turn fails with “another MCP client is using this REAPER”. The operating system releases the lock when a server process ends, also when it crashes.

Several REAPER instances on one machine. Give each instance its own IPC directory and point each MCP server at the matching one:

REAPER_MCP_DIR=/tmp/reaper-a reaper -newinst &   # -newinst: do not hand over to the running REAPER
REAPER_MCP_DIR=/tmp/reaper-b reaper -newinst &

and in the MCP client configuration "env": {"REAPER_MCP_DIR": "/tmp/reaper-a"} for one server, /tmp/reaper-b for the other. Two instances must not share an IPC directory: the bridge started later takes over and the earlier one stops answering.

Blocking windows

Some projects make REAPER open a modal window while loading: “Project Load Warning” for project elements this REAPER does not know (old projects, or projects from a newer REAPER), and “Project Settings” for a project that shows its notes on load. Until someone clicks it, REAPER and the bridge stop, and the command times out with “REAPER stopped responding”.

With REAPER_MCP_CLOSE_DIALOGS=1 in the server’s environment, the server closes these two windows itself when a command finds the bridge stopped for more than 5 seconds: OK on the load warning, Cancel on project settings. No other window is touched, and the result of the command lists what was closed in closed_dialogs.

PlatformHow
Windowsposts WM_CLOSE to REAPER’s owned dialogs with exactly these titles
Linux (X11)clicks the button with xdotool, which must be installed; the server must see REAPER’s display (DISPLAY)
macOSnot supported: close the window in REAPER

Security

reaper-mcp-rs gives an AI agent real control over REAPER. Treat connecting it like giving someone your keyboard while REAPER is in front.

What the agent can do

  • Change any open project: tracks, routing, FX, items, automation. Edits run inside undo blocks, so they can be undone, but an agent can make many changes quickly.
  • Open, save, render and close projects, and write files where REAPER can (renders, templates, FX chains).
  • Read files it is given a path to (analyze_audio, insert_media, import_fx_chain).
  • Run any REAPER action with run_action, including actions from extensions and custom scripts you have installed.

What it cannot do

  • Run code it sends: the bridge dispatches a fixed set of handlers and never evaluates Lua from the client.
  • Reach the network: the server talks only to its MCP client over stdio and to the bridge through local files.

Recommendations

  • Back up projects before letting an agent work on them, or work on a copy.
  • Connect the server only to MCP clients and agents you trust, and keep tool approval on in the client for project-changing tools if you are unsure.
  • The IPC directory is a plain local directory: any program running as your user can write requests to it. Do not point REAPER_MCP_DIR at a shared or network location.

Reporting a vulnerability

Please report security problems privately through GitHub security advisories rather than in a public issue.

Troubleshooting

“bridge heartbeat missing” or connected: false

The bridge is not running, or the server and the bridge use different IPC directories.

  1. Start reaper_mcp_bridge.lua from REAPER’s action list, or install it with the startup option (Installation).
  2. Compare ipc_directory in the health result with REAPER’s resource directory (Options > Show REAPER resource path). If you set REAPER_MCP_DIR, set it for both.

“heartbeat is stale”

REAPER is busy (loading a project, rendering, a modal dialog) or its Lua thread is stuck. Wait for the operation to finish and close any open dialog. On Windows, inspect_reaper_windows shows which dialogs are open and whether the main window responds, and restart_bridge loads the bridge again.

“REAPER stopped responding during …”

A modal window in REAPER is waiting for a click, and REAPER does nothing else until it gets one. Opening an old project, or one from a newer REAPER, can show a “Project Load Warning”; a project that shows its notes on load opens “Project Settings”. Close the window in REAPER, or set REAPER_MCP_CLOSE_DIALOGS=1 so that the server closes these windows itself (Configuration). On Windows, inspect_reaper_windows lists any window and close_reaper_fx_windows with its title closes it.

“REAPER command … timed out”

The command took longer than its timeout (Configuration). For renders, pass a larger timeout_seconds. The command may still finish in REAPER; check with a read tool before retrying.

A render writes NAME-001.wav

REAPER never overwrites a file. The render tools delete the files they are about to write first; with overwrite: false, or when an old file is locked, REAPER adds a number. Use set_media_offline to make REAPER let go of a file it plays.

A plugin update does not show

REAPER keeps the old plugin library loaded until it restarts. list_plugins shows the version on disk.

“another MCP client is using this REAPER”

Several clients take turns on one REAPER, and another one held it for longer than this command’s timeout, usually during a render. Retry when it is done, or give each REAPER instance its own REAPER_MCP_DIR (Configuration).

Reporting a bug

Open an issue with the reaper-mcp-rs --version output, your OS, REAPER version, the tool call and its result.

REAPER API coverage

Measured against the ReaScript API reference (734 functions, not counting the EEL2, Lua and Python built-ins); counts are checked by scripts/check-api-coverage.py in CI. The Lua bridge calls 240 of them, about 33%. The function count understates what the tools can do: REAPER exposes most track, item, take, send and project properties through a few generic Get*Info_Value / GetSet*Info_String functions, and run_action reaches any action by its ID. Audio analysis reads rendered WAV files in Rust and needs no API calls at all.

AreaFunctions usedCoveredNot covered yet
Track FX (TrackFX_*)24 / 51add, remove, move, enable, parameters by value, display value or text, presets, pin mappings, FX chains as .RfxChain, FX containers at any depth, parameter modulation (LFO, audio control signal) and parameter linksoffline state, record-input FX, MIDI learn
Take FX (TakeFX_*)24 / 43the FX tools with item: list, add, remove, move, enable, parameters by value, display value or text, presets, pins, FX envelopes, modulation and linksFX chain files and containers on takes, take FX for a take other than the active one
Tracks22 / 64list, create, rename, delete, reorder, folders, fader, pan, mute, solo, phase, master send, channels, templates, color, record arm, record input, monitoring and record mode, automation mode, track groups, selection of tracks and items, project play ratetrack visibility, layouts, track UI state
Sends and receives5 / 15list, create, edit (level, pan, channels, mode, mute, phase), remove; hardware outputs the same waythe send UI functions (the *UI* variants for control surfaces)
Media items and takes29 / 57list, insert media, move by musical time, position, length, offset, gain, take pan, channel mode, source, delete, normalize, split, fades, play rate and pitch, takes and the active take, take FX (see Take FX)item lanes, item locks
MIDI22 / 75create MIDI items; list, add, change and delete notes; CC with shapes, pitch bend, program change, channel pressure, poly aftertouch, text, lyric and sysex events; quantize and humanize; list MIDI inputsMIDI editor actions, note names and lyrics tracks
Envelopes19 / 40volume, pan and FX parameter envelopes on tracks: list, write points, activate, delete; take envelopes (Volume, Pan, Mute, Pitch); take FX parameter envelopes; automation itemsenvelope point editing by index
Markers, regions, tempo26 / 69markers and regions with colors, edit and delete single markers, go to a marker or region, last marker and current region at a time, tempo map with time signature changes, grid, bar and beat conversion, take markers, stretch markers, region render matrixmarker actions such as next and previous marker
Project, transport, undo31 / 72open, save, project tabs, sample rate, length, project notes, title and author, undo blocks around edits, transport (play, stop, pause, record, repeat), edit cursor, time selection and loop, undo and redo
Render and audio5 / 28render settings, project, stems, variants and regions (master mix or the region render matrix), loudness normalization; analysis of WAV files in Rust; items and tracks read through audio accessors and analysed without renderingpeak files, PCM sources and sinks
Actions5 / 16run_action by command ID or named command; search the action list, read and set toggle statessections other than the main one, shortcuts
ExtState and config9 / 12resource path, version, ExtState and project ExtStateconfig variables
Control surfaces (CSurf_*)1 / 52starting a recording (CSurf_OnRecord)not planned: an MCP client is not a control surface
UI, themes, docking, other18 / 140refresh after edits; window inspection on Windows (without the API)mostly out of scope for an MCP server

Extension APIs such as SWS, js_ReaScriptAPI and ReaImGui are not used. The order in which the gaps get closed is in the roadmap.

Roadmap

Last updated: 2026-11-30. A living document: it explains the order of work, and GitHub issues track the details. The gaps listed here come from REAPER API coverage.

Goal

reaper-mcp-rs lets an AI agent work on a real REAPER project the way an engineer does: arrange, edit, route, mix, automate, render and check the result. Each version below closes the gaps that most often send an agent to run_action or back to the human.

Non-goals

  • Running Lua sent by the client. The bridge dispatches a fixed set of handlers, and it stays that way.
  • Control surfaces (CSurf_*). An MCP client is not a control surface.
  • REAPER’s UI, themes and docking. The server changes projects, not the screen layout.
  • Extensions as a requirement. SWS, js_ReaScriptAPI or ReaImGui may be used when present, but every tool must work without them.

Released

  • 0.1 (2026-11-26): CI on Linux, macOS and Windows, releases from release pull requests, one-line installers, the documentation site with a generated tool reference, bridge tests against a fake ReaScript API.
  • 0.2 (2026-11-30): everyday editing (transport, cursor, time selection, undo, splits, fades, takes, stretch and take markers, track color and recording, single markers, time signatures), MIDI editing, take envelopes and automation items, automation modes, track groups and selection, hardware outputs, region rendering, FX containers, parameter modulation and links (#16–#25); end-to-end runs on a realistic project and on Cockos sample projects (#36).

How a feature is done

Every item below has an issue. It is done when its tests were written first against the fake ReaScript API, and a scenario in scripts/e2e/ exercises it against a real REAPER with checks on the values it returns (scripts/e2e-reaper.sh passes on a freshly extracted copy), and the reference, the tools guide and the API coverage tables are updated.

0.3: every tool tested on a real REAPER

Every tool now runs against a real REAPER except the three Windows-only ones; this version also closes the platforms that have never run end to end.

  • Every tool runs against a real REAPER, and CI fails when a tool is not covered (#49).
  • The end-to-end scenarios on Windows, the main platform: the Windows-only tools and the PowerShell installers (#48).
  • Opening some projects blocks REAPER with a modal window: the server can close it (#37).
  • A project built from real multitrack stems, downloaded by hand (#50).
  • Several MCP clients per IPC directory and several REAPER instances (#51).

0.4: take FX and deeper editing

  • Take FX through the same tools as track FX: one code path with a target of track or take (#52).
  • Analyze an item or a track without rendering, through audio accessors and peaks (#53).
  • Project notes and ExtState, so that an agent can leave notes in the project (#54).
  • Nested FX containers (#55).
  • Humanize MIDI (#56).
  • Marker navigation and action discovery (search actions, toggle state) (#57).

Later

  • The plugin version REAPER has actually loaded, not only the one on disk (#58).
  • Track visibility, heights and layouts.
  • A self-test that runs the project-changing tools in a throwaway project tab and closes it.

Changelog

All notable changes to reaper-mcp-rs. Generated by git-cliff from Conventional Commits.

[0.3.0] - 2026-12-04

Bug Fixes

  • (deps) Ignore the chrono advisory that only rmcp brings, replace the yanked sha2 (#47)
  • List_fx_presets names the presets; every tool runs against a real REAPER (#61)

Features

  • Several MCP clients take turns on one REAPER; several REAPER instances (#62)
  • Take FX through the same tools as track FX (#63)
  • Optionally close REAPER’s blocking windows (REAPER_MCP_CLOSE_DIALOGS) (#64)
  • Analyze an item or a track without rendering (#65)
  • Project notes, title, author and ExtState (#66)
  • Nested FX containers and moving an FX out of a container (#67)
  • Humanize MIDI notes with a seed (#68)
  • Marker navigation and action discovery (#69)

[0.2.0] - 2026-11-30

Bug Fixes

  • (ci) An assert pattern needs a word boundary (#12)
  • Save_project reports the copy, clean error messages, e2e script for real REAPER (#13)
  • Say when REAPER is blocked by a dialog, report the play rate; end-to-end on realistic projects (#38)

Features

  • Transport, edit cursor, time selection and loop, undo and redo (#26)
  • Split items, fades, play rate and pitch, takes, stretch and take markers (#27)
  • Track color, record arm, record input, monitoring and record mode (#28)
  • Edit and delete single markers, read the tempo map with time signatures (#29)
  • MIDI editing: change and delete notes, CC and other events, text and sysex, quantize (#30)
  • Take envelopes, automation items, deleting an envelope (#31)
  • Track automation mode, global override, track groups, selection (#32)
  • Hardware outputs (#33)
  • Region render matrix and rendering by regions (#34)
  • FX containers, parameter modulation and parameter links (#35)

[0.1.0] - 2026-11-26

Features

  • Initial public release
  • Releases, installers and documentation site (#2)

Development

Layout

PathWhat
src/main.rsBinary: flags, then the MCP server on stdio.
src/server/The MCP tools (mod.rs). Most forward their arguments to a Lua handler; the larger bodies are in handlers.rs.
src/args/Tool arguments; their doc comments become the JSON schema descriptions.
src/bridge.rsFile-based IPC client for the Lua bridge.
src/track_templates.rsTrack template and FX chain manipulation on REAPER state chunks.
src/audio.rsWAV reading, loudness (BS.1770), spectrum and comparison.
src/reaper_host.rsWindows-only helpers that work without the bridge.
lua/reaper_mcp_bridge.luaThe loop inside REAPER: reads requests, runs handlers, writes responses and the heartbeat.
lua/reaper_mcp_handlers.lua, lua/handlers/One handler per command, grouped by area (project, tracks, items, fx, envelopes, render); shared helpers in support.lua. Reloadable with reload_bridge.
tests/lua/fake_reaper.luaIn-memory fake of the ReaScript API for tests.
docs/This book (mdBook).

Build and check

cargo build
cargo fmt --all
cargo clippy --all-targets -- -D warnings
cargo test --all-targets

CI runs the same on Linux, macOS and Windows, plus a Lua syntax check and ShellCheck. A pull request can be merged only when CI passes.

Tests

  • Unit tests next to the code: state chunk edits, argument schemas, JSON rounding.
  • tests/bridge_*.rs (bridge_ipc, bridge_tracks, bridge_items, bridge_fx, bridge_project; shared harness in tests/common/) run the real bridge and handlers in a Lua 5.4 interpreter against tests/lua/fake_reaper.lua, and talks to them through BridgeClient, the IPC the server uses. Install lua5.4 (or a lua that is 5.4) to run them; without one they are skipped locally, and CI requires them (REAPER_MCP_REQUIRE_LUA=1). The fake raises an error naming any ReaScript function it does not implement, so extend it when a test needs more.
  • tests/audio_analysis.rs and tests/audio_signals.rs check the analysis against generated signals with known levels; tests/track_templates_chunks.rs covers the FX chain chunk editing.
  • Consistency checks in src/server/mod_test.rs: every tool has a unique name, a description and an object schema; every command the server sends has a Lua handler; docs/src/reference.md matches the tool definitions.

Adding a tool

  1. Add the arguments to the matching file in src/args/ with a doc comment on every field.
  2. Add the tool to src/server/mod.rs with a description that says what it changes and what it returns.
  3. Add the handler to the matching file in lua/handlers/ as handlers.<name> = function(args). Validate arguments first, then change the project inside undo("…", function() … end).
  4. Add a test in the matching tests/bridge_*.rs and the ReaScript functions it needs to the fake.
  5. Regenerate the reference: REAPER_MCP_UPDATE_DOCS=1 cargo test.
  6. If the bridge calls new ReaScript functions, update the counts and the text in the REAPER API coverage table and its copy in README.md; python3 scripts/check-api-coverage.py prints the counts and fails in CI while they differ. Update the roadmap when a gap closes.

To try a handler change in a running REAPER without restarting it, copy the Lua files with the install script and call reload_bridge.

Documentation

cargo install mdbook
mdbook serve docs

The book is published to GitHub Pages when docs/ changes on main.

Pull request titles

Pull requests are merged with Squash and merge: the title becomes the commit message on main, so it must be a Conventional Commit. feat: and fix: appear in the changelog and choose the next version; docs:, test:, refactor:, ci: and chore: do not. See Releases.

End-to-end with real REAPER

The bridge tests use a fake ReaScript API. To check the tools against a real REAPER on Linux:

mkdir -p ~/opt/reaper-test && tar -xJf reaper*_linux_x86_64.tar.xz -C ~/opt/reaper-test
touch ~/opt/reaper-test/reaper_linux_x86_64/REAPER/reaper.ini   # portable: leaves ~/.config/REAPER alone
scripts/e2e-reaper.sh [--samples] ~/opt/reaper-test/reaper_linux_x86_64/REAPER

The script builds the server, installs the bridge from the checkout into that REAPER, starts it with an empty project on its own virtual X display (Xvnc or Xvfb) and runs the scenarios over MCP:

  • scripts/e2e/scenario.py tries the tools one area at a time on a few tracks.
  • scripts/e2e/project_scenario.py builds a realistic 17-track project the way an agent would: audio from make_audio.py (drums, bass, guitars and a vocal-like part, generated, so nothing is stored in the repository), folders under a MIX BUS, reverb and delay returns fed by sends, a ReaSynth part, song sections as regions. It then checks the structure, normalizes, renders the mix, group stems, variants and sections, compares the mix with a reference, exports and applies mix templates and FX chains, and saves and reopens the project.
  • scripts/e2e/tools_scenario.py covers the tools the others do not reach: FX parameters, choices, presets, pins and envelopes, sends, a multi-output instrument (ReaSynDr), item and track moves, media offline, project settings, actions and reloading the bridge.
  • scripts/e2e/dialogs_scenario.py writes two small projects that make REAPER open “Project Settings” (notes shown on load) and “Project Load Warning” (unknown token), opens each with and without REAPER_MCP_CLOSE_DIALOGS=1, and checks closed_dialogs, the timeout hint, show_on_load and the notes’ line ends. No download needed. Only scripts/e2e-reaper.ps1 runs it so far; on Linux the same dialogs are exercised by --samples.
  • scripts/e2e/multi_scenario.py starts a second REAPER (-newinst) on its own IPC directory, checks that each server reaches only its own instance, and runs two server processes on one REAPER at once.
  • With --samples, scripts/e2e/samples_scenario.py opens eight of the old sample projects Cockos publishes (recorded audio, REAPER 0.x to 2.x), reads every track with the read-only tools, checks the track and item counts against the .rpp files, renders and analyses each mix. The projects are downloaded once into ~/.cache/reaper-mcp-e2e/samples; they are copyrighted by their authors and never stored in this repository.

Some projects make REAPER open a modal window while loading (“Project Load Warning” for unknown project tokens, “Project Settings” for a project that shows its notes on load). The samples scenario runs the server with REAPER_MCP_CLOSE_DIALOGS=1 and checks that it closed them, so --samples needs xdotool. Each check prints one line, and the run fails when a value is wrong. It uses only REAPER’s bundled plugins and works in evaluation mode. Run it before a release and after changing a handler; extend a scenario when a tool changes.

On Windows

Copy-Item 'C:\Program Files\REAPER (x64)' C:\opt\reaper-test -Recurse
New-Item C:\opt\reaper-test\reaper.ini -ItemType File     # portable: leaves %APPDATA%\REAPER alone
scripts\e2e-reaper.ps1 [-Samples] [-KeepWork] -ReaperDir C:\opt\reaper-test

The script does the same on Windows: it builds the server, installs the bridge into the copy (install-bridge.ps1 -Startup), starts REAPER and runs the same scenarios. Needs cargo and Python 3 (python, python3 or py -3). Things it handles that a hand-made run trips over:

  • REAPER is started with -newinst -cfgfile <dir>\reaper.ini. Without -newinst a running REAPER takes over the command line (a new tab in your session); without -cfgfile a copy made by the installer falls back to %APPDATA%\REAPER and loads the bridge installed there.
  • A fresh profile opens first-run dialogs (audio device, new version, About). The script answers them with “No” (or closes them) and waits for the plug-in scan to finish; closing the scan window makes add_fx fail.
  • The work directory is %TEMP%\reaper-mcp-e2e <non-ASCII> <id>, so paths with spaces and non-ASCII characters are exercised on every run.
  • The REAPER it started is closed through its window (a “Save changes?” prompt gets “No”) and never killed; if it stays open the script says so.
  • tools_scenario.py opens a track FX window, checks inspect_reaper_windows, closes it with close_reaper_fx_windows, and runs restart_bridge when it is the only REAPER process and a bridge is installed in %APPDATA%\REAPER (the tool always restarts the first REAPER it finds and loads that install, so otherwise the step is skipped, and when it runs it writes its startup wrapper there).
  • -Samples runs the Cockos sample projects with REAPER_MCP_CLOSE_DIALOGS=1 (no xdotool needed); the zips are cached in %LOCALAPPDATA%\reaper-mcp-e2e\samples.

Every tool must run in a scenario: python3 scripts/check-e2e-coverage.py (in CI) fails when a tool is neither called by a scenario nor listed in that script with the reason it cannot be run (today none). A new tool therefore comes with its scenario steps.

Releases

Versions follow SemVer. While the version is 0.x, a minor version can change tool arguments.

How a release is made

main is protected, so a release goes through a pull request like any other change:

  1. After every merge to main, .github/workflows/release-pr.yml runs scripts/release-pr.sh. It picks the next version from the commits since the last tag (one per squash-merged pull request, titled as a Conventional Commit: feat: bumps the minor version, fix: and perf: the patch version, ! or BREAKING CHANGE the major version), sets it in Cargo.toml and Cargo.lock, adds the new section to CHANGELOG.md with git-cliff, and keeps the pull request chore(release): vX.Y.Z open with the release notes. Nothing is written by hand; the decision to publish is merging that pull request.

  2. When the pull request is merged, .github/workflows/release.yml builds the archives for Linux (x86_64, aarch64), macOS (Apple silicon, Intel) and Windows (x86_64), writes SHA256SUMS, and publishes the GitHub release vX.Y.Z with the notes from the changelog.

A failed release can be retried with Actions > Release > Run workflow: it releases the version in Cargo.toml if that tag does not exist yet.

What a release contains

Each archive holds the server binary, the Lua bridge (lua/), the install scripts (scripts/), README.md, CHANGELOG.md and LICENSE. The one-line installers download the archive for the platform and check it against SHA256SUMS.