Dancing around the rhythm space with Euclid

I've been playing with sequencers and getting out of Euclidean rhythms (kind of) and into Non-Euclidean ones, and at the end of the whole story managed to build a little one of my own. If those words mean nothing to you yet, enjoy the ride.

There's a little music corner at home, and in it I've got the classic Synth hipster combo of an Elektron Digitone and a Digitakt. Both are really fun to play with, especially the Digitone. I really like the immediacy, and often it's with me on vacation. A powerbank going in and a pair of headphones coming out. The Elektron sequencer workflow makes it easy to get started, and it pairs it with a great FM-synthesis sound engine, which normally has a reputation for being hard to understand.

And yes, even with the playful Digitone this reputation is still well earned, which has led me to experiment more. Synthesizers are normally fixed in their architecture, oscillator goes into filter and if you are lucky, there's a mysterious mod-matrix to re-jigger parts via cryptic button combinations. I love my hardware, but… Sometimes it's just not the best for learning.

Modular synthesizers exist as well, but my synth corner needs to stay just a corner. This brings us to VCV Rack, it's a software modular synthesis environment with a lot of overlap with the Eurorack hardware format. You can have a lot of fun following Omri Cohen's videos, cables and modulation going everywhere to end up with something Very Nice.

Of course, when you get a cool sound going, it needs to keep playing while you somehow make it worse and worse. This is where a Sequencer usually helps, and there is a wealth of different ones to play with in VCV Rack. Connect them with semi-random modulation sources and all the little bleeps, thonks and thwangs can keep evolving with what the neighbors will add as wall-based percussion track for hours.

When I play on the Digitone/takt, it's a bit different. What I do is create a set of patterns that evolve in some small way as you move from one to the next. On top of this I tweak and twiddle parameters, filters and effects to help create transitions over time. I keep to my little corner at home, but I'm romanticizing about the idea of a thrilling live performance, especially with live improvisation.

The tricky thing is that live improvisation requires tools and a thought out workflow, and the way I've been using my devices requires a lot of preparation up-front. On one end maybe more randomization can help, but pure random usually doesn't sound good either, so I need some way to increase my lucky accidents.

Now, of course, the real solution is really quite simple, you might already be thinking it: I should practice more with the gear that I already have. Yes, so of course I'm doing something entirely different.

Among the many sequencers in VCV Rack I found some based on Euclidean rhythms, and it turns out that they might be just what I needed. What are they? Hit play and take it away!

The Euclidean algorithm tries to position a number of hits as evenly as possible across a pattern. There's a lot of material online that explains it from many angles, YouTube Videos and the original paper written by Godfried Toussaint is also short and clear.

It turns out that by varying the hits and length of a pattern, you get a fair number of world music rhythms that you will most likely recognize. We'll use E(N,L) notation with N=Number of hits and L=Length of pattern to describe them.

Take the E(3,8) rhythm, it's all over the place. In Elvis's Hound Dog, and 50s rockabilly. In Cuba it's the Tresillo and you can find it in West African drum rhythms. We've also got E(5,8) which again is present all over the world. The really interesting part is that certain rhythms have made their home more in certain parts of the world than others. The paper goes into more detail so just read it, and maybe use the widget above for playback.

Back to where we were. The Euclidean algorithm gives us a fair amount of different rhythms. As you probably paused the widget above at some point, you noticed that it can get quite repetitive. Prime number divisions tend to be interesting but some rhythms like E(4,8) is just a simple four-on-the floor groove. Many Euclidian sequencers allow you to rotate the pattern to create more variation, but you'd need to keep changing it to prevent it from becoming monotonous over time. On the other hand, this might even be desired for something percussive, a funky bassline or the ticking of hi-hats.

Then modulate the tension by increasing or decreasing the number of hits in the pattern. Get wild, wire a 4-step sequencer that moves every bar, to the density of hits in a Euclidian pattern so that every bar the feeling changes and creates a much more interesting evolution over time. To me, that bridges the gap between a tool for short percussive rhythms, into something that might even be a melody when given a nice big heap of pitch changes.

There is a more fundamental drawback to Euclidean Rhythms though, which is also their definition: Evenness.

Or not really a drawback, but a lot of interesting rhythms have uneven rhythm placement. We can use them to explore the rhythm space, but have to keep on the roads. Another approach is to store a lot of interesting patterns and interpolate between them, Mutable Instruments Grids is an example of such a Eurorack module. But I feel like that gives less control and ability to insert intent into the shape of the rhythms.

There are people experimenting in another direction. Shakmat Knight's gallop is a Eurorack module with a normal Euclidean mode, but also an Anti-Euclidean one. As far as I can tell from the manual, it makes an attempt to position hits as uneven as possible. Both the Knight's Gallop and another one called the lx-euclid with modes that cluster hits in the beginning or end. This gives us some more room in the rhythm space do dance around in.

Change the interpolation control above to one of the extremes and what you get was one attempt to create something like an Anti-Euclidian rhythm by creating uneven spacing, but I wasn't really happy with the original outcome. There's some interesting grooves in there at lower densities and lengths, but at higher ones it just became too clumped together.

In his writing, Toussaint discusses how different metrics can be used to describe the distance between two rhythms. That led me to try interpolating between the Euclidean and the Anti-Euclidean rhythm we just played with. It took a bit of tweaking, the key was to constrain the interpolation so that it only moved one hit at a time. This actually felt like exploring the rhythm space in a much more interesting way. The Anti-Euclidean algorithm tended to cluster hits in the beginning, so it made sense to add a mirror version of it as well.

Nice. That's just one possible take on "optimize for uneven" and there might be more interesting parts of the rhythm space now that we're off-roading it. Another interesting experiment was clumping the hits, and then attempting to do something similar to Wavefolding where as peaks start to form we push them back in on itself, creating holes in the clusters that turn into new peaks.

I don't know about you, but to me this version also has a couple of good grooves in its repertoire. A drawback is that as you increase the intensity you also get repeats of the same rhythms you've had before, lessening the feeling that you are exploring the rhythm space.

Though again, setting one of these as the interpolation target and exploring what you find on the way is quite fun still, so I really liked that.

I continued to play around with more ideas, thinking of different places in the rhythm space we could visit. Trying things like alternating clusters, but they didn't really result in more interesting rhythms. We could also do something like Euclidean subdivisions, treat the pattern as one of a subdivided length and use that to place the hits in clusters instead.

The widget below collects a few of those experiments, it's less of a curated tour and more of a notebook of different attempts at this point, select an algorithm in the dropdown and make sure to play with interpolation slider.

My main takeaway from the experimentation was that Euclidean rhythms are good (no surprise there), and to add some spice you don't need to stray too far away from them to get interesting syncopation. A rhythm that looks beautiful on a circle might still not sound so interesting, as I tried to take higher-order polynomial curves and map them to the hits. In the end, interpolating between a clustered version and the Euclidean was one of the best ways to explore.

With that in mind, I wanted to try moving these experiments a bit further towards a sequencer that could support longer patterns, and combine it with some of the ideas I mentioned earlier, like changing density over time. The interpolation feature is key, and modulating hit density over time. The closest standalone sequencers I know would be either the Torso T1 or the Oxi one, but I don't think either really support do that outside of manually changing controls.

I started expanding the widgets above into this, and it grew and grew until I split it out into a separate page. Firstly because then I don't need to scroll to the ends of the earth every time I refreshed the page. It also makes it easier for myself to bookmark for the future.

Obligatory side-note: I'm writing this in the very tail end of 2025, a time where everything circles around AI in some way. If I had been writing a year or two back, all of the interactive widgets would probably have been images instead. They are not that hard to build, but involve a lot of micro-decisions that take time and energy. I do my faffing about in the mornings before work, so time and energy are not that abundant.

This was an opportunity to experimenting with the latest batch of AI models while building as well. Claude Opus 4.5 seems like a clear step up from Sonnet 4.5 (but more annoying usage limits), and the new Gemini 3 Flash is also a strong contender. They struggled with some parts though. Neither had an easy time understanding how to make the Shift Register work well in the sequencer context, and I had to rewrite the core rhythm generation a couple of times to make it work the way I needed it to before handing it back.

With that out of the way, follow the link below.

Back? It might need a little bit of explanation.

There are four different parts to a pattern, with either a global length or individual part lengths. And for each part we can control the density as an offset from the main one, so it's easy to perform by only tweaking the main one. For each we can also control the distance from the euclidean pattern.

Now this I feel like has the seed of something that can be used beyond simple-ish percussion loops. Lets you get going quickly but also has enough control to shape what's happening, add intent.

I added controls for rotation, inverting the rhythm, and manual overrides for forcing a hit or a rest. Having the same pitch for each hit started to get a bit tedious, so I added a Shift Register (also known as Turing Machine) inspired generator for pitch information as well.

The thing that's really cool (alternatively: really confusing) is the Boolean mode. Normally each part plays in sequence, one after another. But in boolean mode they act as different layers that combine into one output. You can choose which one to listen too, and see what the effect of playing Part 1 OR Part 2 is. And since we already have a Shift Register for pitch, why not reuse it for beats as well?

There are a couple of more features as well, they are hopefully either easy to understand or fun to click around on anyway so I'm pretty satisfied with this version. What comes next?

I haven't written a VCV Rack plugin, but it might be fun to try as a next step. Or maybe add WebMIDI to the sequencer, either way would let me see how it plays with the Digitone. End result being that I spend some more time in my synth corner with tiny blinking lights rather than big laptop screens.

That's it for this dance, see you next time!