Compose music in code.
Carmen is an open-source programming language for music composition. Write and transform musical phrases, combine them into scores, and export notation or MIDI.

Carmen examples
Read the code behind each score and listen to the result.
let theme = [
1/8 [d4, f4, g4, a4], 1/2 c5,
1/4 bb4, 1/8 [a4, g4], 1/2 f4,
];
let answer = theme |> transpose(7);


Rhythm Study
Change the rhythm while the lower pulse stays steady.

Pitch Study
Hear two pitch sets against the same pulse.

Interference
Compare two takes of overlapping subdivisions.
Install Carmen
Use Cargo to install the Carmen 0.4.1 command-line tool. If you need Cargo, install Rust first.
Run your first Carmen programcargo install carmen-lang --version 0.4.1 --lockedRun carmen --version to confirm the install. Then download the example score and run carmen phrase-fifth.carmen from the folder where you saved it.
macOS development preview
Carmen Studio
A Mac app for working with Carmen scores. Edit source beside the notation or piano roll, compare takes, and export individual parts.
About Carmen Studio
Check Carmen code from an AI client
A compatible AI client can use Carmen’s MCP server to look up functions, validate a draft, and identify which bars changed.
Set up Carmen MCPExample request
Change the flute rhythm in bars 5–6 of Countercurrent. Keep the pitches and the cello part as written.
compare_scores Written comparison- Flute
- Rhythm changed in bars 5–6
- Cello
- No written changes