earmuff is a language for composing music as source code — so you get git, diffs, review, and scripting for free. Compile to MIDI, play it live, or engrave real sheet music.
project "demo" { bpm 96; time 4 4; track "piano" instrument "piano" { let changes = [Cmaj7, Am7, Dm7, G7]; for ch in changes { bar quarter { ch ch ch ch } } } track "lead" instrument "violin" { bar quarter { E5 G5 B5 (E5 + octave) } } }
Everything you'd want from a real toolchain — because earmuff source is just text.
A step grid for rhythm, named notes and chords (C#, Am7), and an escape hatch for exact timing.
Reusable patterns, for loops over chord progressions, conditionals — all resolved at compile time, so it's deterministic.
Notes and chords alongside control change, pitch bend, aftertouch, program change, and sysex.
Engrave a real score to PDF or SVG via LilyPond — from the exact same source.
Play straight to a synth, or write a Standard MIDI File for any DAW.
A VS Code extension with diagnostics, autocomplete, and a live score preview that updates as you type.
earmuff parses and analyzes your piece, expands it into a precise event stream, then renders it however you need.
Free and open source. Written in Go.