musics.name

Rhythm Lab

Spread a number of pulses as evenly as possible over a cycle of steps, then play, rotate and edit up to three tracks of different lengths against each other. A practice tool for grooves, polyrhythms and beat ideas.

Rhythm lab

120 BPM · 16 steps per bar

Stopped. Press Start, or Space while focus is inside this tool.

One step is a sixteenth note, so 4 steps make a beat.
120 BPM
0 % Delays each odd step by this share of one step. 0 % is straight.

Edits to steps, pulses, rotation, mute and solo take effect at the next bar of 16 steps while playing. Tempo and swing apply from the next step.

Track 1 Euclidean

—

Gaps: —

Track 2 Euclidean

—

Gaps: —

Track 3 Euclidean

—

Gaps: —

Presets

PresetPatternGapsActions
Tresillo E(3,8)——
Cinquillo E(5,8)——
E(7,12)——
E(2,5)——
E(9,16)——

E(3,8) is the Cuban tresillo pattern. The pulses are spread as evenly as whole steps allow, and each gap is the count of steps from one pulse to the next.

Timing: Web Audio clock with 25 ms look-ahead Up to 3 tracks, 2 to 32 steps each Nothing is recorded or uploaded

A Euclidean rhythm answers a simple question: if you have k beats to place in a cycle of n equal steps, where do they go so that the gaps between them are as equal as possible? The answer is a pattern that many traditional rhythms turn out to resemble. This lab generates those patterns, lets you edit them by hand, and plays up to three of them at once on a shared grid.

Spreading pulses evenly

Write a cycle as n steps and mark k of them as pulses. If k divides n, the answer is obvious: every n/k steps. When it does not divide, the pulses cannot all be equally far apart, and the best you can do is for every gap to be one of two neighbouring lengths. E(3,8) places three pulses in eight steps as x..x..x., with gaps of 3, 3 and 2. E(5,8) gives x.xx.xx., with gaps of 2, 1, 2, 1 and 2. Those are the maximally even arrangements.

Bjorklund’s algorithm in plain words

Bjorklund’s algorithm builds the pattern without searching. Start with k groups that each hold one pulse and n minus k groups that each hold one rest. Then pair the groups up in order, one pulse group with one rest group, and join each pair. Whatever groups are left over become the new second list. Repeat until one of the two lists has a single group or none. Then read the groups out in order. The steps of this lab run exactly that procedure, so what you see is the algorithm and not a lookup table.

Rotation and the starting point

A cycle has no natural first step, so rotation simply moves the starting point. E(3,8) rotated by one is ..x..x.x. The shape and the gaps stay the same, which is why rotation is the tool for asking how a rhythm sounds from a different beat, and for lining a pattern up against another track.

Tracks, polymeter and polyrhythm

Each track repeats at its own length. Two tracks of eight and twelve steps share one grid, and their patterns line up again only after 24 steps, the lowest common multiple of the two lengths. Where the tracks sound together, the result is a polymetric relationship: each part keeps its own cycle, and the mix changes shape across the longer period. A polyrhythm is the more general term, for any two or more rhythms of different groupings played together. Setting the tracks to the same step count turns the lab into a simple polyrhythm with one shared cycle.

Practising with the lab

Start with one track, a short cycle and one or two pulses, and clap the pattern before you listen. Add pulses one at a time, and move the rotation to find where the pattern feels like a downbeat for you. When the pattern is comfortable, add a second track with a different length and clap both parts together. Keep the tempo low until the two gaps are steady. Swing is useful for checking how a straight pattern changes feel; it delays only the odd steps, so 0 % is the written grid and larger values make the offbeats lean.

For beat making, the presets are a starting point rather than a finish. Mute a track to listen for the one that carries the groove, then edit single steps by hand. The custom marker shows that a pattern has left the generated shape, and the back-to-generated button restores it.

Limits

The lab plays three voices with simple synthesised sounds. It does not record, export or read MIDI, and it has no per-step velocity. Euclidean patterns are a useful model of many rhythms, not a complete account of any music. Many real rhythms need more than one such pattern, or a change of cycle length partway through, and the lab does not model that. Edits apply at the next bar, so a change made in the middle of a bar waits a moment before you hear it.

Questions

What is a Euclidean rhythm?

A pattern made by placing k pulses across n steps as evenly as possible. E(3,8) is x..x..x., three pulses with gaps of 3, 3 and 2. Toussaint's 2005 paper showed that many traditional rhythms from around the world are Euclidean patterns, up to rotation.

How does the algorithm work?

Bjorklund's algorithm repeatedly combines the groups of pulses and rests in pairs and carries the leftovers forward, until only two kinds of group remain. Those groups are then joined in order. The result is the same as spacing the pulses as evenly as whole steps allow.

What does rotation change?

Rotation moves the starting point of the cycle to the left without changing the shape. E(3,8) rotated by one is ..x..x.x, the same rhythm heard from a different beat. Rotation matters when the pattern is played against another track.

Why do tracks with different step counts drift apart?

Each track repeats at its own length, so two tracks of 8 and 12 steps line up at the start of every 24 steps. Between those points they play different parts of the grid, which is a polymetric relationship and not a fixed polyrhythm.

Type a chord symbol or a scale name and go straight to it.

Go to
↑ ↓ move   ↵ openesc close