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:
x = hit, . = rest.
Spaces are ignored, so you can group beats: "x... x... x... x..."C4 /
F#3 / Bb2 plays it, . = rest, - = hold (tie).
Stack notes with + for a chord: C4+E4+G4.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).