Page 1 of 1

Looking for a "send index if has changed" module

Posted: 13 Dec 2022, 17:54
by creal
Hello,

I am building a simple patch to tweak parameters of a MIDI device.

The patch works but I think it could be optimized. To achieve this, and because only one paramter can be tweaked at the same time, I would like a module that would take n data flows and return the index of the flow that is changing. Does it exist?

If you see another way to reduce the number of modules, please tell me how. For the moment, I am using switch groups and pass multi modules but there are a lot of cables just for playing with a few faders.

Thanks,

creal.

Re: Looking for a "send index if has changed" module

Posted: 13 Dec 2022, 19:45
by SylvainT
Hello

One idea for three faders.
You can continue.

All the best

Sylvain
Control Change 2.pat
(42.33 KiB) Downloaded 755 times

Re: Looking for a "send index if has changed" module

Posted: 13 Dec 2022, 20:16
by creal
Thank you very much Sylvain. I would never find that way of patching by myself.

The "max pos" module is great. The only thing that I don't understand well is the "wait", "minus", "abs", "concat" modules before entering the "max pos" module. I guess it's for bypassing values when no fader is changing, isn't it?

Re: Looking for a "send index if has changed" module

Posted: 13 Dec 2022, 20:47
by SylvainT
Wait and minus show me a modification. The array has only 0 if nothing changes. On change, one value of the array is <>0. Abs is there to have always a positive number
Concat to add a value in the array and avoid 0 for MaxPos. It is a little trick not easy to explain and maybe to understand.

Re: Looking for a "send index if has changed" module

Posted: 14 Dec 2022, 17:52
by creal
Thank you. It's very clear now. Something I missed is that "Max Pos" returns the lowest index if two indexes reach the same max value. Therefore, Concat (with the combination of X-1 and Pass) avoids always returning to the first fader and sending unwanted values (data 1 = 1, data 2 = x) each time Max Pos can't be detected (i.e. between two consecutive blocs, I guess). Instead, it bypasses both flows.