Back to Projects
Motif music language project card

Motif

A tiny music language that turns code into MIDI

About

Motif is a TypeScript-based music language engine that compiles simple .music files into playable timelines and downloadable MIDI files. It uses a layered compiler pipeline — tokenizer, parser, AST, musical IR, timeline events, and MIDI export — with a web playground for writing, previewing, playing, and downloading musical ideas.

Highlights

  • Custom .music language with notes, rests, chords, grouped notes, patterns, and repeats
  • Layered compiler pipeline from source text to AST, musical IR, timeline events, and MIDI output
  • Interactive web playground with source editing, examples, piano-roll preview, browser playback, and MIDI download

Tech Stack

TypeScriptReactViteTone.jsMIDI