## async modulo arithmetic.

Scope and XITE Development

Original topic on PlanetZ: https://forums.scopeusers.com/viewtopic.php?t=25844

#### async modulo arithmetic.

Posted: Mon Aug 18, 2008 8:06 am
by Neutron
Ok say i had 2 4 way switches, and a 16 position knob which would step through the switches like
11
12
13
14
21
22
23
24
31
32
33
34
41
42
43
44
i can probably do the first switch by (integer) knob value/4 + 1. but how can i get the remainder for the second switch. i would prefer not to make a 16 way switch !

#### Re: async modulo arithmetic.

Posted: Mon Aug 18, 2008 9:33 am
by Shroomz~>
You could use a pot & TableTextFader - Connect a pot to the sel count pad. Set the Count var to 16, then enter your desired values into the value array. The output would be the sel value pad. Fold it into a new module, export the pads & call it ArraySwitchEX or something.
Also, you wouldn't need to 'make' a 16-way switch as such, as you already have the SwitchEX, but you probably know that already.

#### Re: async modulo arithmetic.

Posted: Mon Aug 18, 2008 10:15 am
by Shroomz~>
Here's an example module. Connect your pot up to the switch input. Val1 output will give you the 16 values that you mentioned. Val2 pad output is a string from the Val2 array that could obviously have various uses.

Attachments
  ArraySwitch2.zip
    (5.88 KiB) Downloaded 97 times

#### Re: async modulo arithmetic.

Posted: Mon Aug 18, 2008 10:46 am
by Neutron
oh thats much simpler. i forgot about how much you can do with the controls themselves.
thanks for the example!

#### Re: async modulo arithmetic.

Posted: Mon Aug 18, 2008 2:11 pm
by Shroomz~>
Up until now I've been using RangeText & Switch modules to create switching parameter value arrays, but this way should be much better.

#### Re: async modulo arithmetic.

Posted: Fri Aug 22, 2008 7:54 am
by Neutron
this worked very well for me. except the editing of the arrays is a bit of a pain. (can i edit in notepad?)
can these arrays be changed to have more columns? or should i add another array to the device, if i do will it work in tandem with the already existing value and text ones?

#### Re: async modulo arithmetic.

Posted: Fri Aug 22, 2008 8:11 pm
by Shroomz~>
Haven't found a way to make the editing of arrays easier in the normal array edit window. We were working on a way to make editing arrays easier a while back, but it turned out to be quite unstable.
To add more arrays you could just duplicate the array switch module inside the Array Switch2 module, then connect their count & sel count pads.

#### Re: async modulo arithmetic.

Posted: Fri Aug 22, 2008 10:03 pm
by Neutron
basically thats what i was planning to do. i dont know how much these "pep" arrays use, but i doubt multiplying a switch like that would make a massive DSP hit.

#### Re: async modulo arithmetic.

Posted: Fri Aug 22, 2008 10:31 pm
by Shroomz~>
Duplicating those shouldn't have any DSP hit at all.