Guides › Rhythm

Guide · Euclidean Matrix

Euclidean rhythms explained: how a Euclidean rhythm generator spreads hits evenly

What a Euclidean rhythm E(k,n) is, how to work one out by hand, classic patterns like the tresillo and cinquillo, and a layered drum groove with a MIDI download.

5 stepsUpdated Nov 2026
Euclidean rhythms explained: how a Euclidean rhythm generator spreads hits evenly

The problem

A Euclidean rhythm is a way to place a number of hits (k) as evenly as possible around a loop of a fixed number of steps (n). It is written E(k,n). E(3,8) means three hits in eight steps, and the most even way to do that is the famous tresillo, x..x..x. (x = a hit, . = a rest). The same idea gives patterns you already know from Latin, African and Middle Eastern music, which is why a Euclidean sequencer so often sounds natural even though it is just arithmetic.

This guide shows how to work a Euclidean rhythm out by hand, lists the well-known patterns, and then layers three of them into a drum groove. The groove is an original teaching example, not output from any app, and it comes as a MIDI file on drum channel 10. In a piano roll, one step is one sixteenth note unless we say otherwise.

Two circles with eight steps numbered 1 to 8. On the left, E(3,8) the tresillo has hits on steps 1, 4 and 7 joined into a triangle. On the right, E(5,8) the cinquillo has hits on steps 1, 3, 4, 6 and 7 joined into a pentagon.
E(3,8) and E(5,8) as circles. Step 1 is at the top and the loop runs clockwise. The shape the hits make is as even as eight steps allow.
A grid of one bar with 16 sixteenth-note steps and three rows. Kick hits on steps 1, 4, 8, 11 and 14. Snare hits on steps 5 and 13. Closed hat hits on steps 1, 4, 6, 8, 10, 13 and 15.
The layered groove: kick E(5,16) rotated 3, snare E(2,16) rotated 4, closed hat E(7,16) with no rotation. The counting row reads 1 e & a, 2 e & a and so on.

Fixes that work in any DAW

  1. What E(k,n) means, and how to read the x and dot notationn is the number of steps in the loop; k is how many of them are hits. The rest are silences. Write a hit as x and a rest as a dot, so E(3,8) = x..x..x. and E(4,16) = x...x...x...x... (four on the floor). The gaps between hits can differ by at most one step. That single rule is what 'as evenly as possible' means. Only k and n decide the pattern's shape; where it starts is a separate choice, called rotation.
  2. Work it out by hand (the Bjorklund method)Take k groups of 'x' and n minus k groups of '.'. Pair each x group with a dot group, then treat any leftovers as the new second set, and keep pairing until at most one leftover group remains. E(3,8): three [x] and five [.]. Pair them: [x.] [x.] [x.] with two [.] left over. Pair again: [x..] [x..] [x.]. Read left to right: x..x..x. (gaps 3, 3, 2). E(5,8): five [x] and three [.] become [x.] [x.] [x.] with two [x] left over. Pair again: [x.x] [x.x] with one [x.] left over. Read left to right: x.x x.x x. = x.xx.xx. (the cinquillo; gaps 2, 1, 2, 1, 2). You can check any result with the gap rule above.
  3. Well-known patterns, all checked by computerEach of these is a rotation of the algorithm's output (we ran it to check), chosen so that step 1 is a hit. E(3,8) tresillo = x..x..x. (3-3-2). E(5,8) cinquillo = x.xx.xx. (2-1-2-1-2). E(7,12) = x.xx.x.xx.x. (2-1-2-2-1-2-2), often heard as a West African bell pattern. E(5,12) = x..x.x..x.x. (3-2-3-2-2). E(4,16) = x...x...x...x... (four on the floor). E(5,16) = x..x..x...x..x.. (3-3-4-3-3), often called bossa nova. E(7,16) = x.x.x..x.x.x..x. (2-2-3-2-2-3-2). Some famous clave patterns, such as the 16-step son clave, are close to these but not exactly Euclidean, so do not expect an exact match there.
  4. Rotation: where the pattern startsRotating a pattern slides all hits later by the same number of steps, wrapping around at the end; the shape and the gaps never change. E(3,8) rotated by 0 to 3 steps (to the right, our convention here): x..x.x.. , .x..x.x. , ..x..x.x , x..x..x. . These four are the same rhythm starting at different points, and rotation 3 is the tresillo as usually written. Different books start the pattern at different hits, so two sources can show the 'same' rhythm rotated. When a pattern looks wrong, try rotating it before you assume it is a different rhythm.
  5. Layering lanes into a grooveOne Euclidean pattern is a rhythm; several make a groove. Use the same number of steps (here 16, one bar of sixteenths) and give each drum its own k. Kick: E(5,16) rotated 3 = x..x...x..x..x.. (steps 1, 4, 8, 11, 14). Snare: E(2,16) rotated 4 = ....x.......x... (steps 5 and 13: beats 2 and 4). Closed hat: E(7,16) = x..x.x.x.x..x.x. (steps 1, 4, 6, 8, 10, 13, 15). Rotating the kick by 3 puts it on step 1 and keeps it off the snare steps. Lower k for the lanes that should breathe (snare), higher k for lanes that fill space (hat).
  6. Layering lanes of different lengthsIf one lane has 16 steps and another has 12, they line up again only after 48 steps, because 48 is the first number both divide into. That slow drift is a polyrhythm, and it is the main reason to use different n values. For a straightforward groove keep every lane at the same n; add one odd-length lane such as E(5,12) for percussion on top.
  7. Program one by hand in any DAW piano rollMake a one-bar clip, set the grid to 1/16 so each step is one grid square, and draw a short note on each hit step. Step 1 is the start of the bar, step 5 is beat 2, step 9 is beat 3, step 13 is beat 4. For drums, use General MIDI drum notes on channel 10: kick = note 36, snare = 38, closed hi-hat = 42 (note names for these depend on the DAW, and some call 36 C1, others C2). Keep notes short (a sixteenth or less) and give the hat a lower velocity than the kick, or it will sound mechanical and loud.
  8. Make it feel less like a machineEuclidean patterns are exact, so the feel has to come from you. Lower the velocity of the hat steps that fall between beats, add a little swing if your DAW allows, and try rotating just one lane by a step. Changing one lane's rotation is the quickest way to find a new groove from the same three patterns.

With Euclidean Matrix, step by step

  1. Open Euclidean MatrixGive it a try from the button on this page. You sign in with a musicpro.app account first, and it runs in your browser.
  2. Start from the lanes you needThe Polyrhythm Preset menu holds ready-made setups, or you can edit any lane. Each lane has Steps (N), Pulses (K) and Rotate sliders: Steps is n, Pulses is k. Lanes include Kick, Snare, Closed Hat, Open Hat, Percussion (Cross-Meter), Melodic Bass and Melodic Lead. Click the M button at the end of a lane to mute it; mute Open Hat, Percussion, Melodic Bass and Melodic Lead to follow the three-lane groove in this guide.
  3. Enter the groove from this guideKick: Steps 16, Pulses 5, Rotate 3. Snare: Steps 16, Pulses 2, Rotate 4. Closed Hat: Steps 16, Pulses 7, Rotate 0. Set Rotation Drift to 0 so the pattern repeats bar after bar, and lower Velocity Humanize if you want equal velocities. The app also has a Chance slider per lane; leave it at 100% for fixed hits. In the app, Rotate also slides the pattern later, and the start (Rotate 0) of its own E(3,8) is x..x.x.. rather than the tresillo, so rotate to 3 for the classic form.
  4. Listen and change one thingPress Audition Matrix to hear it with the rings and playhead going round. Change the Rotate value of one lane, or add a hit to the hat lane, and listen again. Stop as soon as it feels right.
  5. Send it to the studio and exportPress Forge & Open in Studio to open the lanes as tracks in the piano roll, then export the MIDI file and drag it into your DAW to play it with your own drum sounds.

Example MIDI

Assign an instrument to each imported track. MIDI files contain notes, not audio.

Tip: Start with the kick and snare only, get those feeling right, then add the hat. If a pattern feels wrong, rotate one lane by one step before you change k: the same hits on a different start point often fix it.

Common questions

What is a Euclidean rhythm?

A rhythm that spreads k hits as evenly as possible over n steps. It is named after Euclid's method for finding a greatest common divisor, which the pattern-building process resembles. The musical idea was described by Godfried Toussaint in 2005, who showed many traditional rhythms are Euclidean.

What is the difference between E(5,8) and E(5,16)?

Both place five hits, but n is different. E(5,8) fills a short loop (x.xx.xx., the cinquillo); E(5,16) fills a bar of sixteenths (x..x..x...x..x.., bossa nova) with wider gaps, so it feels slower and more open.

Does a Euclidean sequencer have to use the same pattern every bar?

No. Euclidean Matrix has a Rotation Drift (per bar) setting that shifts the patterns a little each bar. Keep it at 0 to repeat exactly, as in the groove in this guide.

Do I need to know the Bjorklund algorithm?

No. The by-hand method above is the Bjorklund method in plain words, and an app does it for you. Knowing it helps you check results and understand why the gaps never differ by more than one step.

Why do some sources show E(5,8) with a different pattern?

Because the same rhythm can start at a different hit. These are rotations of one pattern, and all share the same gaps. Compare the gap counts (2-1-2-1-2 for E(5,8)) rather than the letters.

What do the MIDI notes in the download mean?

They are General MIDI drum notes on channel 10: kick 36, snare 38, closed hi-hat 42. The file holds two bars of the groove at 100 BPM, with one track per drum so you can mute any one.

More guides