Using AHDSR for bus

Hi. I’ve been wandering if there is a way for a bus to override the ahdsr property of its childrens events. I tried to assign an ahdsr to the volume of my “Music” bus, because I thought it would be more convinient to stop any music event wherever you are in the game, with only those two lines of code (and using only one ahdsr).

FMOD.Studio.Bus musicBus = FMODUnity.RuntimeManager.GetBus(“bus:/Music”);
musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);

I could totally give all the events a dedicated ahdsr but I thought it would be cleaner to have a “catch-all” ahdsr on a group bus. What do you think ?

1 Like

That would be quite handy. But I don’t even know what the AHDSR on a bus does in fact… It seems to trigger with FMOD system load/unload, not really sure…

1 Like

There is no way to do this, and we will not implement this feature. If you want to apply the same AHDSR modulation to the volume of multiple events, we recommend using a preset gain effect.

You see, effects and modulators on a bus do not affect the events routed into that bus, however much they might seem to; rather, they affect the signal of that bus, with is a submix of all the signals routed into that bus. Moreover, they’re triggered by the starting and stopping of the thing they’re attached to - and a bus’ creation and destruction is governed by technical aspects of how the mixer works. (As Alcibiade alluded, buses default to being created and destroyed when the studio system is, but they might also be created or destroyed on-the-fly in special circumstances).

As a consequence, an AHDSR modulator on a bus only plays its release periods at times unrelated to when events routed into that bus start and stop - and if an AHDSR modulator on a bus did for some reason trigger its attack and release periods whenever an event routed into the bus was started or stopped, it would apply its modulation not only to the specific event instance whose stopping or starting caused it, but to the submix of every signal routed into that bus.

If we did for some reason make it so that an AHDSR modulator on a bus volume was actually applied to the master track volumes of events routed into that bus instead of to the bus, it would cause a host of problems:

  • Such modulators would clash with modulators actually in the events.
  • It’d make the behavior of our mixer less transparent and more unintuitive.
  • It’d be deceptive about the amount of resources required, as the modulator would appear to be only on the bus, but the modulation (and thus the resource cost of that modulation) would be applied to every affected event instance.
  • It would prevent that small number of projects that do need AHDSR modulators to trigger based on bus creation and destruction from using that feature.
  • It would achieve nothing that isn’t already possible by putting AHDSR modulators into individual events.

Thus, as I said above, we will not implement this feature. If you want to use the same modulation in multiple events, we recommend using preset effects, instead.

2 Likes

Thanks you for this detailed answer Joseph !