Euclidean Polyrhythm generator - code and details
Moderators: Kent, luketeaford, Joe.
- Tombola
- Super Deluxe Wiggler
- Posts: 1879
- Joined: Sun Jan 23, 2011 11:33 am
- Location: London, England
Euclidean Polyrhythm generator - code and details
Wanted to post some of the details of my Euclidean polyrhythm generator viewtopic.php?t=43775
I'm afraid I don't have a drawn up schematic / PCB / Kit at the moment.
I've attached the code, which is VERY hacky and full of inconsistent comments.
Schematic fragments:
The LED Matrix is controlled by a Max7219 chip (They're expensive, but Maxim sent me two samples for free) using the schematic here: http://tronixstuff.wordpress.com/2010/0 ... driver-ic/
The arduino board is based on the LadyAda Boarduino schematic: http://www.ladyada.net/make/boarduino/download.html
The hackiest bit is the encoder reading code, which just about works. The connection pins are described in the code.
Happy to answer any questions.
I'm afraid I don't have a drawn up schematic / PCB / Kit at the moment.
I've attached the code, which is VERY hacky and full of inconsistent comments.
Schematic fragments:
The LED Matrix is controlled by a Max7219 chip (They're expensive, but Maxim sent me two samples for free) using the schematic here: http://tronixstuff.wordpress.com/2010/0 ... driver-ic/
The arduino board is based on the LadyAda Boarduino schematic: http://www.ladyada.net/make/boarduino/download.html
The hackiest bit is the encoder reading code, which just about works. The connection pins are described in the code.
Happy to answer any questions.
- Attachments
-
- euclidean_5_1.zip
- Arduino source code - perhaps rename to .pde extension if you're not on Arduino 1.0 yet
- (5.53 KiB) Downloaded 307 times
- clarke68
- Making DIY modulars look cool since 2011
- Posts: 1584
- Joined: Wed Nov 11, 2009 2:44 am
- Location: Bay Area, CA
- Contact:
Re: Euclidean Polyrhythm generator - code and details
Understandable, but do you have any plans/hopes/dreams of putting something out? Just want to make sure you know you've got at lest one customer right here.Tombola wrote:I'm afraid I don't have a drawn up schematic / PCB / Kit at the moment.

- beautyofdecay_
- no maps for this area
- Posts: 343
- Joined: Sun Feb 27, 2011 2:26 pm
- Location: Netherlands
Re: Euclidean Polyrhythm generator - code and details
clarke68 wrote:Understandable, but do you have any plans/hopes/dreams of putting something out? Just want to make sure you know you've got at lest one customer right here.Tombola wrote:I'm afraid I don't have a drawn up schematic / PCB / Kit at the moment.
pcb kit would be awesome, but even having the schematics handy so i could breadboard this in the meantime would be fanfuckingtastic.
- nerdware
- Super Deluxe Wiggler
- Posts: 1527
- Joined: Mon Jul 06, 2009 9:19 am
- Location: London, UK
- Contact:
I don't know if I'd be interested in this as hardware, but I've had some fun today using this idea in Haskore. Thanks!
https://vimeo.com/user2264453
CANNOT DIY. WILL NOT DIY. DO NOT WANT.
CANNOT DIY. WILL NOT DIY. DO NOT WANT.
- Tombola
- Super Deluxe Wiggler
- Posts: 1879
- Joined: Sun Jan 23, 2011 11:33 am
- Location: London, England
The code would compile & run, but you'd need to wire up the encoders (or probably more sensibly replace with pots and rework the code). It would probably just work without the LED matrix
Music Thing Modular
Radio Music Details | FAQ & Troubleshooting | Video & Audio demos | Buy
Mikrophonie | Spring Reverb | Turing Machine Expanders | Turing Machine
Music Thing Module Generator®
Radio Music Details | FAQ & Troubleshooting | Video & Audio demos | Buy
Mikrophonie | Spring Reverb | Turing Machine Expanders | Turing Machine
Music Thing Module Generator®
- Spandex
- Lovely cloakroom, lovely cloaks
- Posts: 245
- Joined: Sun Oct 16, 2011 7:48 am
- Location: Nottingham, UK
Thanks for sharing the code Tom.
I took the euclidean fn from your code and wrote one that does multiple simultaneous outs. So you can get the 4,5,6,7 etc patterns simultaneously.
Vid here, it's clocked off a noisering.. then the various euclidean patterns are triggering envs and interacting n wotnot.
[video][/video]
In fact.. I used your fn to just pre-calculate a load of them (for 1-16) and then it uses those without calling the fn again. Thinking about it further, I realised that it'd be very easy to just precalculate all the lengths/divisions I'm likely to need and store them in a few hundred bytes
The module is a stack of jacks and pots that @monobass made (with an identical one he's keeping, thanks Steev!) so we can fiddle around with arduino-based eurorack stuff. It uses an IDE cable to connect to a breakout board, which is some headers taped onto a plastic lid at the moment. It's a LOT of fun.
I took the euclidean fn from your code and wrote one that does multiple simultaneous outs. So you can get the 4,5,6,7 etc patterns simultaneously.
Vid here, it's clocked off a noisering.. then the various euclidean patterns are triggering envs and interacting n wotnot.
[video][/video]
In fact.. I used your fn to just pre-calculate a load of them (for 1-16) and then it uses those without calling the fn again. Thinking about it further, I realised that it'd be very easy to just precalculate all the lengths/divisions I'm likely to need and store them in a few hundred bytes

The module is a stack of jacks and pots that @monobass made (with an identical one he's keeping, thanks Steev!) so we can fiddle around with arduino-based eurorack stuff. It uses an IDE cable to connect to a breakout board, which is some headers taped onto a plastic lid at the moment. It's a LOT of fun.
- Thonk Support
- aka Monobass
- Posts: 8830
- Joined: Fri May 29, 2009 5:39 pm
- Location: Brighton, UK
Yeah I should have made mine first ;)
Thonk - CLICK HERE - Modular Synth DIY + Eurorack Accessories Store
AS of October 2020 this account which used to go by the name of Monobass is now manned by various staff at Thonk.
AS of October 2020 this account which used to go by the name of Monobass is now manned by various staff at Thonk.
- Spandex
- Lovely cloakroom, lovely cloaks
- Posts: 245
- Joined: Sun Oct 16, 2011 7:48 am
- Location: Nottingham, UK
yeah, we figured that we'd spend the extra and get more channels. then monobass did a load of soldering with that IDE cable so we have plenty of scope for getting stuff in and out of the eurorack, while keeping the arduino on the desk.
i guess at some point, the idea might be to make a standalone module with an embedded chip. for the moment though, we'll probably just have it as something we can reprogram on a whim.
i guess at some point, the idea might be to make a standalone module with an embedded chip. for the moment though, we'll probably just have it as something we can reprogram on a whim.
That is very cool!
just a little note on the 7219. if you use the 7221 it is less noisy because it ramps the power to the LEDs it can use the same code (even thoguh it says SPI, it works with serial as well)
and try to put it on a separate regulator, not your main 5v supply if you have one. it puts a lot of noise back in the power supply.
just a little note on the 7219. if you use the 7221 it is less noisy because it ramps the power to the LEDs it can use the same code (even thoguh it says SPI, it works with serial as well)
and try to put it on a separate regulator, not your main 5v supply if you have one. it puts a lot of noise back in the power supply.
- lightworks
- Wiggling with Experience
- Posts: 284
- Joined: Sat Oct 30, 2010 4:02 pm
- Location: portugal
Tom, I was looking into breadboarding this today, but I don't understand the switches you described.
Meanwhile I'll look at more of the code. Thanks for posting this interesting project!
Does this mean two regular pushbutton switches on A1 and A2, plus three switches on the encoders which are all connected to A0? Will encoders without switches work, or can I substitute another pushbutton? Do you have the A1, A2 switches also connected between +5V and ground through 15k resistors? And what is "spare jack out"?Tombola wrote: Switches / misc
encoder switch = A0
reset switch = A1
pulse input = A2
spare jack out = A3
15k resistor ladder around 3 push button switches
+5v -- 15k -- switch -- 15k -- switch -- 15k -- switch -- 15k -- GND
Other ends of switches going to Analog in 0
Meanwhile I'll look at more of the code. Thanks for posting this interesting project!