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 » Mon Mar 13, 2017 7:20 pm

thx2112 wrote:I've been doing the same sort of tests.

Based on this information the latest revision of the PCB has BAT54S/current-limiting resistor instead of transistor.
Any chance you could post the schematic of these sections (for comparison), perhaps I can cobble something for my old rev board to work this newer way.

User avatar
nevetsokyeron
Wiggling with Experience
Posts: 306
Joined: Sat Mar 12, 2016 10:38 pm
Location: Austin TX
Contact:

Post by nevetsokyeron » Tue Mar 14, 2017 7:03 pm

thx2112 wrote:Any luck? I've been trying to (unsuccessfully) recreate the problem.

Are all of the trigger outs the same voltage?

Are all the related components the right value?

What's the voltage at the transistor end of the 10K resistor?
yes - all 3 trigger outs are the same voltage.
yes - all related components are the right values
Voltage going into the transistor is 5v. At the 10K it's hard to get a voltage reading with my multimeter. It looks similar to the pulse output of the transistor. I'll see if I can check it on my Zeroscope later.

Could the pulse voltage from the Nano be the problem? Which pin would I look at?

Note - I've got the Euclid2-20 PCB

User avatar
thx2112
Veteran Wiggler
Posts: 515
Joined: Sun Oct 12, 2014 10:10 am
Location: Earth, Sol, Orion Arm
Contact:

Post by thx2112 » Fri Mar 17, 2017 6:04 pm

If all of them are the same voltage, that suggests the voltage is wrong (but you said it's okay) or the transistor is wrong/flaky. But it's all outputs so that's doubtful unless all wrong transistors were installed.

The output from the Nano is the other side of that 10K resistor.

User avatar
daynehacks
Common Wiggler
Posts: 156
Joined: Sun Sep 06, 2015 12:52 pm
Location: Grand Forks, BC
Contact:

Post by daynehacks » Sun Mar 19, 2017 11:02 am

daynehacks wrote:
thx2112 wrote:I've been doing the same sort of tests.

Based on this information the latest revision of the PCB has BAT54S/current-limiting resistor instead of transistor.
Any chance you could post the schematic of these sections (for comparison), perhaps I can cobble something for my old rev board to work this newer way.

User avatar
thx2112
Veteran Wiggler
Posts: 515
Joined: Sun Oct 12, 2014 10:10 am
Location: Earth, Sol, Orion Arm
Contact:

Post by thx2112 » Thu Apr 06, 2017 3:40 pm

Sorry, I thought I answered this and just saw that I didn't. :doh:

Here's the schematic for the new PCB:

Image

The only differences are:

1. BAT54S instead of transistors on the outputs.

2. Circuitry for 3 analog/digital inputs or digital outputs, including jacks. These are wired to A5, A6, and A7 through previous expansion port (which is still there).

The code is exactly the same. Nothing has been done with the code except to verify that the new analog inputs work. The panels will also need new holes drilled for the jacks.

Image Image

Image Image

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Fri May 26, 2017 3:33 pm

If anyone is interested I have knocked up a pattern sequencer based on this hardware. It mostly mimics the Euclidean (and at some point I might try and bash the two together) so 3 tracks and an offbeat output that is the inverse of track 1.

The main differences are:
* The density control is now used to define a pattern.
* You have to hold down an encoder for ~2s (and release) to switch the active track - a quick click (and release) performs an edit action.

It is pretty simple at the moment and very much a work in progress, but my light weight testing suggests it is functional.

You can find it here on GitHub. The read me provides some more info on what the controls do.

If you do give it a go, please feel free to highlight any issues.

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Sun Jun 04, 2017 5:16 am

duff wrote:If anyone is interested I have knocked up a pattern sequencer based on this hardware. It mostly mimics the Euclidean (and at some point I might try and bash the two together) so 3 tracks and an offbeat output that is the inverse of track 1.

The main differences are:
* The density control is now used to define a pattern.
* You have to hold down an encoder for ~2s (and release) to switch the active track - a quick click (and release) performs an edit action.

It is pretty simple at the moment and very much a work in progress, but my light weight testing suggests it is functional.

You can find it here on GitHub. The read me provides some more info on what the controls do.

If you do give it a go, please feel free to highlight any issues.
I have made some updates to this, knocking a few items off my todo list along the way.

This sketch now supports (on a per track basis):
* Euclidean or programmed patterns
* Forwards, Backwards, Pendulum and Random play
* Clock divider
* Output width - Short Trigger, Matching Clock width or a Gate whilst the step is active

I have also changed the way a playing track displays. The the whole track is now visible with a cursor running along it. I'm not sure if I like this though so I might change it back to how the original euclidean worked or make this a selectable option.

As before, more detail is availablehere on GitHub

Note - This is still a work in progress so there may well be a bug or two in there that I have missed. If anyone is trying this please feel free to feed back issues, pain points, ideas etc..

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Wed Jun 07, 2017 11:08 am

Not sure if anyone is reading this, but if you are I have just added shuffle. This can be set on a track by track basis. It works on both internal and external clock sources and is similar to the shuffle on a 909. In my (probably biased view) it really livens up programmed and Euclidean sequences.

As before details on GitHub and feel free to feedback issues and ideas. I'm particularly interested in views on how the user interface could be improved to help make editing more informative. Although with an 8x8 led matrix the options are always going to somewhat limited.

User avatar
synthetek
Veteran Wiggler
Posts: 541
Joined: Fri Jun 05, 2015 3:32 am
Location: Orange County, California
Contact:

Post by synthetek » Wed Jun 07, 2017 3:55 pm

This works on the boards from Syinsi?

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Wed Jun 07, 2017 11:32 pm

synthetek wrote:This works on the boards from Syinsi?
Yes.

I started it as an alternative to the straight Euclidean sketch because I wanted to be able to program patterns, but i have now added everything the original did as well.

User avatar
nevetsokyeron
Wiggling with Experience
Posts: 306
Joined: Sat Mar 12, 2016 10:38 pm
Location: Austin TX
Contact:

Post by nevetsokyeron » Sun Jun 18, 2017 11:50 pm

duff wrote:Not sure if anyone is reading this, but if you are I have just added shuffle. This can be set on a track by track basis. It works on both internal and external clock sources and is similar to the shuffle on a 909. In my (probably biased view) it really livens up programmed and Euclidean sequences.

As before details on GitHub and feel free to feedback issues and ideas. I'm particularly interested in views on how the user interface could be improved to help make editing more informative. Although with an 8x8 led matrix the options are always going to somewhat limited.
NEAT! I'll give this a test run later in the week.

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Mon Jun 19, 2017 5:51 am

nevetsokyeron wrote:
duff wrote:Not sure if anyone is reading this, but if you are I have just added shuffle. This can be set on a track by track basis. It works on both internal and external clock sources and is similar to the shuffle on a 909. In my (probably biased view) it really livens up programmed and Euclidean sequences.

As before details on GitHub and feel free to feedback issues and ideas. I'm particularly interested in views on how the user interface could be improved to help make editing more informative. Although with an 8x8 led matrix the options are always going to somewhat limited.
NEAT! I'll give this a test run later in the week.
If you have any issues then please let me know - it all works for me, but I think I am the only one to have run it so far.

I added another feature that provides evolving or subtling differing steps sequences - somewhat inspired by the Turinging Machine. On each loop, on a track by track basis, it will randomly invert steps in the sequence. You can set a weighting as to how likely it is steps will be inverted (0 to 50%) and you can choose whether this random mutation is derived from original pattern, the current mutated pattern, or the inverse of the current mutation.

User avatar
nevetsokyeron
Wiggling with Experience
Posts: 306
Joined: Sat Mar 12, 2016 10:38 pm
Location: Austin TX
Contact:

Post by nevetsokyeron » Mon Jun 19, 2017 11:46 pm

A couple notes on trying duff's alternate firmware:

1. Arduino nano USB driver thingy causes a kernal panic on MacOS Sierra.
A fixed driver is here: https://github.com/adrianmihalko/ch340g ... s-x-driver

2. LEDcontrol and Encoder are not installed by default with Arduino so those need to be installed. Might make note of that in the readme. You probably already have these if you installed Tombola's firmware. (I did the install on a different machine and did not have these libs installed).

User avatar
thx2112
Veteran Wiggler
Posts: 515
Joined: Sun Oct 12, 2014 10:10 am
Location: Earth, Sol, Orion Arm
Contact:

Post by thx2112 » Wed Aug 02, 2017 9:39 am

That's great! I'll give it a try.

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

Post by klangbauer » Fri Aug 11, 2017 11:06 am

Two issuse in my Euclidian Sequencer V2:1.05 dfsg2-4:

Offset is not working on Seq 1 (only one time after start up). Other channels are working.

To stop a sequence: Lenth and Events (N and K) has to be zero.
Output LED is still flashing. I expected: Chanel is muted if N=0!

Any idea?

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

Post by CLee » Sun Aug 13, 2017 11:57 am

Can someone give me the nickle tour rundown on the state of this module. I'm thinking I'll build one but I'm hopelessly confused.

I've read the thread but maybe I don't understand, there seems to be several versions of the code with different capabilities. The hardware seems to be fairly simple, but is there any "official" software?

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Sun Aug 13, 2017 12:28 pm

CLee wrote:Can someone give me the nickle tour rundown on the state of this module. I'm thinking I'll build one but I'm hopelessly confused.

I've read the thread but maybe I don't understand, there seems to be several versions of the code with different capabilities. The hardware seems to be fairly simple, but is there any "official" software?
Try the Syinsi website for a matching schematic/PCB and GitHub repo. I guess this might be deemed the 'official' version.

* I think the tombola repo is historic and fixes have not been patched back.
* The sneakthief repo is similar to syinsi's but they aren't quite the same. I'm not sure it works with the syinsi schematic/PCB as I haven't tried it.
* My repo contains code that adds some extra features as an alternative to the syinsi repo - possibly too many though and as such aptly demonstrates the limitations of using an 8x8 matrix as a display.

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Sun Aug 13, 2017 12:35 pm

klangbauer wrote:Two issuse in my Euclidian Sequencer V2:1.05 dfsg2-4:

Offset is not working on Seq 1 (only one time after start up). Other channels are working.

To stop a sequence: Lenth and Events (N and K) has to be zero.
Output LED is still flashing. I expected: Chanel is muted if N=0!

Any idea?
What code did you flash?

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

Post by klangbauer » Mon Aug 14, 2017 7:43 am

I jused both version: THX and SnakeThief. After loading both versions serveral times I think:
Snake Thief version don´t had that problem. But if you change
(int length = 50; //was 50 -pulse length)
a bit you can´t change offset of channel 1 anymore.

I tried to control puls length to 60 to get a better response of encoders.

OK: Where is the parameter to change encoder response without force described issue?

Thanks

klangbaukoeln

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

Post by klangbauer » Thu Aug 24, 2017 4:02 am

Error is back.
Chanel 1 Offset is not working stabel. Sometimes it works or not.
Reset Atmel helps and it works.
I use an Arduino Pro Mini without USB to progamm it seriell. It is a cheap thing from China and works in many other applications without problem.


No one discover this issue?

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Fri Aug 25, 2017 2:10 am

klangbauer wrote:Error is back.
Chanel 1 Offset is not working stabel. Sometimes it works or not.
Reset Atmel helps and it works.
I use an Arduino Pro Mini without USB to progamm it seriell. It is a cheap thing from China and works in many other applications without problem.


No one discover this issue?
I haven't but I only used the THX code and my own code, not the SneakThief code you suggested you were using.

Are you sure it is only impacting channel 1? Or does it impact the channel being edited which happens to be channel 1?

If it is the edited channel I would suggest checking the soldering, the encoder, and verifying you aren't getting any odd signals at the input pin.

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

Post by klangbauer » Fri Aug 25, 2017 3:45 am

It is mostly channel 1 and new also channel 3. After reset it is working and suddenly it refeuses to do.

As far I understand, you suggest a hardware problem. OK.
What you mean "getting any odd signals at the input pin" of Arduino?

I my schematic a 7805 feed Arduino and LED Matrix. THX feed 12V in Arduino RAW input and feed 5V seperat to LEDs.
This is the difference and it may be a reason to get dirt in one of Arduinos input.
OK it is a trace worth to evaluate.

Thank you

User avatar
duff
Veteran Wiggler
Posts: 748
Joined: Sun Mar 10, 2013 2:21 pm
Location: UK

Post by duff » Fri Aug 25, 2017 3:51 am

klangbauer wrote:What you mean "getting any odd signals at the input pin" of Arduino?
Noise or signal fluctuations that would be interpreted by the code as a moving encoder when it is not.

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

Post by klangbauer » Sat Aug 26, 2017 9:30 am

I tested to seperate power supply for LED and Arduino. 12V to Arduino RAW and 5V only for LED Matrix and driver.
Same story.

Powering up "Offset" of channel 1 is working only one time. After restart Arduino seperatly, it works.
Can't measure any "dirt signals" on assosiated PIN's D9/10

All other chanels are working.
Magic

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

Offset Chanel 1

Post by klangbauer » Thu Aug 31, 2017 3:32 am

At the moment I think it is a EEPROM issue.
What means:

void setup .......


//
// IF THE NANO FAILS TO BOOT (DUE TO CORRUPT EEPROM), COMMENT OUT FOLLOWING IF AND END BRACKET
// TO FORCE NEW EEPROM WRITE.
//


Any help?

Post Reply

Return to “Music Tech DIY”