Random playlist - guarantee no repeats?

(Jason Ericson) #1

I saw a question like this but it was about a year old, so I thought I’d ask again:

Is there a way to guarantee a random multi-sound does not repeat the same sound twice in a row? I would like this to work even if play percentages are set. I’m making a dynamic music generation game, and the object I’m using is meant to change notes randomly every beat, with some notes more frequent than others.

(Jason Ericson) #2

I’d still like an answer to this question but I found an interesting workaround - I divided the sounds I want into two groups, Primary (more likely to play) and Secondary (less likely to play), and made an event sound for each group in the multi-sound playlist. Then both Primary and Secondary have multi-sounds with no play percentages, and play percentages are set in the parent multi-sound playlist. It seems to have a much higher chance of no repeats this way.

(Joseph Harvey) #3

The workaround you have described in your comment guarantees repetition cannot happen.

The behaviour of multi sound modules with random playlist selection, no set play percentages and at least three playlist entries is to avoid repetition, taking into account all instances of that multi sound module that exist globally. As a result, each time one of your child events is triggered, the sound file played by its multi sound module is guaranteed to not be a repeat of the last time that module was triggered. Unless you trigger this event frequently enough that three versions of it can be playing at once, repetition is not something you have to worry about.

(Jason Ericson) #4

In my experience it doesn’t 100% guarantee no repetition, but I might actually be triggering them fast enough for 3+ instances to be playing at one time. For my purposes it works fine! Thanks.