From DAW to CLI: Building a Bridge Between REAPER and Code
From DAW to CLI: Building a Bridge Between REAPER and Code
REAPER is the best DAW I've ever used. It's also a completely closed ecosystem unless you know where to look. The scripting API exists, the remote control surface protocol exists, but nobody has built the thing that connects them to a modern developer workflow - corpus management, search, deterministic execution, bounded plan runs.
I built it. The project is Reaper CLI.
Phase 1: Corpus Ingestion
The first problem was simple and annoying: REAPER projects accumulate fast, and there's no way to search them. Hundreds of sessions across years of work, and the only "search" available is Finder.
Phase 1.1 was corpus ingestion. Every REAPER project file gets parsed and exported to NDJSON - one JSON object per line, one file per project or track. The schema captures the things I actually care about: track names, plug-in chains, routing, markers, regions, and the project metadata.
NDJSON over a big JSON blob because I needed to be able to stream and filter it. You don't want to load 800 project files into memory to find the ones with a specific drum kit in the chain.
The SQLite layer sits on top. The NDJSON gets indexed into a SQLite database with a normalized schema. Searching across 800 projects takes milliseconds. Finding every session that uses a specific reverb plug-in takes one query.
Phase 1.2: What I Learned
The ingestion work taught me things about my own project library I didn't know.
Deduplication - REAPER has a backup and autosave system. I had significant duplication: the same project in three or four slightly different states. Without dedupe, the corpus was full of noise. I built a dedupe pass that identifies projects by canonical content hash rather than filename.
Section inference - REAPER doesn't have a concept of "song sections" at the file level. But markers and regions encode that information implicitly. I built an inference pass that reads the marker and region timeline and assigns semantic section labels: intro, verse, chorus, bridge, outro. The labels aren't perfect, but they're good enough to query against.
Trigger extraction - This was the most interesting part. I wanted to be able to ask "which projects use this chord progression?" or "which sessions have a drum fill at the 16-bar mark?" That requires extracting musical triggers from the project file - MIDI events, automation breakpoints, pattern markers. This is still partial; the full trigger index is Phase 2 work.
The Live Bridge
The search index is useful for historical work. The live bridge is useful for active sessions.
REAPER exposes a remote control surface API over TCP. It's designed for hardware controllers, but it's also a programmable interface. The live bridge connects to a running REAPER instance and lets me control it from the command line - or from an agent.
Why does that matter? Because I can now write scripts that:
- Read the current transport position
- Navigate to a specific marker by name
- Query what's in the current region
- Execute a REAPER action by ID
- Poll for events and trigger responses
Combined with SMALL Protocol, this means I can write bounded plan execution against a live REAPER session. The plan declares what the agent is allowed to do (advance transport, mute a track, read a marker, write a file). The bridge executes it. The progress layer records each step.
Current State and What's Next
Phase 1 is done: corpus ingestion, NDJSON export, SQLite indexing, deduplication, section inference. The live bridge is working against a local REAPER instance.
Phase 2 is about trigger extraction and pattern matching - the musical intelligence layer. This is where the project gets interesting. The goal is a search interface that understands musical structure, not just file metadata.
Phase 3 is agent-side composition assistance. An agent that can read the current session, understand its structure, and make bounded suggestions - without ever touching the project unsupervised.
The DAW-to-CLI gap is real, and closing it turns REAPER from a production tool into a programmable instrument.
