Hi,
I’ve recently started migrating my music system from FMOD Core to FMOD Studio. One snag I’ve hit is that I currently preserve the previous music track when switching to a new track, so that if i.e. you walk into a shop and walk back out, the outdoors BGM doesn’t restart from the beginning just because you listened to the shop music for 15 seconds.
This was relatively straightforward to do with the core API using addFadePoint and then setting a timeout internally in my system to pause the track after the end of the fade.
I can’t find a way to do this in FMOD Studio that doesn’t seem prohibitively complicated. I tried setting a seek speed modulator on volume, but it seems like EventInstance.setVolume isn’t affected by those. And ADHSR only applies to start/stop.
I tried saving/restoring the timeline position and pairing that with start/stop, but it doesn’t work consistently, and when it does it seems like setting the timeline position with start bypasses ADHSR fade-in/fade-out on start/stop, so I don’t get crossfades.
Is there some obvious way to do this I’m missing? Do I have to set up a bunch of custom automation on all my tracks and feed a parameter in from the game engine?
Thanks
Would you prefer that the first music continues to go forward in its timeline, in the background (which is easy), or to pause it and resume from that point later (which I’m not sure is easily doable)? A third possibility is to restart the music in a random offset point.
What I did in the past was pause the track once it faded out and leave it active, so I could resume it and fade it back in later.
Restarting at a random offset point is interesting, I’ll consider whether that would be adequate.
But if your problem is only to fade out the volume, why don’t you control it with a parameter (with either the seek on the volume or on the continuous parameter)?
Many Studio API setters, EventInstance.setVolume()
included, apply the provided value as a factor in the overall calculation of the value, including automation and modulation. This is why EventInstance.getVolume()
returns both volume
and finalvolume
.
There’s a number of ways to handle this behavior, but ro mirror your previous setup with the Core API (addFadePoint
and pausing via the API with a timeout), I’d recommend doing what @Alcibiade suggested and automating the volume with a continuous parameter that has seek speed applied. If you’re using 2.03, the seek speed can itself be automated with a parameter, which will give you more control over the exact fade time and should make setting up a timeout in your own system simpler.
1 Like