beat lab / sampler
SYNTHESIS DRUM MACHINE

Hit the
grid.

Sixteen pads. Every sound synthesized in real time — oscillators, noise, filters, envelopes. No samples loaded. No network requests. Pure Web Audio API.

Velocity-sensitive. Touch pressure maps to loudness. On mouse, tap lower on the pad for harder hits, higher for softer. The waveform above traces the master bus in real time — seeing and hearing are the same act.

Sequencer underneath. Eight steps, per-pad Euclidean fill (E(k,8)), lookahead scheduling against AudioContext clock — not setInterval. The synth engine that fires from pads is the exact engine the sequencer drives.

SYNTHESIS
KICK

Sine oscillator. Frequency sweeps from 150 Hz down to 35 Hz in 120ms. The pitch envelope is what makes a kick a kick — that downward sweep compresses air the same way a drum head does. Velocity scales the starting pitch.

SNARE

Two layers. A triangle oscillator swooping 200 to 100 Hz gives the body — the thump of stick on head. Bandpass-filtered noise at 5 kHz gives the crack — the snare wires rattling. Velocity scales both independently.

HATS

White noise through a highpass filter at 8 kHz. The only difference between closed and open is decay time — 60ms versus 280ms. That's what a pedal does. It damps the cymbal. Shorter noise = tighter hat.

CYMBAL

Six square oscillators at inharmonic frequencies (587, 845, 1197, 1542, 1831, 2107 Hz) through a 4 kHz highpass. The inharmonicity creates the metallic shimmer — no integer ratios between partials. Same principle as real bronze vibration modes.