FMOD Studio: Set the fade out time on an Event stop when using ALLOWFADEOUT/FADEOUT

Hello! I couldn’t find a matching topic on this particular question.

In my API implementation, when you stop an event you can set it to fade out automatically. I’m wondering if the amount of time it takes for it to fade out can be adjusted from within FMOD Studio per event? I’ve googled around and can’t find anything on this, and I tried asking ChatGPT too and it directed me to a non-existent setting in the Event Macros section, so here I am. Haha

Thank you for your time!

As described in the Authoring Events chapter of the FMOD Studio User Manual, the behavior of an event instance when it is stopped with FMOD_STUDIO_STOP_ALLOWFADEOUT depends on the content of the event:

  • If the event has no defined stopping behaviour (i.e.: none of the features mentioned in the below dot points), the event stops immediately.
  • If there is an AHDSR modulator on at least one property of the event or one of the effects it contains, the release period of that AHDSR modulator begins playing out. The event instance does not finally stop until all such AHDSR modulators in the event instance have finished their release periods.
  • If any of the instruments or logic markers in the event has an event state condition, the event instance does not finally stop until the event reaches a natural end.
  • If an event contains both AHDSR modulators and event state conditions, both above conditions apply: The event instance does not finally stop until the event instance has reached a natural end and all the AHDSR modulators it contains have finished their release periods.

So, if you want to be able to set your events to fade out over a period of time and want to be able to customize how long that period is on a per-event basis, you should add an AHDSR modulator to each event’s master track’s volume property. Provided there are no other AHDSR modulators or event state conditions in the event, the length of the event’s fade-out will be equal to the length of the AHDSR modulator’s release property. (You may also want to set the attack period of the AHDSR modulator to 0, so that the event doesn’t fade in when it starts.)

You may be wondering why FMOD_STUDIO_STOP_ALLOWFADEOUT is called that when it allows non-immediate stopping behaviors other than fading out. It was named back when fading out was the only form of complex stopping behavior that we supported, and we’ve kept the original name unchanged for compatibility reasons.

The reliability with which a Large Language Model can answer questions about a topic depends on what sources it has access to that discuss that topic. There are relatively few LLM-accessible sources that discuss audio middleware, partly because the global population of game sound designers is relatively small, and partly because their professional discussions usually occur “behind closed doors” in the private communications of game development studios. Thus, when asked about audio middleware, an LLM is less likely to give accurate answers, and more likely to hallucinate.

Thanks for the response! And yeah, I tend to use AI as a last resort on these kind of things, so the hallucination makes sense.

In-game, it seems to have a quick fade out effect, but reading what you said and looking at the events, the only effects on them seems to be the fader effect that is created with it by default. I’m assuming that is what it’s using as the source of the fade then? So if I add an AHDSR modulator, that’ll start to override the fading settings of the event?

I’m quite new to FMOD/Sound design in general and am mostly getting the tools set up for our sound people, so I’m trying to include examples of all of the various features our API supports for them to reference. So I apologize if I seem a bit more out of the loop on using the tool than the average user.

EDIT 1: I’ve also been testing the fade tweaking with the AHDSR by adding it to the Fader, but for some reason it seems that I can only affect the fade in time. I can’t figure out how to make it apply to the fade-out time instead. Adjusting the release time doesn’t affect the actual fade out length at at all- it just fades the event out within a second and delays the stopping for the release time. I’m not sure what’s going on here.

Basically, I’m trying to have a piece of ambience fade in within a second, but fade out slower so that it’s not jarring.

EDIT 2: Nevermind on EDIT 1, I found out that there was a condition on the particular track for crossfading that was overriding the one I’d set on the bus to govern all the sounds default values. I’d wrongly assumed it was only going to affect the crossfading and not the fade out of the entire event.

I’ve got it working now I think, thanks for the help!

I’m glad to hear you’ve managed to achieve the behavior you want. If you have any follow-up questions, please don’t hesitate to let us know.

1 Like

And thank you for your continued patience and help Joseph!