Automating separate parameters using distance inside a single event?

Hey there.

I have a single 2D event with 3 audio tracks, each track containing a stem for a full music track. I have 3 parameters set up within this event - each with a gain automation for each respective track. I’m curious to find out if I’m able to somehow automate the gain of each track separately using distance, but at different parts of our 2.5D map in Unity. Basically so that each parameter is almost acting like it’s own… pseudo-3D event rather than just being triggered on/off. The end goal is pretty much this:

point A = Player starts here, and only hears layer 1.
point B = After the player moves right, layer 2 fades in, but when the player stops at B, the music stops fading in as well at around 50% of it’s max volume until the player moves again.
point C = Layers 1 and 2 are both at full volume in this section of the map, and retain this volume for a large portion of the map.
point D = You guessed it; if the player stops here, layer 2 stops fading out at around 70% max volume and layer 3 has started fading in and is at 30% max volume.

Is this possible to do within one event, possibly using some API magic? Or would I have to separate the stems into different events and populate those around the map? Ideally I’d like to keep everything for this particular music track in one event for cleanliness. Additionally, while testing things out, I’ve noticed the distance parameter emits from a single point, no matter how large the object in Unity is. I know 3D events have the ability to widen that point, but they don’t seem to retain the stereo image of the original mix.

Of course if there’s a better way to do this, I’m all ears as well. Still pretty new to FMOD so I’m still getting used to how things work and all that.

Have you looked at the “Music/Level 02” event in the “examples.fspro” project that’s included in every installation of FMOD Studio? It does exactly what you describe. The only change you’d need to make would be to replace the “Area” user parameter with a distance built-in parameter.

It sounds like you might be using a spatializer effect in your event’s master track signal chain to attenuate your music over distance. If so, delete this spatializer effect; if you’re using the method from “Music/Level 02” to automate individual track volumes, the attenuation from the spatializer effect is redundant and unnecessary. As a side effect, deleting the spatializer effect will mean your music is no longer panned to sound like it’s coming from a particular direction, meaning that it will retain the stereo width of the source audio files.

Right, I did take a look at the “Level 2” event while I was poking around for solutions before posting here. If I’m understanding it right, it acts linearly, and each section has to be “baked in” using automation. If that’s the case, I’m hoping I can figure out something that’s more modular. I realize now that was not entirely clear in my original post, so my bad on not clarifying that all too well.

Ideally, I could do something like create a cube in Unity, and set it so that it contains a parameter change; e.g. when the player is in the cube, the parameter is at 100, but when the player leaves the cube, the parameter starts to decrease to 0 based the player’s distance from the cube. I’ve gotten the former part working using parameter triggers, but not the distance part. Our maps are not entirely linear, so I’m thinking a system like this could compliment that. Would I have to resort to separate events in this case?

So you need the parameter value to change according to the position of the player pawn within a level, rather than relative to the position of the emitter? For that, you’ll need to use the method above, but use a user parameter that represents distance from the cube rather than a distance built-in parameter, making it even more identical to the “Music/Level 02” example. Your game’s code can set the value of a user parameter at any time for any reason, so it should be fairly trivial for your programmer to update the value of the parameter based on the player pawn’s position within a level.

I’m not sure why you suspect multiple separate events would be needed for this. Is there some behavior requirement that you haven’t described?