Dynamic Music Transitions in Metasounds?

Hi!

I’m currently trying to figure out how to implement musical transitions within Metasounds. I understand how to create fades and layering, but this specific use case is a little different to that.

I have a piece of music split into 3 sections of 24 bars (A, B, C). When the player starts the level, the A section loops indefinitely. The idea is that once the player crosses a trigger point in the level, the music will play out the rest of the A section up to the end of bar 24, and then once the A section finishes, begin playing the B section rather than looping A again. This will happen again in the same way to get from B to C.

This will never happen in reverse (i.e. the player won’t go from the B section back to the A section), and all of the tracks have reverb tails that shouldn’t be included in the loop. I’ve attached a screenshot of the current music system here to hopefully demonstrate how the system is currently working to loop music.

Would love to hear people’s thoughts and advice on this, as I have no idea where to begin!

i think you can get rid of the trigger compare and use the output of the trigger counter instead.

connecting trigger to trigger and reset to reset.

but that won’t solve your question.

i’m not super versed in msounds but i’m a dev. what i’d do is:

have an event for “Player crosses point” (ill call it IsPOnPoint)
Then i’ll get two trigger control TCA2B and TCB2A

the IsPOnPoint connects to both TCs but negated on one. So it opens and close them in the opposite cases.

The trigger input for both TCs would be the trigger from the Bar count (should trigger at the crossfade moment, eg bar 24).

the trigger output for each TC would connect to a different crossfade, from A to B in TCA2B and from B to A in TCB2A. (i’m not sure how you will animate that crossfade).

the trigger output for each should trigger a looped wav for A and B respectively.

the trigger output for each "could” trigger a stop on B an A respectively.

I wouldn’t use the trigger of the bar count 32 to play the wav, instead have a loopable section.

and maybe have the tail transition as a different wav. it might simplify it a bit, but it might introduce audio quirks, depending on how reliable is metasounds and the wavs authoring.

but you can still use the trigger bar count 32 to drive both audios. you might need to gate it with a TC and the same setup with IsPOnPoint.

if you have both bar counters, it will be a bit more difficult to connect, as they have different lengths (32 and 24).

you’re kinda making an implicit state machine, if i had more free time available i could actually design something that works well. but maybe someone else has better advice.

i hope at least it gives you an idea or start point.

alternatively you might be able to simplify a lot your code if you make use a different approach, and have a trigger repeat for the whole section instead of the bar.

for example one for Period**32 and another for Period**24

then you can just start/stop those triggers directily. maybe control them using the isPOnPoint event. thought that would look more like a bistable or flipflop in the sense that the output of one of the periods would trigger the switch to the other period.