# HAGIWO/A-RYTH-MATIC/MODULOVE euclidean firmware \*FIXED\*

**URL:** <https://lookmumnocomputer.discourse.group/t/hagiwo-a-ryth-matic-modulove-euclidean-firmware-fixed/7201>\
**Category:** DIY STUFF\
**Created:** [April 25, 2024, 6:59pm UTC](https://lookmumnocomputer.discourse.group/t/hagiwo-a-ryth-matic-modulove-euclidean-firmware-fixed/7201 "2024-04-25T18:59:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unauthorised\_service](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/unauthorised_service/32/14978_2.png) [@Unauthorised\_service](https://lookmumnocomputer.discourse.group/u/Unauthorised_service)\
**Post date:** [April 25, 2024, 6:59pm UTC](https://lookmumnocomputer.discourse.group/t/hagiwo-a-ryth-matic-modulove-euclidean-firmware-fixed/7201/1 "2024-04-25T18:59:46Z")

</div>

![IMG_9112](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/a/1/a159191b1a62f5c8a461751be3d12a273ee58a1a.jpeg)

> **[800円で作るユークリッドリズムシーケンサー-モジュラーシンセ自作｜HAGIWO/ハギヲ](https://note.com/solder_state/n/n433b32ea6dbc)**
>
> Arduino nanoを使って、モジュラーシンセサイザー のユークリッドリズムシーケンサ（Euclidean rhythm sequencer）を自作したので、その備忘録。 背景 自作モジュラーシンセの30作品目。 ユークリッドリズムを鳴らせることは、モジュラーシンセの特徴のひとつかもしれない。 世の中のリズムマシンには、ユークリッドリズムシーケンサが搭載されていない。しかし、ユーロラックには多くのユークリッドリズムシーケンサのラインナップがある。 ...

MODULOVE firmware :

> **[GitHub - modulove/A-RYTH-MATIK: 6CH Eurorack trigger sequencer and euclidean...](https://github.com/modulove/A-RYTH-MATIK)**
>
> 6CH Eurorack trigger sequencer and euclidean Rhythm Generator with SSD1306 0.96 OLED - modulove/A-RYTH-MATIK

hello there.  
well , well, here we go again.  
So… came across the ARYTHMATIC alt firmware with clock reset and flipped button/encoder  
operation and certainly prefer this version. (by no means a critic of mr HAGIWO , far from it )  
Also with the original firmware my encoder was skipping/missing values  
However ,as is the nature of these things , Random Occurence select was not working.  
I confirmed this with meebilt on YT who experienced same behaviour.  
Pretty much a complete novice with coding ,but can work out how to adjust some variables.  
Anyway managed to work it out .  
some notes…then full code… I have adjusted the random values also …thus :  
//random assign  
byte hit\_occ[6] = {15, 15, 15, 15, 15, 15}; //random change rate of occurrence  
byte off\_occ[6] = {0, 0, 0 ,0, 0, 0}; //random change rate of occurrence  
byte mute\_occ[6] = {15, 15, 15, 15, 15, 15}; //random change rate of occurrence  
byte hit\_rng\_max[6] = {7, 7, 7, 7, 7, 7}; //random change range of max  
byte hit\_rng\_min[6] = {2, 2, 2, 2, 2, 2}; //random change range of max  
… but you may flavour to your own taste.

CHANGES MADE :  
approx line 182  
if (select\_ch == 6 && select\_menu \>= 1) { // random mode \* CHANGE TO\*  
if (select\_ch == 6 && select\_menu \> 1) { // random mode

approx line 232  
else if (select\_ch == 6 && sw == 0) { // random mode  
bar\_select ++;  
if (bar\_select \>= 4) {  
bar\_select = 0; _CHANGE TO_  
else if (select\_ch == 6 ) { // random mode  
bar\_select ++;  
if (bar\_select \>= 5) {  
bar\_select = 0;

approx line 283  
else if (select\_ch == 6) { // random mode  
bar\_select --;  
if (bar\_select \>= 4) {  
bar\_select = 0; _CHANGE TO_  
else if (select\_ch == 6) { // random mode  
bar\_select --;  
if (bar\_select \>= 4) {  
bar\_select = 4;

approx line 433 (enables ch1 random mode, previously disabled)  
for (k = 1; k \<= 5; k++) { _CHANGE TO_  
for (k = 0; k \<= 5; k++) {

> **[ARYTHMATICfixedeuclidean.txt](https://www.dropbox.com/scl/fi/zk8v08lk6kt20oq011a06/ARYTHMATICfixedeuclidean.txt?rlkey=100w4k0ptbtgf9qrfgq2obvbw&st=fodwnu2x&dl=0)**
>
> Shared with Dropbox

---

<div class="post-metadata">

**Author:** ![Jos](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jos/32/151_2.png) [@Jos](https://lookmumnocomputer.discourse.group/u/Jos)\
**Post date:** [April 26, 2024, 11:13am UTC](https://lookmumnocomputer.discourse.group/t/hagiwo-a-ryth-matic-modulove-euclidean-firmware-fixed/7201/2 "2024-04-26T11:13:29Z")

</div>

You’ve gone through quite some effort here, but without indentation most of the code is more or less unreadable and as a consequence will not likely be read by anyone because it takes way too much effort. Can you reformat it?

As an example, this would make your point much clearer:

approx line 283

```auto
> else if (select_ch == 6) { // random mode
> bar_select --;
> if (bar_select >= 4) {
> bar_select = 0; 

```

_CHANGE TO_

```auto
> else if (select_ch == 6) { // random mode
> bar_select --;
> if (bar_select >= 4) {
> bar_select = 4;

```

And then continue with the rest of your text. You can use the ‘preformatted text’ button for inclusion of indented source code.

---

<div class="post-metadata">

**Author:** ![Unauthorised\_service](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/unauthorised_service/32/14978_2.png) [@Unauthorised\_service](https://lookmumnocomputer.discourse.group/u/Unauthorised_service)\
**Post date:** [April 28, 2024, 2:52pm UTC](https://lookmumnocomputer.discourse.group/t/hagiwo-a-ryth-matic-modulove-euclidean-firmware-fixed/7201/3 "2024-04-28T14:52:15Z")

</div>

Thanks for corrections .Well I`m stumped how to format the text. Added a dropbox link instead.  
Copy and paste into 1.8.19 arduino IDE and works for this _thicko_.  
hopefully, now Ive deleted the overwhelming full code , a keen mind will decipher these little tweaks.  
well worth building though.

---

<div class="post-metadata">

**Author:** ![Jos](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jos/32/151_2.png) [@Jos](https://lookmumnocomputer.discourse.group/u/Jos)\
**Post date:** [April 28, 2024, 8:28pm UTC](https://lookmumnocomputer.discourse.group/t/hagiwo-a-ryth-matic-modulove-euclidean-firmware-fixed/7201/4 "2024-04-28T20:28:10Z")

</div>

You can copy the text and paste it between backquotes

``` put preformatted text here ```

then when the post is displayed the preformatted text will keep its original formatting, otherwise it will loos it. E.g. no back quotes:

//draw step dot  
for (k = 0; k \<= 5; k++) { //k = 1~6ch  
for (j = 0; j \<= limit[k] - 1; j++) { // j = steps  
display.drawPixel(x16[j] + graph\_x[k], y16[j] + graph\_y[k], WHITE);  
}  
}

will then be shown after adding the back quotes as

```auto

  //draw step dot
  for (k = 0; k <= 5; k++) { //k = 1~6ch
    for (j = 0; j <= limit[k] - 1; j++) { // j = steps
      display.drawPixel(x16[j] + graph_x[k], y16[j] + graph_y[k], WHITE);
    }
  }

```

which is easier to read and understand.

You can put the 3 back quotes before and 3 after the text by hand or use the \</\> button when entering the text. In the example window to the right you can see whether you did it right.
