Multi Instrument: Play through sequence THEN randomise

I have a multi instrument set to play a series of musical notes every time the player hits a button, I’d like for the sequence to play in the specified order until it reaches the end, at which point, I’d like it to play the same audio files, but randomised. Is there a way to do this? Thanks!

Yes, this is not hard to do.

First, create a multi instrument. Add your sound files to its playlist, set its playlist selection mode to “Sequential - local scope,” enable its “loop playlist” toggle button, and set its loop count to the number of files in its playlist plus one.

Next, right-click on the multi instrument’s “Add Instrument” button and select “Add Multi Insturment” from the menu. This adds a multi insturment to the end of the multi instrument’s playliust. Click on this new multi instrument to select it and view it in the deck next to the first multi insturument.

Add your sound files to the new multi instrument’s playlist, set its playlist selection mode to “shuffle,” enable its “loop playlist” toggle button, and set its loop count to the number of files in its playlist.

When you audition the event and the first multi instrument is triggered, it will play through the entries in its playlist in a fixed order; then, when it reaches the multi instrument at the end of its playlist, that multi instrument will play the files in its playlist in a random order.

1 Like

Thank you Joseph. Appreciate the walkthrough. I had experimented with nested multi-instruments to accomplish what I’m after. The issue is that I need the event to be triggered by player input so having the multi-instrument loop isn’t going to work in this context. That aside, the files do play how I’d like them to now, so thanks for that. Do you know if there’s a way to simply achieve the same result without looping the instruments? Thanks!

For a multi instrument, “loop instrument” just means “play more than one playlist entry when triggered.” As long as you set the play count to a finite number (as described in my earlier post), the instrument will play a specific number of playlist entries whenever it is triggered, then fall silent.

I made a video so you can see the behaviour I’m getting (hopefully it goes through). What I want to happen is for a note to be triggered each time the event is called. What’s happening now is that when one note ends, the other starts automatically as it continues down the sequence. I think I have everything set up as you described, but perhaps you’d be able to see at a glance whether or not that’s the case. Thanks!

(Attachment 2022-03-29 09-30-35.mkv is missing)

Firstly, your video hasn’t been uploaded. It’s better to put a private video on YouTube.
Secondly, your initial demand was unclear. I also understood as Joseph, which gave the correct answer. If what you want is to play only one note each time the event is called, that’s more complicated, because each event instance don’t “know” what has been played before ; so you may need to store that info in a global parameter ; and I’m not even sure the randomization part will be possible. The best would be to script that in the game code. If you absolutely want to do that in FMOD, I do imagine something, using Joseph’s solution with sustain points after each note, but I’m not absolutely sure it would work. Please give us some more thorough insights on what you’re trying to achieve first.

Oh! I see. From reading your initial post, I thought you wanted the series of notes to play each time the event was triggered when the player pressed a button, not for a single note in the series to play when they pressed that button.

Hmm… This is doable, but exactly how you do it will depend on the fine details of how you want it to behave.

If you want the note played by the instrument to be randomized forever once the player reaches the end of the sequence, you will need to use a global parameter, as Alcibiade suggests. There’s no other way to preserve a record of the “this is now random” state that will persist through an arbitrary number of event instances.

If you only want the notes played by the instrument to be random for a specific number of key presses, then to start again from the beginning of the fixed sequences, that’s much easier to achieve. Just disable loop mode for the parent multi instrument, set its playlist selection mode to “sequential - global,” and copy and paste the nested multi instrument to ensure that there’s a number of copies of it in the playlist equal to the number of times you want the note to be randomized before the sequence starts again.