Euclidean Polyrhythm generator - code and details

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, Joe.

Post Reply
User avatar
Tombola
Super Deluxe Wiggler
Posts: 1879
Joined: Sun Jan 23, 2011 11:33 am
Location: London, England

Euclidean Polyrhythm generator - code and details

Post by Tombola » Mon Oct 31, 2011 7:04 am

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.
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

Jarno
Super Deluxe Wiggler
Posts: 2820
Joined: Mon Nov 15, 2010 6:34 am
Location: Rosmalen, NL

Post by Jarno » Mon Oct 31, 2011 10:00 am

That's great Tombola, I was hoping you'd share the code.
Really keen on seeing how you did it.

User avatar
chinard
Super Deluxe Wiggler
Posts: 2416
Joined: Tue Aug 12, 2008 12:57 pm
Location: Toronto

Post by chinard » Mon Oct 31, 2011 10:13 am

awesome, i cant wait to try this out

User avatar
sduck
experimental use of gravity
Posts: 14164
Joined: Wed Feb 18, 2009 6:03 pm
Location: Vortepexaion, TN, USA

Post by sduck » Mon Oct 31, 2011 12:44 pm

Don't know why you didn't post the original thread here. Looks like a great device - may have to look into this!
flickr cloud of sound touyube NOT A MODERATOR ANYMORE

User avatar
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

Post by clarke68 » Mon Oct 31, 2011 1:01 pm

Tombola wrote:I'm afraid I don't have a drawn up schematic / PCB / Kit at the moment.
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. :tu:

User avatar
beautyofdecay_
no maps for this area
Posts: 343
Joined: Sun Feb 27, 2011 2:26 pm
Location: Netherlands

Post by beautyofdecay_ » Mon Oct 31, 2011 2:11 pm

That looks great!
This would be an excellent addition to fill some of the empty spaces in my SDIY Buchlaesque modular :mrgreen:

I have to read up on this stuff.

Thanks!

User avatar
chinard
Super Deluxe Wiggler
Posts: 2416
Joined: Tue Aug 12, 2008 12:57 pm
Location: Toronto

Re: Euclidean Polyrhythm generator - code and details

Post by chinard » Mon Oct 31, 2011 2:27 pm

clarke68 wrote:
Tombola wrote:I'm afraid I don't have a drawn up schematic / PCB / Kit at the moment.
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. :tu:

pcb kit would be awesome, but even having the schematics handy so i could breadboard this in the meantime would be fanfuckingtastic.

User avatar
JJ
Veteran Wiggler
Posts: 631
Joined: Sat May 08, 2010 10:46 am
Location: Turku, Finland, EU

Post by JJ » Mon Oct 31, 2011 3:01 pm

Very cool. Pcb/kit would interst me too!

User avatar
nerdware
Super Deluxe Wiggler
Posts: 1527
Joined: Mon Jul 06, 2009 9:19 am
Location: London, UK
Contact:

Post by nerdware » Mon Oct 31, 2011 3:07 pm

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.

User avatar
thedug
Wiggling with Experience
Posts: 292
Joined: Wed Aug 31, 2011 3:31 pm
Location: Austin, TX

Post by thedug » Mon Oct 31, 2011 10:24 pm

Yes.. schematic or pcb would be awesome!

User avatar
thedug
Wiggling with Experience
Posts: 292
Joined: Wed Aug 31, 2011 3:31 pm
Location: Austin, TX

Post by thedug » Mon Oct 31, 2011 10:25 pm

Do you think this code would run on the ardcore? It uses a nano.

User avatar
Tombola
Super Deluxe Wiggler
Posts: 1879
Joined: Sun Jan 23, 2011 11:33 am
Location: London, England

Post by Tombola » Tue Nov 01, 2011 2:20 am

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

User avatar
Spandex
Lovely cloakroom, lovely cloaks
Posts: 245
Joined: Sun Oct 16, 2011 7:48 am
Location: Nottingham, UK

Post by Spandex » Thu Jan 12, 2012 6:40 pm

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.

User avatar
Thonk Support
aka Monobass
Posts: 8830
Joined: Fri May 29, 2009 5:39 pm
Location: Brighton, UK

Post by Thonk Support » Thu Jan 12, 2012 6:45 pm

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.

User avatar
Spandex
Lovely cloakroom, lovely cloaks
Posts: 245
Joined: Sun Oct 16, 2011 7:48 am
Location: Nottingham, UK

Post by Spandex » Thu Jan 12, 2012 6:48 pm

hehehe. i'd never have got mine if you had :) it's really great. ta.

User avatar
haima
Veteran Wiggler
Posts: 750
Joined: Sat Dec 25, 2010 6:33 pm
Location: Melbourne, Australia

Post by haima » Thu Jan 12, 2012 6:51 pm

Spandex: nice work!

Is that a Arduino Mega?

User avatar
Spandex
Lovely cloakroom, lovely cloaks
Posts: 245
Joined: Sun Oct 16, 2011 7:48 am
Location: Nottingham, UK

Post by Spandex » Thu Jan 12, 2012 6:53 pm

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.

User avatar
haima
Veteran Wiggler
Posts: 750
Joined: Sat Dec 25, 2010 6:33 pm
Location: Melbourne, Australia

Post by haima » Thu Jan 12, 2012 6:58 pm

Very cool. I think i'll have to give something like this a try. Thanks for the ideas!

User avatar
Neutron7
Oldschool bleeper
Posts: 1968
Joined: Sun May 23, 2010 12:24 pm

Post by Neutron7 » Thu Jan 12, 2012 10:30 pm

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.

User avatar
lightworks
Wiggling with Experience
Posts: 284
Joined: Sat Oct 30, 2010 4:02 pm
Location: portugal

Post by lightworks » Thu Feb 09, 2012 4:27 pm

this looks great!
any plans to post the schematic?

ThomasVanTa
Learning to Wiggle
Posts: 15
Joined: Mon Jun 04, 2012 5:01 pm

Post by ThomasVanTa » Tue Jun 05, 2012 12:26 pm

Awesome!, Thanks

User avatar
CJ Miller
Super Deluxe Wiggler
Posts: 4256
Joined: Thu Apr 28, 2011 3:10 pm
Location: Mumfordshire

Post by CJ Miller » Wed Aug 08, 2012 4:36 pm

Tom, I was looking into breadboarding this today, but I don't understand the switches you described.
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
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"?

Meanwhile I'll look at more of the code. Thanks for posting this interesting project!

User avatar
o-live
Common Wiggler
Posts: 66
Joined: Thu Nov 24, 2011 6:08 am
Location: in space without space

Post by o-live » Thu Aug 23, 2012 3:42 pm

any plans to post the schematic?
same question ;)

User avatar
nerdware
Super Deluxe Wiggler
Posts: 1527
Joined: Mon Jul 06, 2009 9:19 am
Location: London, UK
Contact:

Post by nerdware » Thu Aug 23, 2012 4:59 pm

https://vimeo.com/user2264453
CANNOT DIY. WILL NOT DIY. DO NOT WANT.

User avatar
o-live
Common Wiggler
Posts: 66
Joined: Thu Nov 24, 2011 6:08 am
Location: in space without space

Post by o-live » Thu Aug 23, 2012 8:51 pm

cool project but i really prefer the tombola project :)

Post Reply

Return to “Music Tech DIY”