Modulo Question

Hi all,

I tried the modulo function today in the controls. My assumption (and goal) was to assign voices so that when all voices are assigned, every new device would start from the first voice. Imagine you have 4 voices, they get assigned to device 1, 2, 3, and 4, and the 5th device starts at voice 1 again, and so forth.

I experimented with just two voices, entering something like “current device number modulo 1”, “current device number modulo 2”. The result was that the 1st and 3rd device played the 1st voice as expected. However, the 2nd and 4th device played both voices. What’s my mistake here?

Thanks, Hans

Hi Hans,

The modulo comparison operator is set up so that the condition is matched when the value of the statement is equal to zero.

So if you have [metadata = joining number] [comparison operator = modulo is zero] [condition value = 1], you’ve got modulus 1 and the value will be zero for every joining number. (x mod 1 is zero for any integer x.)

  • [Joining number modulo 1] will return devices 1, 2, 3, 4, 5, …
  • [Joining number modulo 2] will return devices 2, 4, 6, 8, 10, …
  • [Joining number modulo 3] will return devices 3, 6, 9, 12, 15, …

So, to get every even number, you could use modulo 2, and to get every odd number, use modulo 2 with the “invert condition” checkbox selected.

This will work for your test case with two voices, but not for the case with four voices unfortunately.

It’s a rather inelegant solution, but the best way I can think to do that is to set:

  • [joining number] [any of] [1 5 9 13 17 21 …] for voice 1
  • [joining number] [any of] [2 6 10 14 18 22 …] for voice 2

and so on, for up to as many devices as you think might realistically join.

Thanks again for highlighting a use case, and we’ll add this to the list of considerations for reviewing the tool.

Jon

Hi Jon,

thanks for the quick response. Makes sense. I can see various workarounds (even adding the same voice multiple times), but it would be great to have an easier option for adding more devices, when voices run out.

Hans