Looking for module that randomizes sort order of polyphonic channels

Does one exist yet? By this I mean take a polyphonic signal with say, 8 channels, give it a trigger pulse, and then all 8 original CVs are unchanged except they are assigned to different channels. Re-routed, but not simply rotated, and every channel has to potentially end up in any other position (or, if the odds favour it, possibly in the same position).

I spent a couple of hours building a patch with 16 instances of Venom’s “Bernouilli Switch”, and a couple of Merges and Splits, and it does appear to do what I want for 8 channels.

However, it seems to me that somebody must have made a single module to do the same thing. I tried “Roly Pouter”, but I could not make sense of it.

It doesn’t have to be polyphonic either. I’d be happy with a router that has 8 mono inputs, 8 mono outputs, and a trigger input. Or 16 ins and outs, and a knob to select the number of channels in use.

The object it so be able to feed it say, 8 random CVs, and pass them through the scrambler to a sequencer via CV-MAP. Have the sequencer play the melody 4 times, then randomize the order and repeat the same notes but in a new order 4 times. Do this a couple of times until it gets boring, then hit it with all new random values, which then go through the same re-sorting process.

I did find this thread - https://community.vcvrack.com/t/looking-for-random-router-module-or-technique - but none of the suggestions seemed completely satisfactory to me for one reason or another.

By the way, kudos to Venom for making a Bernouilli switch that has two inputs AND two outputs. HetrickCV’s “Flip Pan” sorta’ did the job—before I discovered the Venom switch—but each one needed more … stuff to select whether to flip or not. (I do like it for panning polyphonic stereo though.)

The Venom switch may turn out to be what I need for my “Change Ringing” patch. See my post in ISO: Router that can swap a random pair of in→outs? - #21 by john_rose

With a tweak, the BASICally code I posted here would do that, albeit only for six mono signals at a time. Is that too few to be sufficient?

If it’s not, say so, then I can post here the updated code that rescrambles all six inputs on a trigger.

The next release of BASICally will have this script as a preset, BTW.

Umm… yeah, too few. But thanks.

Hi John, I think Roly Pouter is the way to go as you mentioned, here is a setup I made as a selection.

PolyRouter.vcvs (6.4 KB)

The fixed Voltage source are your 16 instances of the bernoulli source The Strip module takes care of the randomness and the Roly Pouter is set on

The multivoltmetro are your random outputs. The Roly pouter is set to AUTO so it will only select from the max number of inputs (in this case 6)

Dave’s video is a great help :

2 Likes

Thought a bit more on it, and there is a way to hack it:

Here’s the code (same in each instance of BASICally):

' When started or IN8 gets a trigger, IN1-IN6 get
' randomly assigned to OUT1-OUT6, like:
' IN1 -> OUT3
' IN2 -> OUT6
' IN3 -> OUT2
' IN4 -> OUT4
' IN5 -> OUT1
' IN6 -> OUT5
' When IN9 gets a trigger, two of the assignments
' will randomly trade.

WHEN start() or trigger(IN8)
  for pos = 1 to 6
    grab[pos] = pos
  next
  ' Initialize the mapping.
  for pos = 1 to 6
    pull_pos = floor(random(1, 7 - pos))
    out_map[pos] = grab[pull_pos]
    ' Put last value from grab[] into the location
    ' we just selected from.
    grab[pull_pos] = grab[7 - pos]
  next
END WHEN

WHEN trigger(IN9)
  switch1 = floor(random(1, 7))
  for dummy = 1 to 2 STEP 0
    switch2 = floor(random(1, 7))
    if switch1 != switch2 THEN
      EXIT FOR
    END IF
  NEXT
  temp = out_map[switch1]
  out_map[switch1] = out_map[switch2]
  out_map[switch2] = temp
END WHEN

ALSO
  out_num = out_map[1]
  if out_num == 1 THEN
    out1 = in1
  elseif out_num == 2 THEN
    out2 = in1
  elseif out_num == 3 THEN
    out3 = in1
  elseif out_num == 4 THEN
    out4 = in1
  elseif out_num == 5 THEN
    out5 = in1
  elseif out_num == 6 THEN
    out6 = in1
  END IF

  out_num = out_map[2]
  if out_num == 1 THEN
    out1 = in2
  elseif out_num == 2 THEN
    out2 = in2
  elseif out_num == 3 THEN
    out3 = in2
  elseif out_num == 4 THEN
    out4 = in2
  elseif out_num == 5 THEN
    out5 = in2
  elseif out_num == 6 THEN
    out6 = in2
  END IF

  out_num = out_map[3]
  if out_num == 1 THEN
    out1 = in3
  elseif out_num == 2 THEN
    out2 = in3
  elseif out_num == 3 THEN
    out3 = in3
  elseif out_num == 4 THEN
    out4 = in3
  elseif out_num == 5 THEN
    out5 = in3
  elseif out_num == 6 THEN
    out6 = in3
  END IF

  out_num = out_map[4]
  if out_num == 1 THEN
    out1 = in4
  elseif out_num == 2 THEN
    out2 = in4
  elseif out_num == 3 THEN
    out3 = in4
  elseif out_num == 4 THEN
    out4 = in4
  elseif out_num == 5 THEN
    out5 = in4
  elseif out_num == 6 THEN
    out6 = in4
  END IF

  out_num = out_map[5]
  if out_num == 1 THEN
    out1 = in5
  elseif out_num == 2 THEN
    out2 = in5
  elseif out_num == 3 THEN
    out3 = in5
  elseif out_num == 4 THEN
    out4 = in5
  elseif out_num == 5 THEN
    out5 = in5
  elseif out_num == 6 THEN
    out6 = in5
  END IF

  out_num = out_map[6]
  if out_num == 1 THEN
    out1 = in6
  elseif out_num == 2 THEN
    out2 = in6
  elseif out_num == 3 THEN
    out3 = in6
  elseif out_num == 4 THEN
    out4 = in6
  elseif out_num == 5 THEN
    out5 = in6
  elseif out_num == 6 THEN
    out6 = in6
  END IF
END ALSO

That said, this isn’t:

  • truly random over all possible rearrangements. For example, you could never get 1-1, 2-2, 3-3, 4-4 with this.
  • easy on the CPU.

But at least you can sort of see what’s happening. I’m still mystified, even after watching Dave’s video, about what’s happening between Strip and Roly Pouter.

1 Like

Huh. That setup is working for me now. I was getting duplicates and/or missing values, in spite of having selected "Randomise one-to-one…) in Poly router.

Now to answer the question in my initial post: “Yes”.

P.S. As far as using the Venom Bernoulli Switch for the Change Ringing project goes, I realized later that I cannot guarantee that it will switch. I’ll have to use Flip Pan for that.

1 Like

I’m curious how you attempted to use Bernoulli Switch - I don’t see how it could solve this.

But you certainly can guarantee it switches every time - simply set the probability to 100% (full clockwise), and mode to toggle.

Here’s a screenshot of my brute force randomizer array using the Bernoulli Switches. Sorry for the weird aspect ratio, but this arrangement makes it easier to follow how the patch cables are connected. The triggers are all connected to a common clock. The red poly cable at the top of the Splt8 provides 8 random CVs, while the output of the Mrg8 goes off to (ultimately) CV-MAP which feeds the sequencer.

I found that by zeroing out one of the SCALE knobs in one of the top modules and feeding all the rest random voltages, I could visually track that zero CV’s movement across the poly channels with repeated triggers. As far as I could tell, every channel had an equal chance of being moved to any other channel or even to end up in the same channel.

But you certainly can guarantee it switches every time - simply set the probability to 100% (full clockwise), and mode to toggle.

Say whut?!?!?! :open_mouth: I had not thought to try that combination of settings when I was working on the randomizer, so I didn’t know it would do that. As it turns out, I misspoke about having to use Flip Pan, because I just found a small test patch I had already made, using Bogaudio’s SWITCH.

I connected two sources to both the top and bottom inputs (but swap the bottom pair) and the two outputs behave like the Bernoulli Switch does with the 100%/Toggle setting. It just requires 40% more patch cords, but who’s got that kind of money to throw into extra patch cords? I had not gotten so far as to connect a bunch of them together.

A module from a new forthcoming collection does just this:

Downloads: Rename Shuffle.cpp to shuffle.cpp · Jadael/TMT@37a5751 · GitHub

1 Like

Well, that certainly looks promising. I see what appears to be eight "7"s around the Poly Out jack. I wonder if that means something, like the number of poly channels, or is it just decorative?

I go for that if you scrolled down a bit you’d seen this :

7 galore…

Unless they’re the heraldic symbol for a medieval “fleam”, which was a medical blood-letting blade.

2 Likes

Makes sense, only the “out” ports have this sign.

1 Like

Oh good, that was updated to the build update state by cschol 8 hours ago, showing movement. A number of plugins have been in that state for 1 week, waiting for the final release. That includes a new Venom release with 4 new mixer/attenuator/VCA modules. Hopefully they will be released imminently.

Oh, it’s that person who like wood grain! Cool.

It’s lovely. I’d prefer the margin adornments to appear carved into the wood, and perhaps filled with copper, brass , or gold leaf.

oh nice lol and here i was, working on a new module for this after finding this thread. oh well. i’ll just have to find a way to make mine a bit more unique or something. i did already have a couple of ideas in mind anyway.

3 Likes

Well . . . how about a setting for how many channels to scramble ant any given time? Or limiting how far any channel can move in any single jump?

1 Like

also interesting ideas :slight_smile:

my initial thoughts were mainly about adding a couple of other simple ‘modes’ like rotating channels up/down - but these could definitely be fun to try out as well.

i finally had a little bit of time to start messing around and now have a working prototype with 4 different ‘modes’ at the moment - shuffle (self-explanatory), random (for each output channel, pick a totally random input channel), rotate up (shift channels ‘up’), and rotate down (shift channels ‘down’). i may end up coming up with more, but they all work for now.

next up on my list is tackling these two ideas of yours. then, i’m thinking i might add one of my favorite things to add to modules that can use it - crossfading between the active channels when triggered, over a user-defined fade duration. this is actually turning out to be a fun little thing to tinker with. :smiley:

4 Likes