A polyrhythm layers two pulses that divide the same span of time into different numbers of equal parts, such as three beats against four. They never quite line up, which is what makes them sound complex and rolling. To sequence one cleanly you need the single grid both pulses share, and that grid is found with the lowest common multiple.
How it works
Take a polyrhythm of a against b. The two pulses align perfectly only when the bar is divided into a number of ticks that both a and b divide evenly. The smallest such number is the lowest common multiple, computed from the greatest common divisor:
gcd(a, b) = repeated remainder (Euclid's algorithm)
lcm(a, b) = (a × b) / gcd(a, b)
On a grid of lcm ticks:
- the first pulse lands every
lcm / aticks, - the second pulse lands every
lcm / bticks, - and both coincide only at tick 0, the downbeat, because the numbers share no factor beyond their gcd.
Worked example
For 3 against 4: gcd(3, 4) = 1, so lcm = (3 × 4) / 1 = 12. Divide the bar into 12 ticks. The three-pulse line hits ticks 0, 4 and 8. The four-pulse line hits ticks 0, 3, 6 and 9. They meet only at tick 0, then drift apart for the rest of the bar — the classic three-against-four sound.
Contrast 4 against 6: gcd(4, 6) = 2, so lcm = 24 / 2 = 12. The shared factor of 2 means the pulses coincide more often and the cross-rhythm is gentler.
Tips and notes
The number of coincidence points inside one cycle equals the gcd of the two numbers (counting the downbeat). Coprime pairs such as 5-against-7 produce the busiest grids and the most striking effect. For three-layer polyrhythms, fold the LCM in pair by pair. All of this runs locally in your browser.