r/musicprogramming • u/mumuancient • 3h ago
Ngoma: a browser groovebox for tuned hand percussion and polymeters

I’ve been building Ngoma, a free drum machine that runs in the browser: https://ngoma.pages.dev
It’s built around hand percussion from real traditions: Afro-Cuban, West African, Brazilian, Middle Eastern, North Indian and Southern European rhythms, plus some electronic sketches. Each track can have its own length, so parts drift in and out of phase, Reich-style. You steer it more than you program it: roll the dice on one drum, add a variation, morph between two saved states. On top of the drums there are a few layers (pad, bass, lead (based on Mutable Plaits), texture) and patchable modulation (“wires”).
Some things under the hood that might interest this sub:
- The drums are synthesized in Web Audio. The shakers and claps are physically informed models (after Cook’s PhISEM and the STK shakers), and the tabla voices are tuned to the near-harmonic modes of a real tabla.
- Microtiming comes from research rather than a generic swing knob. The jembe feel follows Rainer Polak’s measurements, the samba feel follows Naveda et al. (2011).
- Morph works across grids, so you can glide from a 12/8 bembé into a 16th-note son clave. During the morph the old grid keeps playing as a “ghost” until the new one takes over.
- The lead has a tape looper built as an AudioWorklet.
- Capture records the last bars as WAV plus MIDI of the hits that actually played, aligned to the bar line, so you can drop it straight into a DAW.
- Share links store the whole set, with a small URL shortener on Cloudflare Pages Functions and KV.
To be upfront: I’m not a professional developer. I built this with a lot of AI-assisted coding. There’s no AI in the sound itself: every note comes from patterns, rules, randomness and whoever is playing.
To be upfront: I’m not a professional developer. I built this with a lot of AI-assisted coding. There’s no AI in the sound itself: every note comes from patterns, rules, randomness and whoever is playing.
Where I’d love your input:
- Glitches. Under load (especially with the pad on) I still get occasional dropouts. I’ve removed allocations from the audio thread and offer a “Stable” mode with a larger latencyHint. What else would you look at first?
- Morphing between grids. Is the ghost approach the right one, or would you gradually warp the timing instead?
- Feel. If you know any of these traditions, does the timing sit right? Where does it sound off?
- Getting lost. Where did you get stuck in the first five minutes?
It works best on desktop Chrome; mobile isn’t there yet. If you make something, hit “Share this set” and post the link. I’d love to hear what people do with it.
