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
daynehacks
Common Wiggler
Posts: 156
Joined: Sun Sep 06, 2015 12:52 pm
Location: Grand Forks, BC
Contact:

Post by daynehacks » Thu Aug 31, 2017 10:33 am

It means add // in front of the if and end bracket ( } ) where it says something about writing to eeprom and upload the code. It should rewrite the eeprom, and then you could change it back to normal and re upload the code.

I didn't look at the code though, but thats what its saying.

You could also upload the "clear eeprom" sketch in the arduino examples.

klangbauer
Common Wiggler
Posts: 81
Joined: Wed May 29, 2013 3:52 am
Location: Germany

Post by klangbauer » Sun Sep 03, 2017 8:09 am

I fix it.
First I reseted eprom (clear eeprom) and second flashed euclidian code again.

It works.
After several restarts it is working and channel 1 offset seems to be stabel.

Thank you all for help.

ProducerMatt
Learning to Wiggle
Posts: 35
Joined: Sun Sep 03, 2017 3:19 pm
Location: Dallas, Texas

Post by ProducerMatt » Sun Sep 03, 2017 5:04 pm

Awesome work! We need more algorithmic sequencers and rhythm generators in the world. :) You never know what you're going to get.

klangbauer
Common Wiggler
Posts: 81
Joined: Wed May 29, 2013 3:52 am
Location: Germany

Post by klangbauer » Tue Sep 05, 2017 2:20 pm

want more?

Logistic Equation:
Chaotic, self similar, smooth and endless changing melodies:


klangbauer
Common Wiggler
Posts: 81
Joined: Wed May 29, 2013 3:52 am
Location: Germany

Post by klangbauer » Sat Sep 09, 2017 5:39 am

How can encoder be adjusted for a slower response?
I like to get one implus for each step.

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Sat Nov 04, 2017 3:50 pm

[video][/video]

I've been working on adding MIDI to the Euclidian Sequencer. Here's a video that shows how I set up MIDI programing using the 3 encoders and the bottom 2 rows of the LED matrix.

Not shown is setting up the MIDI channel. It's set using Encoder 1 and is global for all 4 sequencer channels. Is there any reason to have the MIDI channel set differently for each sequencer row?

Still a bit buggy, but moving along

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Sun Dec 31, 2017 6:38 pm

If anyone is interested in trying out the code I'm working on, here's a download link.

I've added MIDI out, which at a minimum you can implement with 2 resistors and a MIDI out jack. MIDI is sent from PIN 1 (TX) on the Arduino. https://www.arduino.cc/en/Tutorial/Midi The MIDI out should be buffered with a TTL gate, but it'll work with just the resistors

Also I've added patch storage. There are 8 storage locations to keep sequence and MIDI setups.

The enclosed READ ME has instructions for using the MIDI setup and Patch store/recall.

I also tweeked the way the Arduino ADC runs, greatly speeding up the response time, as well as a few other minor tweeks.

If anyone tries it, let me know what you think...
Attachments
Tombola Euclidian with MIDI and Storage.zip
Euclidian Polyrhythm with MIDI and Patch Storage
(82.7 KiB) Downloaded 50 times

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Mon Apr 23, 2018 7:27 pm

I'm setting up a page on my web site for the 4U Euclidean Sequencer. The code for the euro synisi board is available there along with a working-on-it version of the user guide that shows how to use the MIDI and Patch storage modes.

http://clsound.com/euclideansequenc.html

User avatar
charonme
Wiggling with Experience
Posts: 327
Joined: Tue Mar 11, 2014 3:35 am
Location: BA, Slovakia (EU)

Post by charonme » Tue Aug 07, 2018 4:02 am

polyrhythm or polymeter?
spotify, bandcamp
Heptaphasis - DIY 3HP 7-phase quadrature sine LFO

User avatar
masterofstuff124
Wiggling with Experience
Posts: 396
Joined: Mon Aug 03, 2015 11:04 pm
Location: Miami

Post by masterofstuff124 » Tue Aug 07, 2018 9:27 am

^yes

torc_belgium
1-Post Wiggler
Posts: 1
Joined: Tue Jan 22, 2019 10:36 am
Location: Belgium

Post by torc_belgium » Tue Jan 22, 2019 10:46 am

I only got into eurorack recently but the Stoicheia was one of my first purchases. I LOVE its sound.

Now getting into synth DIY, I also built a breakout board that takes output signals from the Stoicheia and translates them to MIDI to drive the TR-09 roland drum machine! Euclidian 909 beats, definitely has a fresh feeling to it :razz:

Also been learning a lot from looking at the RT schematics. I'm considering them my learning milestones somehow.

User avatar
Catfish
Learning to Wiggle
Posts: 13
Joined: Wed Aug 08, 2012 12:50 pm

Post by Catfish » Sun Feb 24, 2019 8:07 am

Hi, I just recently stumbled uppon this thread and immediately started building my own on a breadboard. After some minor troubleshooting everything seems to work fine, both the original tombola/sneakthief version and the Craig Lee midi patch version. Except my LCD is running backwards and I seem unable to fix this. I tried all libraries, renaming the backward running folder, zip it and install through the IDE. It even seems that the programs don't recognize the added LedControl libraries. In the code in the IDE , the include LedControl, are grey, while include Encoder is orange. If I install LedControl through the IDE, by searching libraries>install, the 'include LedControl' turns orange. But I guess this is the wrong librarie for my backward running matrix.
As I said I tried all sorts of stuff and dont know what to do next. I know this is an old thread but I hope someone can point me in the right direction. Cheers, Roel

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Mon Feb 25, 2019 2:00 pm

Catfish,

I'm far from an Arduino expert but... are you changing the #include listing at the top of the arduino sketch? Delete the one there and do "Include" over again.

The sketch you download from me uses the backwards running LEDControl, maybe you need the forward running one.

User avatar
Catfish
Learning to Wiggle
Posts: 13
Joined: Wed Aug 08, 2012 12:50 pm

Post by Catfish » Mon Feb 25, 2019 2:54 pm

OK, it was not running backwards but behaving like this:
Altitude909 wrote:So I am having some issues, It's not behaving at all like the one in the video, the rows are offset. The indicator row on mine is on the top row, not the bottom..

[video][/video]
Strangely enough, after uploading the code for the NTH time, it now displays as it should. Something got messed up with the LedControl library, but I tried all severall times. Anyhow,it's working now and I'll save this one too as it was the solution for altitude909 and daynehacks ;
daynehacks wrote:Me again, I used the LedControl library from here: https://github.com/wayoda/LedControl/releases

and the led matrix works as it should.

Now my encoders are just backwards.

EDIT: Flipped around the encoder numbers (lines 154-156) in the sketch to get my encoders going the right directions and now everything is golden!

User avatar
Catfish
Learning to Wiggle
Posts: 13
Joined: Wed Aug 08, 2012 12:50 pm

Post by Catfish » Mon Feb 25, 2019 3:00 pm

CLee wrote:Catfish,

I'm far from an Arduino expert but... are you changing the #include listing at the top of the arduino sketch? Delete the one there and do "Include" over again.

The sketch you download from me uses the backwards running LEDControl, maybe you need the forward running one.
Aha, maybe this was the solution cause I thought I used the 'original normal' library last time I uploaded the code. Anyway thanks very much for the answer!

User avatar
Catfish
Learning to Wiggle
Posts: 13
Joined: Wed Aug 08, 2012 12:50 pm

Post by Catfish » Tue Feb 26, 2019 1:33 pm

After playing a lot with this wonderfull device, I noticed that the Tombola/Sneakthief with midi and patch version from CLee, missed a trigger once in while. I couldn't get it to sync straight for more than 1 minute or so. If I give it a reset every 4 bars it is totally do-able and funky to play with.
But after I uploaded Tombola/Sneakthief's 0.7 version again the sequencer synced far better.
I red in the beginning of the thread that Sneakthief had the same missing trigger issues with Tombola's first version and it disappeared after using the encoder library.
For now I use Tombola/sneakthief 0.7, but I really liked the midi options from CLee, does anyone recognise this syncing issue, or maybe have a solution?

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Tue Feb 26, 2019 4:10 pm

Catfish wrote:After playing a lot with this wonderfull device, I noticed that the Tombola/Sneakthief with midi and patch version from CLee, missed a trigger once in while. I couldn't get it to sync straight for more than 1 minute or so. If I give it a reset every 4 bars it is totally do-able and funky to play with.
But after I uploaded Tombola/Sneakthief's 0.7 version again the sequencer synced far better.
I red in the beginning of the thread that Sneakthief had the same missing trigger issues with Tombola's first version and it disappeared after using the encoder library.
For now I use Tombola/sneakthief 0.7, but I really liked the midi options from CLee, does anyone recognise this syncing issue, or maybe have a solution?
That's really odd. I never had that problem while testing the syinsi schematic. I don't have a module with that circuit to test anymore but I'll look at the code and see if I can find an issue.

Anyone else using my code with this build? Have this problem?

What are you using for a clock catfish?

User avatar
Catfish
Learning to Wiggle
Posts: 13
Joined: Wed Aug 08, 2012 12:50 pm

Post by Catfish » Wed Feb 27, 2019 4:54 am

Ok sorry to bother you, I think it's my fault again. With compiling and playing with different versions, copy, pasting I always get a mess somehow.
I deleted all I downloaded before and tried with a new download. And the Tombola/Sneakthief version with midi and patch seems to sync very straight now! Superb.
I had a little issue cause when I unzipped the folder from your (CLee's) site, the folder in wich the "ino's" are, hasn't the same name as the sequencer ino file. So I renamed the folder : Tombola_Euclidean_Sequencer_with_MIDI_and_Patch_storage , same as the seq ino.
It's running very straight for a while now so I'm totally happy with it!
BTW, I'm using a breadbord version with 1k in- and output resistors and 5.1 zenerdiodes for protection, and I sync it with Pamela's NEW Workout witch is synced to my MIDIbox sequencer (through Expert Sleepers FH-1)
I'm soon gonna build into my rack.
Thanks all for building and sharing this wonderfull little sequencer!

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Wed Feb 27, 2019 9:34 am

Yeah! Glad it's working :guinness:

klangbauer
Common Wiggler
Posts: 81
Joined: Wed May 29, 2013 3:52 am
Location: Germany

Post by klangbauer » Wed Feb 27, 2019 5:11 pm

Try to compile your euro file with midi and storage I get :

exit status 1
'setupADC' was not declared in this scope

I'm not a Arduino spec, what I have to do?
Use Arduino 1.6 on PC or 1.8 on Linux.
Other Euclid.ino work.

Thank you

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Wed Feb 27, 2019 6:18 pm

klangbauer wrote:Try to compile your euro file with midi and storage I get :

exit status 1
'setupADC' was not declared in this scope

I'm not a Arduino spec, what I have to do?
Use Arduino 1.6 on PC or 1.8 on Linux.
Other Euclid.ino work.

Thank you
See catfish's post above. After un-zipping you need to rename the folder the sketch is in to "Tombola_Euclidean_Sequencer_with_MIDI_and_Patch_storage".

Sorry, this was my first dip into Arduino and I didn't realize renaming the folder would cause problems. If the IDE created a new folder you could also move all the .ino files into the new folder also.

klangbauer
Common Wiggler
Posts: 81
Joined: Wed May 29, 2013 3:52 am
Location: Germany

Post by klangbauer » Thu Feb 28, 2019 4:27 am

Thanks,
OK, names are right, but I have to put all attended files manually in the folder.
I'm not new in Arduino but still a beginner.

klangbauer
Common Wiggler
Posts: 81
Joined: Wed May 29, 2013 3:52 am
Location: Germany

Post by klangbauer » Fri Mar 01, 2019 4:43 am

LedControl.cpp.

When I running Clee Euclid version matrix is running upside down.
When running THX-sneak thief version it is running on opposite way.
I do have only one LED library in Arduino library folder.
I would like to know how it can be managed to change the LedControl.cpp for both version. Sometimes it is useful.

Any help?

User avatar
CLee
Super Deluxe Wiggler
Posts: 1782
Joined: Mon Apr 05, 2010 6:49 pm
Location: Chicago
Contact:

Post by CLee » Fri Mar 01, 2019 12:15 pm

klangbauer wrote:LedControl.cpp.

When I running Clee Euclid version matrix is running upside down.
When running THX-sneak thief version it is running on opposite way.
I do have only one LED library in Arduino library folder.
I would like to know how it can be managed to change the LedControl.cpp for both version. Sometimes it is useful.

Any help?
My code uses the same LED routines as the Tombola, I just expanded on his sketch. They shouldn't act differently. Make sure they're both using the same LED library. Which library you use probably depends on the LED matrix. I got mine at Tayda and use the backwards running LED library.

unauthorised-service
Learning to Wiggle
Posts: 33
Joined: Thu Jul 25, 2019 2:20 am
Location: Fife Scotland

Encoder stripboard

Post by unauthorised-service » Wed Aug 14, 2019 3:12 am

Encoder stripboard layout . Image
Image

Post Reply

Return to “Music Tech DIY”