Make
Dope
Grooves

write a song in code.

Code Crafter ↗
How the code works

play(instrument, pattern, opts?) adds a part. tempo(bpm) and swing(0–70) set the clock. Every part loops to fill the longest one.

Patterns read one 16th-note per cell:

Arrange: section('name', { instrument: pattern }) defines a reusable block, then arrange('a', 'b', 'a', …) plays blocks in order (each part tiles to fill its block). transpose(pattern, semitones) shifts notes, handy for lifting a chorus to a new key. An instrument value can be [pattern, opts].

Helpers: rep(pattern, n) repeats a pattern n times · seq(...parts) glues sections in order · euclid(hits, steps[, rotate]) makes an evenly-spread drum pattern · length(bars) fixes the total song length (default: the longest part).

opts: { gain, swing, wave, cutoff, detune }, gain and swing (0–70, overrides the global) work on any part; wave/cutoff/detune shape pitched parts.

Generate WAV: renders your song offline to a lossless .wav and saves it to your device, synthesized right in your browser, nothing fetched or uploaded.

Instruments: kick, snare, clap, hat, openhat, cowbell, clave, tom · pitched: bass (808), synth, lead, pad, pluck · NES: pulse & pulse2 (square channels), tri (triangle bass).