I wanted to drive Bitwig programmatically — and, specifically, to let an AI agent actually make music in it — so I built bitwig-bridge.
The problem: Bitwig's only real programmatic doorway is the Control Surface API, and that runs inside Bitwig. There's no external socket to poke. So the bridge wires one up.
How it works — three small pieces:
script / agent ──HTTP──▶ bitwigd ──virtual MIDI (SysEx RPC)──▶ AgentBridge ──▶ Bitwig Control API
- a Bitwig controller script (AgentBridge.control.js) that receives SysEx RPC frames and dispatches them to the Control Surface API,
- bitwigd, a small Node daemon that opens the virtual MIDI ports, speaks the protocol, and exposes a local HTTP + WebSocket API,
- an MCP server so agents (I use it with opencode) get bitwig_* tools.
The protocol is JSON over SysEx (F0 7D <json> F7) — 7-bit clean, and it handles non-ASCII track/clip names.
What you can do today (host API v17, Bitwig 4.4.10): transport (play/stop/record/loop/tempo/position), list and set tracks (name, mute, solo, arm, volume, pan), launch scenes, browse a device's remote-control pages and set parameters, create/launch/write notes into a cursor clip, list drum-machine pads, and app undo/redo/duplicate. It's built to grow command by command.
The Linux gotcha, if you're on Linux: Bitwig only opens ALSA rawmidi devices (/dev/snd/midi*), not the ALSA sequencer — so RtMidi "virtual ports" are invisible to it. You need snd-virmidi to create a dummy rawmidi device Bitwig can see, and you should pin its card index (options snd-virmidi index=10 midi_devs=1) so the port name stays stable across reboots (otherwise your interface shifting the index silently breaks Bitwig's stored port assignment). All of that's in the README.
It's early and additive, but it's already genuinely fun to have an agent play/stop, mute tracks, launch scenes and draw notes while you watch.
Repo: https://github.com/CurePortal/bitwig-bridge
If you try it: issues and PRs welcome — adding a command is one case in dispatch() plus (optionally) a tool. I'd love to hear what else people want exposed.