Euclidean rhythms
observablehq.com
observablehq.com
The classical solution (Bresenham's algorithm) is basically to draw pixels in the direction of the longer axis (in this case the X axis), adding a fractional increment of 5/13 to an accumulator to represent the subpixel movement on the shorter axis (in this case the Y axis). When the accumulator exceeds the threshold, you move a pixel on the short axis and subtract 1 from the accumulator.
You can equivalently start the accumulator at 0.5 with threshold of 1, for an accumulator range of [0, 1], or start at 0 with a threshold of 0.5, for a range of [-0.5, 0.5]. Instead of tracking the accumulator directly, you can track the product accumulator*13, which lets you use all-integer arithmetic.
The explanation based on Bjorklund's algorithm seems less intuitive and more convoluted than one based on Bresenham's algorithm.
I also don't really see the connection to Euclid's algorithm.
In one sentence: Most "interesting rhythms" are integer approximations of repeatedly adding a fraction.
[1] https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
Rather than operating on preset sequences, I'm using a series of oscillators in Puredata that can have their frequencies set to various ratios of a primary frequency. The oscillators get added together and a drum hit is triggered on the zero crossing of the result. The patterns can be modulated by changing the amplitude and phase of the oscillators in realtime. The early prototype was made in Puredata but now I'm trying to put all the rhythm synthesis into the robot microcontroller using the Mozzi library.
I'd love be able to initialize the oscillators with these Euclidean patterns and then be able to modulate them using the oscillator controls. I'm curious if any one knows of a way to take an existing drum pattern and calculate a small series of sine waves that would express that pattern. Kind of like FFT but for rhythms. This seems like something someone might have already figured out.
you can use a rhythm's slot weights to set a wave's amplitude, phase, or frequency. just need to decide on some continuous <=> discrete mapping
Could you discuss the example in the video a little more? How much are you "performing" and changing the phases and amplitude of the oscillators in this example? Are you tweaking them steadily, or are you able to leave the system to run by itself and let it's "emergent" rhythms occur naturally?
I'd love to know much more about this, as I'm also pretty disenchanted with sequencers these days and am searching for a better way to generate systems like this. Great work.
Here's a copy of the Puredata sketch https://stefanpowell.ca/project/Robodrummer/drumming_v4.zip I'm not sure if anything in there makes any sense. I'm not a drummer. I can't drum. I feel like my body has a palsy that completely prevents me from being able to keep a rhythm, so this is why I'm working on this drumming robot project.
For this sketch I'm using a Korg Nano Kontrol v1 with an abstraction to hook connect the knobs and sliders to Pd, and then I abstract it further to turn the sliders and knobs into floats. This patch, and variations on it, have been serving as a mental sketch board for thinking about rhythms. The output can be used to trigger a modular synth using L/R channels, but I'm using it to send OSC commands to my drumming robot. I'm not sticking with this setup because I don't want to send the individual hit instructions over the network, rather I want to only send parameter changes.
Yes, this approach can generate some interesting emergent patterns especially when you play with the ratios like using something very slightly off and then you get phasing patterns.
My general goal is to make an autonomous drummer that will jam my other autonomous instruments.
euclidean rhythms are also great for generating / selecting musical scales and chords among other things
> The Euclidean algorithm (which comes down to us from Euclid’s Elements) computes the greatest common divisor of two given integers. It is shown here that the structure of the Euclidean algorithm may be used to automatically generate, very efficiently, a large family of rhythms used as timelines (rhythmic ostinatos), in traditional world music. These rhythms, here dubbed Euclidean rhythms, have the property that their onset patterns are distributed as evenly as possible in a mathematically precise sense, and optimal manner.
G. T. Toussaint, The Euclidean algorithm generates traditional musical rhythms, Proceedings of BRIDGES: Mathematical Connections in Art, Music, and Science - http://cgm.cs.mcgill.ca/~godfried/publications/banff-extende...
---
The author published a book titled The Geometry of Musical Rhythm, one of whose chapters is based on the paper.
https://en.wikipedia.org/wiki/The_Geometry_of_Musical_Rhythm
Buchla had a lot of neat modular instruments along the same lines as this one, definitely a rabbit hole worth falling into if you haven't already. Now I just hope that Uli Behringer hears my prayers and designs some Buchla recreation modules.
I run a newsletter about synths and after 30 interviews and studio views, I still haven't stumbled upon Buchla systems.
the newsletter > [G.A.S. Newsletter](https://gasnewsletter.beehiiv.com/)
Squarp does a phenomenal job of continuously updating the firmware to their devices, both to fix bugs and to add new features/improve performance.
Part of the reason for releasing hapax was that they'd reached the limits of pyramid's hardware capabilities after five years of firmware updates.
Me too, for the same reason, so I’m not sure it’s quite right calling it the ‘king’ of Euclidean rhythms. There’s plenty of others that do pretty much the same as the Squarp that aren’t as frustrating to use.
I like Torso T1 [1], and a variety of Eurorack modules I have, like Euclidean Circles, Metropolis, Eloquencer, amongst others.
I wrote a Euclidean rhythms plugin for Logic Pro X scripter:
code: https://github.com/stereosteve/ScriptDiddy
demo: https://www.youtube.com/watch?v=cInvIxaeYZ4
of course I copy pasted the actual implementation from here: https://github.com/Lokua/euclidean-sequence/blob/master/inde...
It's pretty fun to use with AUs and VSTs
Which I took from its examples in the tutorial: https://strudel.tidalcycles.org/tutorial/
Tidal Cycles can be used to generate sound on your computer but it can also sequence MIDI hardware.
function b2n(boo) return boo and 1 or 0 end
function eu(index,length,beats,offset) return b2n((((index + offset) * beats) % length) < beats) end
function euquence(length,beats,offset) local l = {} for i=0,length do local r = eu(i,length,beats,offset) table.insert(l,r) end return table.concat(l,’ ‘) end
How is Wolfram Research not involved, since it's so clearly Theo Gray's invention?
Perhaps downvoted since the downvoter wasn't aware of Mathematica notebooks.
Citation:
https://en.wikipedia.org/wiki/Wolfram_Mathematica#Notebook_i...