How to randomize order with certain set of rules?

Any advice on how to create an environment in FMOD where “chunks” (short phrases of 3-8 seconds) of a musical piece are played randomly, but with a specific set of rules/limitations?

For example: chunk A only plays when entering the zone.
After chunk E play only L, O or R
Every 5th chunk should repeat itself 3-4 times

I was able to figure a working “set of rules” by emulating different scenarios via Arranger chains in Cubase, but have no clue how to approach this in FMOD.

Any tips appreciated!

There’s unfortunately no simple way to do that in FMOD. Firstly your logic is too complicated to be implemented in FMOD, secondly FMOD lacks a good way to link a chunk after another just finished. The only tools which are able to execute something after something else has just finished are the action sheet and the multi instrument. However, both will lack options you’ll need.

The only thing that would work would be to keep the logic in the game code, and drive a labelled parameter which will indicate the next chunk to play to FMOD. In FMOD, it will look like this :
So a lot of work to configure all this… But once done for a chunk, you can copy/paste all the green transitions from chunk to chunk.

Hi Alcibiade, thanks for the suggestion! I have a strong academic music background, but unfortunately I don’t have any experience with coding, so I’m not even sure where to begin :sweat_smile:

So I assume your project isn’t for a game? Don’t you have a teammate which could do the scripting part?

The project is for a finished sandbox game, which in turn is for my diploma thesis. I used a piece by Debussy (“Untitled Goose Game” Hommage, but I used “Epigraphes” instead of the preludes) and separated it in phrases.

Here’s how my “simulated” situation looks like in Cubase: Theater Debussy ver13 2022 02 20 15 17 07 - YouTube

1 Like

What’s your game engine?

Unreal Engine 4.26, the Sandbox Game is based on this: The Theater - Elias Software

I might be able to help you a bit with the scripting in UE4 (using blueprints). PM me if you want.

1 Like

As Alcibiade says, there’s no easy way to do this in FMOD Studio. You could theoretically achieve the behavior you describe using a complex arrangement of transition and destination markers and multiple duplicates of every chunk laid out along the timeline, but the resulting event would almost certainly be complex and unwieldy to the point of being unfeasible to tweak or maintain.

You would be much better off offloading some of the logic to your game project’s code.