< Return to Video

Duck Volume Audio Effect - Unity Official Tutorials

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

more » « less
Duration:
06:53

English subtitles

Revisions