CLI and coding agents

synkopa is a command you type in a terminal to read, edit and render a Synkopa project. Use it to script repetitive edits, render variations without opening the app, or let a coding agent work on your song. You never need it to make music: everything it does is also in the app.

Talk to the running app

By default the command edits the song open in Synkopa. You watch each change appear, and each command is one undo step, so Ctrl + Z in the app takes it back. Nothing is saved until you save.

  1. Start Synkopa once. It installs the synkopa command for you.
  2. Open a new terminal (one that was already open does not see the command yet) and run synkopa status.It prints the transport state, the project's file and the audio device.
  3. Run synkopa context --pretty.You get a map of the song: tracks, mixer inserts, patterns and channels, each with the number (ID) other commands use.
  4. Run synkopa bpm 128.The tempo in the toolbar changes to 128.
  5. Run synkopa undo, or press Ctrl + Z in the app.The tempo goes back.
synkopa status
synkopa context --pretty
synkopa bpm 128
synkopa undo

If it does not work

  • The terminal does not know synkopa: open File → Settings… → Audio and scroll to Command line. It says whether the command is in your PATH, the list of folders your terminal searches for commands.
  • It says Synkopa is not running: start the app and try again.
  • Several Synkopa windows are open: run synkopa sessions and add --session with the ID of the one you mean.

For scripts: the result is printed as JSON (structured text programs can read), and messages go to the error stream. Add --pretty to make it readable. Run synkopa help for every command.

Render a project without the app

With -p and a file name, the command works on a project file directly. The app does not need to be running and no audio device is used. This is useful for rendering variations in a batch.

  1. In an empty folder, create a project from the demo song: synkopa new walkthrough.synkopa --template demo.
  2. Render it to a WAV file: synkopa -p walkthrough.synkopa render --out walkthrough.wav.The result lists the peak and loudness of the file and whether it clipped.
  3. Make a faster copy without touching the original: synkopa -p walkthrough.synkopa bpm 144 --save-as faster.synkopa.
  4. Render the copy and listen to both files.
synkopa new walkthrough.synkopa --template demo
synkopa -p walkthrough.synkopa render --out walkthrough.wav
synkopa -p walkthrough.synkopa bpm 144 --save-as faster.synkopa
synkopa -p faster.synkopa render --out faster.wav

An edit with -p saves the file right away; there is no undo. Add --save-as to write a copy, or --dry-run to save nothing. Synkopa refuses to edit a file the app has open, because the app would overwrite the change on its next save.

If the render reports missing audio, relink it in the app or work from a project ZIP.

Let a coding agent edit your song

A coding agent can run synkopa like you do: read the song, make an edit, render it and check the levels. Every edit lands in your undo history, so you stay in control.

  1. Open the song in Synkopa and save it.
  2. Start the agent in any folder and tell it to run synkopa context --pretty first, to find the right pattern and channel.
  3. Give it one small, clear task, for example: “make the hi-hats in pattern 2 less repetitive”.
  4. Ask it to render a preview and report peaks or clipping: synkopa render --out preview.wav.
  5. Listen in the app. Keep the change with Ctrl + S, or take it back with Ctrl + Z.

Tips for the agent: synkopa catalog lists every effect with its parameters and ranges, and synkopa schema lists the edits apply --file accepts as one all-or-nothing step. Every edit raises the project's revision number; with --if-revision an edit is refused with REVISION_CONFLICT if you changed the song in the meantime, and the agent should read it again.

Connect it as tools

Most agent apps can also call Synkopa directly, through MCP (Model Context Protocol, the common way to give an agent tools). The agent then sees four tools: read the project, run a command, apply several edits as one undo step, and run a list of commands. There is nothing more to install.

  1. In a terminal, add Synkopa to your agent. For Claude Code: claude mcp add --scope user synkopa -- synkopa mcp. For Codex: codex mcp add synkopa -- synkopa mcp. In Cursor or VS Code, add a server with the command synkopa and the argument mcp.
  2. Start the agent again and ask it to read your Synkopa project.It calls synkopa_context and describes the song open in the app.
claude mcp add --scope user synkopa -- synkopa mcp

The complete CLI reference covers notes, chords, stems, vocals, mixing, MIDI and exit codes.

Live-code a beat from a text file

Write the song as a text file, one command per line. Each time you save the file, Synkopa applies it to the loop that is playing, so you hear the change at once.

  1. Start a loop playing in the app.
  2. Find the pattern ID and channel names with synkopa context, and save a file such as song.txt with your commands.
  3. Run synkopa watch song.txt in a terminal.
  4. Change a step or the tempo in your editor and save.The loop changes. Each save is one undo step.
  5. Press Ctrl + C in the terminal to stop watching.
# song.txt (replace 1 with the pattern ID you found)
bpm 128
pattern --id 1 --ch hat --steps "x.x. x.x. x.x5 x.x9"

In a step string each character is one sixteenth note: x is a full hit, 1–9 a softer one (10–90 %), and . a rest. Spaces only help reading.

Every save applies the file to the song as it was when watch started, so deleting a line removes its change. If you edit the song in the app meanwhile, restart watch. To run a file once instead, use synkopa script song.txt.