I am currently facing a situation where I want one of the sub mixers be the source for a duck effect on the main mixer.
My mixer setup is somewhat like this:
Main
UI
Sound effects
Player
Explosions
Ambient
Music
It’s a bit more complex than this, but this is the example. Now I want for instance an explosion from the Explosion channel to make the volume from the Music duck. However, my setup is with multiple Mixers, rather than a lot of groups in groups. Is this possible?
Same problem. Has anyone found a solution or workaround to this?
We need to split the only mixer for a game into several mixers, due to audio spikes/glitches on XBox builds. Splitting the only mixer into several mixers would help decreasing audio resource overloads.
However without cross-ducking between mixer, this would mess up the whole ducking system.
As far as I can tell, it’s not possible to send/receive audio signals to other mixers, only to other groups within a mixer, however it is possible to output an audio mixer to a specific group in a parent mixer which provides some scope for a workaround.
The only method I can think of is to have a master mixer, with multiple nested groups, and then apply all of the effects processing on that mixer.
You can then use individual mixers for specific sound types as you are now, but output them to their corresponding group on the master mixer where effects could be applied.
Essentially what this does is turns it into a two tier structure (as far as mixers are concerned anyway) by moving effects processing to a master mixer while keeping the control of having different mixers for different sounds (where it’s easier to apply snapshots, layer music etc.). Each mixer would output to a corresponding mixer group on the master mixer which is reserved for user volume control and effects processing.
Using Jordii’s mixer as an example, the groups on the master mixer, would look something like this:
Master Mixer
Music master group
Sound FX master group
Player group
Explosions group
Ambient group
UI Master group
And the mixer structure would look something like this, with each mixer routing to a corresponding group on the master mixer.
Master Mixer
Explosions mixer (outputs to explosions group… and so on)
Player Mixer
Ambient Mixer
UI Mixer
Music Mixer
This might solve your problem, or it might just as well create others. If you’re affected by this, I’d be really interested to hear your thoughts on it. I’m writing an article on mixer structure in Unity and, as well as hopefully solving the issue you’re having, your feedback would very helpful either on here or you can email me@johnleonardfrench.com
What I used to do for quite some time was something alone the lines of:
Main
UI mixer
Music mixer
SFX mixer
SFX sidechain mixer
So I would drive explosions through this special SFX mixer, to which ‘SFX Mixer’ and ‘Music’ would duck.
However, I steered away from this approach completely. I have one main mixer, and the rest is just nested groups. It allows me to keep proper hierarchies in there, while being able to send/receive audio across all of the groups.
This approach takes away snapshots from me. But as it turned out, I think snapshots are a horrible feature anyways, since they control ALL the parameters, which adds a lot of manual labor when projects become complex. What I did do to compensate for this was write a scriptable object asset which allows me to define macros, and another script which applies these values at runtime.
A single macro contains one 0…1 slider, a macro name in a string format, and one or multiple destinations. These destinations are directly mapped to exposed values in the mixer. So for example, macro “lowpass”, is mapped to a lowpass filter frequency attribute in my mixer parameters. For this entry I define that 0…1 for “lowpass” is mapped to 20…20000 on the frequency parameter on my mixer. I also have curves that allow me to define how these map out, so they don’t go in a non-linear fashion. I also can map another mixer parameter under the “lowpass” macro to perhaps dial up distortion or something the more its value reaches 1. Externally I’m just able to set “lowpass” to 0…1 and this will be automatically reflected on my mixer, without having to resort to Snapshots.
Because that’s really the case, with Snapshots you often want to change some values, not the state of an entire mixer. So working this way has an added benefit of this approach, which is useful when your mixer becomes complex. Another added benefit is that it allows you mix in multiple values in at the same time, whereas with snapshots you’re always forced to choose one or another, or a cross between snapshot values. Also very much a constraint when your product becomes more complex.
Also if you were to use this in your article, could you please credit me?
Thanks for this, it’s really interesting to hear how you’ve approached it. And I guess that the simplest approach to the multiple mixer issue is to just not use multiple mixers as nested groups can achieve the same thing, just without being able to use snapshots easily.
As for avoiding snapshots I can understand why you’ve gone down that route. It doesn’t take much before you’re setting multiple parameters in a snapshot, when really you just want to change one and, although a lot of the mixer functions are designed to emulate DAW features, imagining a setup like this in Cubase for example, where one automation change affected everything, would be completely unworkable.
Thanks again, I promise to credit you if I reference your methods.
Yeah! The idea actually stems from Ableton’s macros. When I do music production I often have one macro controlling multiple things. So of course you can change single parameters in the mixer directly. But my approach allows me to have more abstract macros, controlling multiple stuff. Like “eeriness” or “health”. With the health example I might want to lower the lowpass frequency of the music, creating a more claustrophobic atmosphere, while making a heartbeat’s volume louder. It also helps other developers to think in these abstract terms, rather than direct technical audio terms.
Thanks for sharing these insights, interesting stuff! I am facing the following situation: we would like to add a reverb system to our upcoming game, which is already working (using just one mixer for everything). Now, the question of “preset-handling” has arisen, and I was researching using a separate “Reverb-Mixer” as an effect box for better workflow (we would just need to load the correct mixer depending on the level).
However, this isn’t working as sending from one mixer to another is impossible.
My guess is that a custom-solution with exposed Reverb settings is probably our best bet (e.g. defining reverb settings for each level and then loading them via code, or “Macro-style” like you are doing, Jordii). What do you guys think?
Hey FBP, sorry for the late reply! I think the macro thing is a bit of an overkill for this situation, but having all of these in code would be just fine imo. If it keeps being a recurring thing, you might want to consider creating something similar.
Having said that, if your hierarchy is ReverbMixer > SFXMixer you can maybe use AudioMixer.outputAudioMixerGroup to route SFXMixer through different reverb mixers. I have never done this, so not sure if that works. But it might be an easier solution.