Rhythm meets rasterisation

Euclidean rhythms

How a line-drawing algorithm creates evenly spaced beats: draw a diagonal, snap its intersections to a grid, then hear the pattern.

5 / 12 · default

Live controls

Drag while playing — no restart
5
Hits per bar
12
Steps per bar
0.00
Shift right by 0–12 subdivisions (wraps)

Drawing the rhythm

The yellow line is continuous; green grid columns are its discrete, evenly distributed rhythmic hits. Shift the line with rndPt.

5 : 12
Euclidean hit columnsContinuous line (wraps)Playhead
Preparing drum kit…
Bar 15 hits · 12 divisions

Green blocks mark the Euclidean hits; the white cursor follows playback. An optional kick marks the bar’s downbeat at step 0.

Sound & other controls

Also live-adjustable
1
Quantisation step
240
Subdivisions per minute
65%
Master output
CC0 TR-808 recordings
Try:

Euclidean rhythms from line drawing

time(i) = timeRes × floor(((i × tupDen / tupNum + rndPt) mod tupDen) / timeRes)
Positions: 0, 2, 4, 7, 9
5Tuplet hits
5Distinct times
2–3Gap in subdivisions

Think of rasterising a diagonal, as in a grid-based line-drawing algorithm. The ideal hit positions lie at x = i × tupDen / tupNum + rndPt. Taking the floor maps these continuous positions to grid columns; wrapping them around the bar gives a repeating rhythm. With tupNum ≤ tupDen and timeRes = 1, this produces a rotation of a maximally even Euclidean rhythm. rndPt slides the line horizontally (0 to tupDen is one full cycle). Larger timeRes values explore coarser quantisation, which can break perfect evenness.

Drum samples: Michael Fischer’s TR-808 recordings, CC0 public domain. The app loads them when online and uses its own percussion synthesis if offline. Runs directly as an HTML file.