Switching seamlessly between music tracks

Hey,
I am new to FMOD and Audio in general using Unity to create a small Indie game.
I have a music track for my main menu, playing just fine. Now every level in the game provides a different music track as well and from within my main menu the player can select any Level.
I have a Singleton AudioManager containing the Listener to play music across multiple scenes, if a level gets loaded I would like the music to transition (fade In / Out) from the main menu music to the level music.
I have read now multiple times that the best approach to achieve this is by having all music tracks on the same event and then using markers to jump between these tracks. However As I have around 25 music tracks each with a length of ~ 5 min this seems to be a bit too much putting them all in a single event.
I guess there is a more elegant solution I am not aware of, so would be interested in hearing those :slight_smile:

Thanks

There are a few different ways to do this, depending on what exactly you want.

If you want tho be able to transition seamlessly from one beat and bar in a music track to the exact same beat and bar in a different music track, there’s no way around putting both of them in the same event, since putting things in the same event is the only way to make them share a timeline.

However, if you always want to start new music tracks from the beginning, and just want to crossfade the one that’s stopping with the one that’s starting, there’s a much easier way: Create one event for each of your music tracks, and place an AHDSR modulator on the master track volume of each such event. Then, whenever you want to change tracks, stop the event that’s playing and start playing a new instance of the one you want to switch to. The old one will fade out, and the new one will fade in.

Do either of those options sound like what you want?