electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software
DIY Euclidean Polyrhythm Generator
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 2 [36 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Fri Feb 07, 2014 7:04 am    Post subject: DIY Euclidean Polyrhythm Generator
Subject description: for ~$20
Reply with quote  Mark this post and the followings unread

Overview:

A couple a years ago, a guy called Tombola made a Euclidean Polyrhythm generator for Arduino. The documentation was very sparse and the code was rough: http://www.muffwiggler.com/forum/topic-45485.html

Here's the original video demo from then:




I cleaned up Tombola's code somewhat, added Offset controls and imported a much better encoder-reading library. Now the encoders work great! I also made a schematic and included much-needed diode input-protection.


[FEB 2015 UPDATE]


User Interface:

When the rhythms are playing, the display flips between page 1 (steps 1-8 ) and page 2 (steps 9-16).

Here's what the display shows...

Row 1: What step is Output 1 playing
Row 2: Output 1 Pattern (steps 1-8 or 9-16)

Row 3: What step is Output 2 playing
Row 4: Output 2 Pattern (steps 1-8 or 9-16)

Row 5: What step is Output 3 playing
Row 6: Output 3 Pattern (steps 1-8 or 9-16)

Row 7: Which channel is selected

- 2 dots on the left for Channel 1
- 2 dots in the middle for Channel 2
- 2 dots on the right for Channel 3


Row 8: Current triggers

1. Input trigger
2. -
3. Output 1 trigger
4. Output 1 off-beat trigger (all the steps when Output 1 isn't playing)
5. Output 2 trigger
6. -
7. Output 3 trigger
8. -


- When you have Channel 1 selected and you rotate the N- and K- and Offset knobs, Rows 1 and 2 will respectively show the pattern length (N), pattern density (K) or Offset (O).

The same goes for Channel 2 (Rows 3 and 4) and Channel 3 (Rows 5 and 6)

- Rotating the Offset encoder clockwise rotates the steps up to one full rotation.

Example:

X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - Original 16-step pattern (N = 16, K = 1)
0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - Offset of 1
0 0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - Offset of 2
0 0 0 X 0 0 0 0 0 0 0 0 0 0 0 0 0 - Offset of 3
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X - Offset of 15
X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - Offset of 16



Updated Code:

http://sneak-thief.com/modular/Tombola_Euclidean_v0.5.zip
(Arduino sketch, LED & Midi libraries & schematic)

Notes:

- I included a modified LED library in case you have an LED-matrix which runs backwards.

- Tombola's code doesn't always recall the flash memory properly when rebooted

These two libraries are included:

- LedControl (or LedControl2 in my zip for led matrices that run backwards)
http://playground.arduino.cc/Main/LedControl

- Encoder
http://www.pjrc.com/teensy/td_libs_Encoder.html



Parts (about $20 USD):

$1.80 USD - LED Matrix
$2.88 USD - Arduino Nano with USB
$4.88 USD - 5 encoders (you only need 3 but 3 separate are about the same price)

http://www.ebay.com/itm/1pcs-MAX7219-dot-matrix-module-Arduino-microcontroller-module-DIY-KIT-M67-/291289140410?pt=LH_DefaultDomain_0&hash=item43d22f8cba

http://www.ebay.com/itm/Nano-V3-0-ATmega328P-Improve-Controller-Board-XTWduino-USB-Driver-For-Arduino-/391000702325?pt=LH_DefaultDomain_0&hash=item5b09753d75

http://www.ebay.com/itm/5PCS-Rotary-encoder-with-switch-EC11-Audio-digital-potentiometer-handle-20mm-/181356150848?pt=LH_DefaultDomain_0&hash=item2a39ab4040


The rest I recommend ordering from Tayda for about $5:

- 6x 5.1V Zener diodes (protects inputs by limiting voltages both over and under 0-5V)
- 6x 200 Ohm resistors (one for each input/output)
- 6x Jacks (4 gates outs, 1 clock in, reset in)
- SPST button (if you want a reset switch)
- 4x 15k resistors

Extras: There's a possibility of adding another 4 analog/digital ins for future CV/gate usage. for CV control, I recommend using 2x 1N5819's per CV input. I'll draw a schematic for that later.



Schematics and Hardware:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Posted Image, might have been reduced in size. Click Image to view fullscreen.



SVG Panel file:

http://sneak-thief.com/modular/Tombola-Euclid-Panel.svg

Posted Image, might have been reduced in size. Click Image to view fullscreen.

I put A, B, C & D as placeholders for whatever inputs make sense. I decided to set mine to gate inputs for density and length:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

_________________
Sneak-Thief - raw electrofunk

Last edited by sneakthief on Yesterday, at 5:24 am; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website
inlifeindeath



Joined: Apr 02, 2010
Posts: 315
Location: Albuquerque, NM

PostPosted: Fri Feb 07, 2014 1:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

looks awesome, thanks for sharing!
looking forward to building one!

_________________
http://www.youtube.com/user/borisandfef
Back to top
View user's profile Send private message Visit poster's website
AuDioMiRage



Joined: Jan 14, 2015
Posts: 6
Location: Wisconsin

PostPosted: Mon Feb 02, 2015 7:36 am    Post subject: Anyone completed this? :?:
Subject description: Problems with LED Matrix
Reply with quote  Mark this post and the followings unread

This is a fantastic project. I've managed to assemble the hardware parts, but the software is another issue. Checked rotary encoders, they are good. Some data is getting to the display, but it is garbled. Swapped MAX72xx chips = same problem. Swapped LED Matrix = same problem.
Not familiar with editing library for Arduino, suspecting that now is the time to learn.
Any help will be greatly appreciated.
Back to top
View user's profile Send private message
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Mon Feb 02, 2015 8:09 am    Post subject: Reply with quote  Mark this post and the followings unread

I just updated the schematic and software in the first post - here's the parent thread:

https://www.muffwiggler.com/forum/post-1786613.html#1786613

_________________
Sneak-Thief - raw electrofunk

Last edited by sneakthief on Mon Feb 02, 2015 11:03 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Mon Feb 02, 2015 10:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Please post a pic of your board showing the pin connections and wires to the display.

A pic of your display would help too.

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
AuDioMiRage



Joined: Jan 14, 2015
Posts: 6
Location: Wisconsin

PostPosted: Tue Feb 03, 2015 11:58 pm    Post subject: Display Issue Fixed :D Reply with quote  Mark this post and the followings unread

Very Happy I swapped the display board and it works! Very Happy
Haven't "ohmed" out the board yet to find it's problem, just enjoying the fact that this module is working!
Thanks sneakthief for your help.
I will post some pic and samples when I get it all wrapped up.
Back to top
View user's profile Send private message
commathe



Joined: Jul 26, 2013
Posts: 144
Location: Beijing
Audio files: 5

PostPosted: Wed Feb 04, 2015 3:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Wow! I've been writing off the arduino for far too long
Back to top
View user's profile Send private message
yusynth



Joined: Nov 24, 2005
Posts: 1250
Location: France

PostPosted: Sun Mar 01, 2015 10:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Cool stuff indeed
_________________
Yves
Back to top
View user's profile Send private message Visit poster's website
ericcoleridge



Joined: Jan 16, 2007
Posts: 888
Location: NYC

PostPosted: Mon Mar 23, 2015 1:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

man, this looks amazing

for some reason I've never yet made a micro controller project of any kind-- but I think this is the one that's gonna get me started.

thanks for posting
Back to top
View user's profile Send private message
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Wed Apr 29, 2015 8:43 am    Post subject: Reply with quote  Mark this post and the followings unread

Very cool stuff
I start to build one now !!
Thanks
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Sat May 02, 2015 7:06 am    Post subject: Reply with quote  Mark this post and the followings unread

ok ,it's don't work .... Smile
I'm not sure about the pin out of the encoder to wiring them ?

I Bought the stuff on the e-bay link shown at the top of this topic, it's low cost, but no explainations, no paper, no datasheet ...
And on the encoder the ABC are not show. ....

I search but there is different pinout possible ...
Is anyone know the good way ? Smile
Thanks
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Sat May 02, 2015 7:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Please post a picture of your board and encoders.

The side with 2 pins is the switch.

On the side with the 3 pins, the middle pin is usually the common (C).

The other 2 are A and B. If it doesn't work one way, then reverse those 2 wires.

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Sat May 02, 2015 7:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Waouuu your are so quick to answer ... Very Happy

Thank for the answer.
I Plug as you tell ...
But There is another problem, because the matrix still showthe same "picture" and don't move ...
Here is my picture.

Thanks for helping Very Happy


DSC00946.JPG
 Description:
 Filesize:  798.61 KB
 Viewed:  17 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

DSC00946.JPG


Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Sat May 02, 2015 9:28 am    Post subject: Reply with quote  Mark this post and the followings unread

Still looking for a solution... Smile

I solder all the wire on a male connector to be sure that the connection in the Arduino is good.

I send a LFO in the trig in ...
I swap the 3 encoder wire ...

I probably miss something ...

The night bring me some advices Very Happy
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Sat May 02, 2015 10:12 am    Post subject: Reply with quote  Mark this post and the followings unread

Your display is showing a problem! Somehow I think it's connected wrong.
_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Sat May 02, 2015 1:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

I see you have an Uno.

The original program is for an Arduino Nano, so maybe there are some pins that are different.

All I know is that when the display shows that pattern, it means that the data it's receiving is scrambled,

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Sun May 03, 2015 1:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello
Thanks for answering Smile
I tried on a uno because I didn't have a nano ... and It'was a mistake
I checked the differences between uno and nano.

I thought it was the same ATmega328 ...
But not .... Embarassed

UNO : ATMega328p - pu : http://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
NANO : ATMega 328 : http://www.arduino.cc/en/uploads/Main/ArduinoNano30Schematic.pdf

And you've right, some pins are not exactly at the sameplace.
So this projetct couldn't work on a uno without changing the code.

I'll found a nano and try again. Rolling Eyes

Thank You !! Very Happy
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Mon May 04, 2015 1:53 am    Post subject: Reply with quote  Mark this post and the followings unread

dub halley: Can you try to CAREFULLY unplug the LED matrix from the PCB and rotate it 180 degrees?

Does the display show anything different?

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Mon May 04, 2015 12:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

ok,I did that and ... "black screen" so it was on the good way.

Thanks for helping Very Happy
Tomorrow I hope to have time to go to my favourite electronic shop and buy a nano.

Nevertheless I'm sure it's possible to modify the code and adapt the good pins.
But I'm not a good "code man" Very Happy

I'll try with the good board and show you the result !!
Thanks Very Happy
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Fri May 08, 2015 7:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello
Ok, it's work better with the nano ... Very Happy

Now the row of leds look like the video above.
And when I turn the potentiometer I see some change in the matrix

Thanks you sneak-thief Very Happy thumb up

I'll put all this stuff on a module and show you (and anyone who want) the result !!!!
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Fri May 08, 2015 7:57 am    Post subject: Reply with quote  Mark this post and the followings unread

Good news - I'm glad it worked.

Félicitations Smile

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Sun May 10, 2015 7:06 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello

It's work good ! happy smoker

First I want to say thanks to Sneakthief and Tombola for this good job !! thumb up
I did a smal video with the out of the euclidean in 1V/oct of my VCOZ3000
euclidean.mpg

Then if someone want to realise this project.

Encoders
The picture encoder.png show how I have solder the wires.
Because if you buy the ebay stuff, there is no sign on it to know which is the ABC.
And the for the two others you can't do mistake.

Matrix
As well there is no "good" mark to know the good way to plug it.
There is a reference number on it. picture matrix.jpg
I put this reference next to FC-16 DISY1. At the opposite of IN / OUT
picture board.jpg

PCB
I don't think a pcb is indispensable.
I did the circuit on a perfboard picture perfboard.jpg
It was just to test, I'll correctly wire this stuff to put on a module. Very Happy

Upgrade:
It could be good to add a 555 LFO like here :
http://www.555-timer-circuits.com/metronome.html
It allow you to save a LFO on your modular.
And it's possible to plug the LFO with a switch jack, so, without some jack in trig, you use the 555 and when you plug a jack, the 555 is disable.


Encoder.png
 Description:
 Filesize:  1.48 MB
 Viewed:  9 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Encoder.png



matrix.JPG
 Description:
 Filesize:  701.11 KB
 Viewed:  3 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

matrix.JPG



perfboard.JPG
 Description:
 Filesize:  789.6 KB
 Viewed:  4 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

perfboard.JPG



board.JPG
 Description:
 Filesize:  831.47 KB
 Viewed:  4 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

board.JPG



Euclidean.MPG
 Description:

Download
 Filename:  Euclidean.MPG
 Filesize:  11.22 MB
 Downloaded:  15 Time(s)

Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Sun May 10, 2015 7:51 am    Post subject: Reply with quote  Mark this post and the followings unread

I notice your display is going backwards.

Try my alternate Matrix firmware in the zip archive. It's called LedControl2.

Erase the LedControl folder and rename LedControl2 to LedControl.

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
dub halley



Joined: Dec 22, 2010
Posts: 17
Location: Rennes, FRANCE

PostPosted: Sun May 10, 2015 9:36 am    Post subject: Reply with quote  Mark this post and the followings unread

ok, I'll test that when i finished my front panel ...
Everything is unplug .... Embarassed

I've got some questions : Wink
1 - On the schema there are 6 jacks, and on your module there are 10 ??

2 - I'm not sure to understand what the offbeat is ?

Thanks Very Happy
Back to top
View user's profile Send private message Visit poster's website
sneakthief



Joined: Jul 24, 2006
Posts: 557
Location: Berlin

PostPosted: Sun May 10, 2015 9:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Offbeat: play a beat every on step that trigger #1 does NOT play.

Re. My extra jacks: as I wrote above in the front panel description " Extras: There's a possibility of adding another 4 analog/digital ins for future CV/gate usage. for CV control, I recommend using 2x 1N5819's per CV input. I'll draw a schematic for that later.

...I put A, B, C & D as placeholders for whatever inputs make sense. I decided to set mine to gate inputs for density and length"

_________________
Sneak-Thief - raw electrofunk
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 2 [36 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use