Euclid Engine

Stack interlocking Euclidean percussion rings and watch them slowly phase against each other — Reich-style polyrhythm, ZERO pitch.

Auto-starts in ~1.5 s on desktop · tap button on mobile to unlock audio

I · KickE(3,8)
K =3onsets
N =8steps
drift0.00 BPM
··●··●·●
II · HatE(7,16)
K =7onsets
N =16steps
drift+0.12 BPM
··●·●·●··●·●·●·●
III · ClaveE(5,8)
K =5onsets
N =8steps
drift-0.07 BPM
·●·●●·●●
IV · ShakerE(9,16)
K =9onsets
N =16steps
drift+0.22 BPM
·●·●·●·●●·●·●·●●

Base 112 BPM · Bjorklund · Reich phasing · Wilson look-ahead scheduler

Design notes ↗

Design Notes

Euclidean rhythms (Bjorklund) — E(k, n) distributes k onsets across n steps as evenly as possible using the same remainder algorithm that Euclid used for GCDs. E(3,8) is the Afro-Cuban tresillo; E(5,8) appears in Middle Eastern and African music; E(7,16) is common in jazz subdivisions. Reference: Godfried Toussaint, "The Euclidean Algorithm Generates Traditional Musical Rhythms," 2005.

Reich phasing — each ring runs at BASE_BPM + a tiny driftBpm offset so their downbeats gradually slip against each other, producing an interference pattern that never exactly repeats within a normal listening session. After ~4–8 minutes the rings re-align, then drift again. Inspired by Steve Reich's Piano Phase (1967) and Clapping Music (1972).

Look-ahead scheduler — a setInterval at 25 ms pre-schedules audio events 100 ms ahead using AudioContext.currentTime, so percussion fires with sub-millisecond precision regardless of frame-rate jitter. Visual flashes are queued via setTimeout aligned to the same audio timestamp. Reference: Chris Wilson, "A Tale of Two Clocks," 2013.

Voices — kick (pitch-enveloped sine 150→45 Hz + click), hat (HF noise burst), clave (band-pass exponential decay), shaker (band-pass HF noise). All synthesised in Web Audio — no samples. Output through a DynamicsCompressor brick-wall limiter.

The dream lab — Karel Barnoski