ReaSock

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

  1. In REAPER, open Extensions → ReaPack → Import repositories…
  2. Paste https://github.com/TeamAudio/reascripts/raw/main/index.xml
  3. 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.