Polyrhythm Generator: Create Euclidean Beats

Rhythm Composer: 25-Track Euclidean Polyrhythm Beat Generator

What did I do now? More polyrhythm generator work. Amazing that such magic exists in math.

Because I like pushing things as far as I can, this Euclidean rhythm composer is a generative music tool that runs 25 simultaneous Euclidean rhythm patterns.

Unlike my simpler Euclidean generator with two or six loops to work with, or my Euclidean world beat rhythm exploration tool, this tool lets you layer up to 25 distinct mathematical rhythms, which interact with each other in ways that end up being unpredictable and surprising.

Think of it as a virtual drum circle with 25 mathematically coordinated players with their songs tagging and following each other endlessly. Not going to do it, but what if we could have an infinite number of circles? What would happen? What would come up? Sort of like the infinite number of monkeys on typewriters.

If you are intrested in other mathematical music tools, the collection can be found here, with more added as created.

Rhythm Composer

25-Track Euclidean Polyrhythm Generator
100
0%
80%
Steps to Convergence
# Sound Steps Hits Rotate Vol
0
Active Tracks
0
Hits/Cycle
0%
Density
Full Cycle

The Basic Idea of a Polyrhythm Generator

Each track generates a rhythm using the Euclidean algorithm, the same ancient math that powers the Toussaint Explorer tools I have on this site.

You set how many steps are in the cycle and how many hits to distribute across those steps. The polyrhythm algorithm spaces those hits as evenly as possible.

With 25 tracks running different patterns at once, you get polyrhythm: multiple rhythmic cycles overlapping, aligning, and diverging in complex ways.

How Our Polyrhythm Generator is Organized

The 25 tracks are divided into 5 banks of 5 tracks each:

Bank and Default SoundsCharacter
1-Kick, Toms, CongaLow-end foundation
2-Snare, RimMid-range punch
3-Hi-Hat, ShakerHigh-frequency texture
4-Bell, Clave, CowbellMelodic percussion
5-Click, NoiseAccents and color

By default, only Bank 1 is active. This lets you start simple and build up.

The Interface

Master Controls

  • Play/Stop — Start or stop playback
  • Tempo — Beats per minute (40–200)
  • Swing — Adds a shuffle feel by delaying off-beats
  • Master Volume — Overall output level
  • Randomize All — Chaos mode: randomizes every track
  • Randomize Bank — Randomizes only the current bank
  • Clear Bank — Mutes all tracks in the current bank

Bank Tabs

Click a bank tab to edit those 5 tracks. Each bank has its own color scheme, so you can visually identify which tracks belong where.

Track Controls

Each track has:

  • Sound — Choose from 12 synthesized percussion sounds
  • Steps — How many divisions in the cycle (2–32)
  • Hits — How many sounds to place in those steps
  • Rotation — Shift the pattern’s starting point
  • Volume — Individual track level
  • Mute — Toggle the track on/off

Mini Overview

The 5 \times 5 grid of squares at the bottom shows all 25 tracks at a glance. Click any square to mute/unmute that track without switching banks. Squares flash when their track plays a hit.

Stats Bar

  • Active Tracks — How many unmuted tracks with hits
  • Hits/Cycle — Total hits across all active tracks
  • Density — Ratio of hits to total steps (higher = busier)
  • Full Cycle — How many steps until all tracks align again

How to Use It

Start Simple

  • Press Play — Bank 1’s low drums start.
  • Listen to how the patterns interact.
  • Adjust one track’s steps or hits and hear how the groove shifts.

Build Up Layers

  • Click the Bank 2 tab.
  • Unmute one or two tracks (click the M button or use the mini overview).
  • Listen to how snares interact with the kicks.
  • Continue adding banks gradually until you hear something you like.

Experiment with Randomization

  • Click Randomize Bank to scramble the current bank.
  • If you like parts of it, keep those and randomize again.
  • Use Randomize All for complete chaos, then mute tracks until something catchy emerges, erasing them one by one.

Find the Beat

The rhythm happens when patterns lock together unexpectedly. Try:

  • Different step counts that share common factors (12 and 16 both divide by 4).
  • Prime number steps (7, 11, 13) for patterns that rarely align.
  • Same steps but different hits (three tracks all on 16 steps but with 3, 5, and 7 hits).

The Math Behind It

Convergence

When running multiple tracks with different step counts in a polyrhythm generator, they eventually all land on beat 1 together. This is the LCM (Least Common Multiple) of all active step counts.

  • Two tracks at 8 and 12 steps converge every 24 steps.
  • Three tracks at 5, 7, and 9 steps converge every 315 steps.
  • With 25 tracks using varied step counts, convergence might take thousands of steps.

The Full Cycle stat shows the LCM. When it displays $\infty$, the cycle is so long it’s essentially infinite—you could run the tool for hours without hearing an exact repeat. Too cool.

Density and Feel

  • Low density (under 30%): Sparse, ambient, lots of space.
  • Medium density (30–50%): Groove territory, room to breathe.
  • High density (50–70%): Busy, energetic, approaching saturation.
  • Very high density (over 70%): Wall of sound, textural rather than rhythmic.

Why This Creates Music

Euclidean distribution is “maximally even”—it spaces hits as uniformly as possible. When you layer multiple maximally even patterns, they interfere constructively and destructively like waves. The result has structure without predictability. A polyrhythm generator sounds like music, and the intresting thing is, it is just math.

polyrhythm beat generator showing Euclidean rhythm patterns

Traditional African drummers playing polyrhythmic percussion patterns together in cultural performance.

This is why traditional polyrhythmic music (West African drumming, Balinese gamelan, Afro-Cuban percussion) sounds both organized and alive; they all have different beats that eventually align together. The Polyrhythm Generator applies the same principles with algorithmic precision.

Sound Palette

Sound and CharacterBest For
Kick- Deep, punchyFoundation, downbeats
Snare- Sharp, brightBackbeat, accents
Hi-Hat- Crisp, shortSubdivision, texture
Tom- Warm, resonantFills, melodic low-end
Clave- Woody, cuttingTraditional patterns
Cowbell- Metallic, sustainedAccents, timeline
Rim- Tight, snappyGhost notes, cross-rhythms
Bell- Ringing, clearMelodic accents
Shaker- Soft, continuousBackground texture
Conga- Round, pitchedMelodic percussion
Click- Sharp, preciseMetronomic accents
Noise- White noise burstTexture, transitions

Creative Applications

Generative Composition

Set up an interesting configuration and let it run.

Because the full cycle might be hundreds or thousands of steps, you’ll hear constant variation even though nothing is random. The steps will be spaced so that the human mind will find difficulty in finding the order.

Understanding Polyrhythm

There’s no better way to internalize how polyrhythm works than hearing 25 tracks phase in and out of alignment. Start with just two tracks at different step counts and add more as you develop your ear.

Tips

  • Start sparse — It’s easier to add than subtract.
  • Listen to the spaces — Silence is part of the rhythm.
  • Use the mini overview — Quick muting is powerful.
  • Trust convergence — Even chaotic settings have structure.
  • Record everything —Happy accidents disappear; if you don’t capture them, they are gone forever.