ReaSock
Latest Version: 0.4.0
- Protocol 0.5.0: actions can have an on/off state. Register with
toggle: trueand set it withaction.setState; REAPER shows it as a checkmark in menus and a lit toolbar button. In@techaudio/reasock,registerAction(…, { toggle: true })andsetActionState(), restored after a reconnect. takes.setcan point a take at a moved or renamed file (path), keeping its offset, rate, and length, as an undo point.items.insertcan place files at the play position (position: "play").- Fixed:
items.inserthanded new sources to takes throughSetMediaItemTake_Source, which REAPER asks extensions not to use, since it may duplicate the source. - The MCP example can place media files (
reaper_insert_media).
ReaSock is a REAPER extension that opens a local WebSocket speaking JSON-RPC 2.0. Any program on the same machine can connect to it, in any language, without writing a REAPER extension of its own:
- Lend actions to REAPER. Register entries in REAPER’s action list. Users bind them to keys, menus, and toolbars like any other action, the bindings survive restarts, and your program is called with the selected items when they run.
- Follow along. Subscribe to transport, project, and selection changes and get notified as they happen, including live while an item is dragged. Notifications stay small however large the session is.
- Ask about the project. Read tracks, items, takes, and markers, paged and addressed by GUIDs that stay stable across sessions.
Scripts inside REAPER can use the same protocol through reaper.ReaSock_Open,
ReaSock_Call, and ReaSock_Poll.
Connecting
Each running REAPER writes ~/.reasock/instances/<pid>.json with the port it
listens on. Connect a WebSocket to ws://127.0.0.1:<port>, then start with
initialize:
{"jsonrpc": "2.0", "id": 1, "method": "initialize",
"params": {"protocolVersion": "0.2.0", "client": {"name": "myapp"}}}
The full API reference ships with the extension: run ReaSock: Open API documentation from REAPER’s Actions list.
Installing
- In REAPER, open Extensions → ReaPack → Import repositories…
- Paste
https://github.com/TeamAudio/reascripts/raw/main/index.xml - Find ReaSock in the package browser, install it, and restart REAPER.
Builds for Windows, macOS (Apple Silicon and Intel), and Linux (x86-64 and ARM) are also attached to the GitHub releases.