Vermona randomRHYTHM - Similar module in VCV?

First time I saw it in VCV was with this module, and it did what I wanted, not playing the same preset/slot twice in a row.

Iā€™ve never noticed that :wink:

1 Like

All the basic pseudo random algorithms Iā€™m aware of can still repeat values, just like a true set of random numbers.

The times Iā€™ve needed to ā€œrandomlyā€ sequence a pool of values without any repeats, I create an array of values. I ā€œrandomlyā€ select one of the array positions, taking that value. Then I remove that position from the array and randomly select another position from the smaller pool of values. Repeat until all values exhausted.

Not sure if there is a better way to do that, but it has worked for me.

Yeah I think the idea is to allow repeats, but the probability of a repeat is near zero right after the first instance, increasing slowly as time goes on.

There are a lot of different ways to prevent repeats. Your plan works mostly but can actually cause a repeat if the last item in the list is selected first on the next cycle.

My general strategy for no-repeats is to simply store the previous value and then when I generate a random number, if its the same as the previous one, re-generate a new value. Repeat this until the generated value is not the same as the previous one.

That works for preventing direct repeats which is usually good enough. If you need more you can store a list of the last X values and exclude all of them.

Ooh, interesting. I hadnā€™t thought about that. It may or may not be OK, depending on your goal. You could combine your strategy below with mine to prevent duplicates each time the list is reset.

Yes. What I donā€™t like about that strategy is the highly variable time it takes to come up with the next random value. If you have a long list, and there are only a few remaining options left, it might take a lot of attempts before success. I used to do a lot of Windows batch programming, which is inherently slow, and that brute force technique simply didnā€™t cut it.

Iā€™ve never done batch scripting before, so yeah if that is really slow it can be very annoying. Another issue you can run into is an infinite loop if it CANā€™T find a solution. But if it can find a solution its really not that bad. I wrote a simple test here that tests 100 sided dice down to a 2 sided dice, and even with the two sided dice its only about 2x the number of rolls and about 5x as long. But that is compare to a pure random. So the time will be better when compared to another solution for removing repeats.

the last squinky labs module, that I never finished, was a rhythm generator that use stochastic production rules to generate rhythms. Maybe I should have finished itā€¦

4 Likes

I forgot to include the link

https://random-demo.glitch.me/

Ooo. Im always interested in fun uses of Stochastic Grammers. I definitely would have fun with that if you finished it.

Have you heard of wave function collapse? GitHub - mxgmn/WaveFunctionCollapse: Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics

My Rhythm Explorer module is now available in the Library! It is very much inspired by the randomRHYTHM, incorporating many of its features, though most definitely not a clone.

11 Likes

Nice stuff Dave, well done. Just trying out the Rhythm Explorer now and a couple of issues Iā€™ve run across with the version that just appeared in the Libraryā€¦

  1. The Dice button works fine at setting values, but the visible controls donā€™t move to match the new values.
  2. Iā€™m using the Run signal out of CLOCKED into the Run input on your module and it doesnā€™t seem to start it. Is it expecting a different kind of gate/trigger?

My module expects a gate at the Run input - It runs while high, and stops while low. It is all in the documentation - I highly recommend reading it because there are a ton of features you are unlikely to figure out if you donā€™t. Hopefully it is logical and easy to remember once you get an understanding.

I donā€™t understand what visible controls you expect to change upon a Dice press. I think you are misunderstanding the function, or else I am totally missing your point. Again, I think the documentation may help. Especially the ā€œBasic Principlesā€ section may help in understanding the Dice.

3 Likes

Sorry Dave, Iā€™m so used to modules with scant/no documentation I was out of the habit of looking for it - my bad.

Before reading it I assumed Dice randomly set the density of each of the interval sliders rather than reseeding the pattern per slider.