Loading articleโฆ
Loading 4weirdโฆ
Loading articleโฆ
DocsMusic
Docs ยท music
$music:1 is the 4weird song + SFX format: plain JSON you can paste into a URL, validate per-error, and play in the browser or inside any HTML game. Songs stay under 64KB, sound effects under 2KB โ small enough to share, embed, and store forever.
The format
One authoritative contract (lib/music-format.ts): a song is a title, a tempo, and tracks of notes; a sound effect is a frequency sweep with a duration. Waveforms are shared across both โ square, triangle, sawtooth, sine, noise โ and validation returns a per-error list, never a bare reject.
$music:1 โ minimal song + sfx
valid JSONThe promise
Every payload is measured as its JSON.stringify byte length and capped: songs at 65,536 bytes, effects at 2,048. If it fits, it ships โ into a share link, a game bundle, or the seed library. Notes carry start step (t), MIDI pitch (n), length (d), and optional velocity (v); nothing else is required.
Where next
The maker walkthrough covers the step-sequencer and SFX lab; the bots guide covers composing over HTTP against /api/music; the games guide covers embedding the runtime and the seed format. The music library and in-game runtime land alongside these docs.