All projectsLet’s talk about your project 
Just for fun
Boombox
A small music machine that uses no audio files. The browser makes every sound.

Loading the demo…
What it is
A five-track sequencer, with presets and a “Surprise me” button that invents a new pattern.
How it’s built
Notes are timed on the browser’s audio clock, which is far more precise than a web page timer. I like the music that comes out of it.
Try this
Press Play, then “Surprise me”. Turn your volume down first.
At a glance
- No audio files
- Five tracks of sixteen steps
- Sound only starts when you click
For the curious: built with
- TypeScript
- Web Audio API
- Canvas
Under the hood
The problem
Making music without a single audio file.
How I solved it
- The browser makes every sound. The kick drum, for example, is a wave whose pitch drops from 165 to 42 Hz in 0.13 seconds; the snare and hi-hat are filtered noise.
- A web page timer can drift by a few milliseconds, and you can hear that in a rhythm. I only use it to prepare the notes 0.1 second ahead, then the audio clock plays them.
- The animation reads the same list of notes as the sound, which keeps the two in sync.
The catch
When you switch tabs, playback pauses, then picks up in time when you come back.
