# Estuary & MiniTidal: Euclidean Rhythms

There’s a really cool feature that Tidal has that is hard to replicate in other systems for making music: Euclidean rhythms.

The way you write a Euclidean rhythm is pretty simple.

``s "glitch(5,8)" # n (irand 8)``

Gives you a pattern of five beats spread as evenly as possible over a pulse of eight. This means that if you did something like

``````stack [s "glitch(5,8)" # n (irand 8),
s "linnhats*8"]``````

you’ll always hear the hi-hat and the glitch happen at the same time when a glitch beat happens.

One of the things that’s really cool about Euclidean rhythms is that you can actually pattern the number of beats in a cycle and rotate the beats through time. If you try

``s "glitch(<5 7>,8,<0 1 2>)" # n (irand 8)``

you can hear that the beat has either five or seven beats in a cycle and that the cycle doesn’t repeat in rhythm for awhile. If you’re having trouble hearing it, try taking out the random selection of samples and change the `irand 8` to just `0`.