FMOD Snapshot and AHDSR not functioning correctly

Hey guys,

So I’m dealing with trying to set up a specific scenario in Fmod, and testing from the fmod side of things in the event editor this setup is not performing exactly as I’d like it to.

So in our game example we have a global music soundtrack that plays in 2D, but a specific ambience sound that is supposed to drop the music to -inf dB when a player enters an area via a mix snapshot.

Currently this itself is working as intended, and the event has the looping soundtrack for the ambience on one track, and a snapshot instrument on another track with a 4 second fade in set on the AHDSR of the snapshot instrument so when the player enters the area of said ambience, the bg music will fade away over 4 seconds.

However, upon exiting this ambient area, the release on the snapshot instrument’s AHDSR is set to 4 seconds as well, yet when exiting that area the global music just instantly pops back up to full volume.

I’m not sure why I can’t get the behaviour to function properly but I have a feeling as though its something rather simple that I’m missing or that is eluding me.

Anyone have any tips?

Also for some further clarification - the global music event also has an AHDSR setting right on the single sound instrument itself with a slow attack fade up as well, I think the issue though is that the event is continuing to loop even when the snapshot turns it down, so when it comes back, it just pops back in at full volume rather than fading back up.

When an AHDSR modulator is placed on one of the properties of an instrument, the release period of that AHDSR modulator starts when that instrument is untriggered. When an AHDSR modulator is placed on one of the properties of an event, the release period of that AHDSR modulator starts when that event is stopped with fadeout. Stopping an event does not untrigger any of the instruments in that event. (If it did, an event with an AHDSR modulator on its master bus volume would normally fall silent immediately when stopped, instead of fading out gradually, due to its instruments all being untriggered at the same time.) This allows you to produce events with much more complex behavior than could otherwise be achieved.

A snapshot instrument is an instrument; thus, its release period begins when the instrument is untriggered, not when the event is stopped. If you want your snapshot’s release period to play out when the event is stopped, you must ensure that the snapshot is untriggered when the event is stopped.

The simplest way to do this is to play and stop the snapshot as an event in your game’s code, instead of through a snapshot instrument.

Alternatively, if your project requires snapshot instruments, you can ensure that each snapshot instrument is untriggered when the event is stopped by giving the snapshot instrument a parameter trigger condition, and placing an AHDSR modulator on the value of that parameter. Parameter values are event properties, so an AHDSR modulator on a parameter value does enter its release period when the event is stopped with fadeout.

1 Like

Perfect, thanks for that Joesph! :slight_smile:

Hi, we’re having that same issue here, and so far I don’t understand how to apply the non code solution.

Can you give me an example of how I should set up that parameter trigger condition?

Sorry but I’m failing to find how to add an AHDSR modulator to a parameter condition. Where would I do that? Screenshots are welcome. Thank you :slight_smile:

Hi, there’s an even simpler solution, that wasn’t available at that time: in the trigger behavior conditions of your snapshot, add “event state: not stopping”. It will untrigger the snapshot immediately when the event enters stopping mode.

2 Likes

Aww man! Thank you! I’m gonna try it right away.

If done through code, how do you specify the fade in and out? We are using code to trigger a Snapshot Instance but I only know about FMOD.Studio.STOP_MODE.ALLOWFADEOUT. There must be a way to always have snapshots initiate with say a 1 second attack/release for transitions.

@Alcibiade In my case setting “event state: not stopping” doesn’t fix the abrupt mix change with a Snapshot exiting using Snapshot Events in FMOD Studio instead of code.

Thanks for any help!
Tom

If you modulate the intensity of a snapshot with an AHDSR modulator, you can specify the attack and release time for the intensity, which will “fade” the snapshot in/out when you start/stop the instance.

1 Like

Thanks for responding so quickly! I was thinking there would be another way to tween volume or intensity from code since with a AHDSR modulator on the Intensity the release still doesn’t work (abrupt mix change when leaving snapshot). It’s possible there is something not working between FMOD and Unity and I should try again from a fresh start.

It is a little strange that you’re running into a problem with the release, as I haven’t been able to reproduce it at all on my end - my snapshot with AHDSR modulating the intensity performs its proper release behavior when stopping the snapshot instance from code with FMOD.Studio.STOP_MODE.ALLOWFADEOUT. So that I can help diagnose the issue, would you mind providing your FMOD Studio and FMOD Unity versions, as well as a snippet of the relevant code that you’re using to start and stop the snapshot instance?

1 Like

So it turns out the Snapshot wasn’t triggering correctly (my fault! Needing to remove all snapshot instrument instances in FMOD Studio) and using the code route is working with the modulator on Intensity. Thank you!

No problem! Glad to hear you resolved the issue.

1 Like