-
In Unity it's possible to control the
-
volume of one element in your audio mix
-
based on the volume of another.
-
This is called ducking and we achieve this
-
using the Duck Volume effect.
-
I've got a simple scene setup here with
-
three musical parts, a kick drum,
-
bass line and arpeggio, these are all assigned
-
to game object which have
-
audio source component which are assigned
-
to different outputs in our audio mixer.
-
The kick has it's own group
-
and the synthesisers, the bass line and
-
arpeggio are both routed
-
to the synthesiser group.
-
What we're going to do is we're going to cause
-
the volume of the synthesisers to duck
-
based on the volume of the kick drum when it strikes.
-
This is also called side chain compression.
-
To begin I'm going to add a duck volume effect
-
using the Add drop down menu.
-
Now that the duck volume effect has been added
-
I'm going to send some audio signal to it
-
and I'm going to do this using the Send effect.
-
I'm going to click Add and choose Send.
-
Now in the inspector
-
I'm going to choose the bus
-
for the send to be routed to.
-
In this case that's going to be
-
synthesisers duck volume.
-
Now that we've setup our routing
-
we're going to set the send level.
-
Because the input
-
on the duck volume effect does not route
-
it's signal back to the main volume
-
we can turn up this send without
-
adding any volume to our mix.
-
This is a typical behaviour for a side
-
chain input on a compressor.
-
With the volume turned all the way up
-
now the full amplitude of our
-
kick will reach the duck volume effect when it plays.
-
Let's listen to the scene first.
-
Now even though we've configured our scene
-
we're still not hearing any gain reduction
-
from the duck volume.
-
If we click on the duck volume effect
-
we can configure it's parameters.
-
The threshold is the volume at which
-
gain reduction will begin to occur.
-
So our input signal, in this case
-
our kick drum, will need to exceed a
-
threshold of -10 decibels
-
before we start to apply any gain reduction.
-
Let's listen to that in action.
-
We're going to play
-
turn on Edit In Play Mode so that we can
-
change the parameters
-
and we're going to slowly reduce the threshold.
-
And so you can hear as we reduce the
-
threshold we start to hear that
-
pumping breathing effect
-
because the amplitude of the kick drum
-
is now causing our duck volume effect
-
to lower the amplitude
-
or volume of the synthesiser group.
-
Now we can move on to our next parameter,
-
which is called the ratio.
-
The ratio determines how much gain reduction
-
will be applied once
-
the threshold is triggered.
-
One easy way to think about this is that
-
it's the amount of gain reduction which is
-
applied once the threshold is exceeded.
-
Next we have the attack time and the release time.
-
The attack time is once the threshold
-
has been triggered, how quick is the onset
-
of the gain reduction?
-
The release time is the opposite.
-
Once the attack phase is completed,
-
so in this case after 26 milliseconds,
-
the release time begins to release
-
the compression or the gain reduction.
-
And so in this case after 100 milliseconds
-
we will no longer be reducing volume
-
so we'll be back to our original signal strength.
-
The makeup gain is simply an
-
additional volume control
-
that allows us to make back up
-
some of the gain that we've reduced.
-
In this case because we want to have a
-
pronounced ducking effect where we hear the volume
-
getting quieter we're going to leave the makeup
-
gain at 0, which means that no change
-
in volume is going to be applied.
-
The knee controls the behaviour of the threshold.
-
At a very low or hard knee
-
we're going to get a linear transition
-
from once the threshold is crossed
-
we're going to begin applying gain.
-
If we increase the knee value or soften it,
-
we're going to see that we're going to have a
-
much more smooth transition
-
as the gain reduction is applied.
-
And it's actually possible at high knee values,
-
as you can see from the graph changing,
-
to begin reducing gain even before
-
the threshold has been tripped.
-
As we approach the threshold at a soft knee value
-
we're going to begin to see some gain reduction
-
even before we've exceeded the threshold.
-
The side chain mix allows us to blend
-
between the effected
-
and the unaffected signal.
-
At 100% we're listening to
-
only the signal which is being
-
processed by the duck volume.
-
At 0 we're going to be listening to
-
only the original signal.
-
In addition to being able to adjust the parameters
-
via the sliders we can also
-
adjust the parameters by clicking directly
-
on the graphic.
-
If we click on the white line here representing
-
threshold we can actually drag horizontally
-
to adjust the threshold value.
-
By dragging vertically we can adjust the knee
-
and you'll see we have this nice representation
-
of how the knee is effecting the threshold.
-
If we drag to the left of the line we can
-
adjust the makeup gain
-
and if we drag to the right of the line we can
-
adjust the ratio.