Skip to content

Tutorials · Sound and Music · Chapter 7

Echoes and water

45 minutes Uses: AudioSource, AudioMix, AudioZone, Area

By the end

  • The waterfall’s roar in the cave and the water in the flooded passage, each a placed loop, the waterfall falling away Quadratic
  • Three effects added to the crypt’s mix, each unticked: a LowPass on Master, a Reverb and a Delay on Sfx
  • Three Snapshots, cave, passage and well: each bus’s Volume and a switch for each of its effects
  • Three Audio Zones, each with its Snapshot, Fade and Priority: the cave rings, the passage muffles, the well answers each step
  • Who decides what you hear when two zones overlap
On this page

The waterfall and the water

Two more of the starter’s sounds: waterfall.wav, a roar, and water.wav, the lap of the flood, each a loop of 4 seconds. Each belongs to its room: the waterfall on the cave’s north wall, the water over the flooded passage.

  1. In Assets, click waterfall.wav in audio, set its Stream to Never in Details, and press Save. Do the same for water.wav. Each is over three seconds, so Auto would stream it; a short loop held whole, as the crackle and the drip are, plays its seam with no gap.
  2. Select waterfall, in cave. Press Add component and choose AudioSourceComponent. Set Clip to waterfall.wav and Volume to 0.5, and tick Looping and Autoplay. Leave Bus on Sfx, Positional ticked and Rolloff on Quadratic, as they come. Set Max Distance to 192 and Min Distance to 32.
  3. Select water, in passage, and give it the same: Clip water.wav, Volume 0.6, Looping and Autoplay ticked, Max Distance 176, Min Distance 112.
  4. Press Ctrl+S.
The whole crypt at 85.5% with waterfall selected on the cave’s north wall: a small pink ring round the waterfall and a large pink ring centred on it, reaching across the whole cave and a little into the hall and the passage either side of it; the Inspector, narrowed to audio, shows Clip waterfall.wav, Bus Sfx, Volume 0.50, Looping and Autoplay ticked, Positional ticked, Max Distance 192.00, Blend 1.00, Rolloff Quadratic, Min Distance 32.00, Pan 0.00
The waterfall’s rings: Min Distance 32 round the pool, Max Distance 192 across the cave.
The same view with water selected over the flooded passage: a pink ring round the whole passage and a larger one past it on every side, a little way into the cave; the Inspector shows Clip water.wav, Volume 0.60, Looping and Autoplay ticked, Max Distance 176.00, Rolloff Quadratic, Min Distance 112.00
The water’s rings: Min Distance 112, nearly the whole passage, and Max Distance 176.

Three effects, switched off

Each room that sounds like itself needs an effect: the cave a Reverb, its walls answering; the flooded passage a LowPass, everything dulled; the well room a Delay, each step answered once and again. All three go into the crypt’s mix now, each unticked, and the rooms switch them on in the next section. The mix’s own default, what a room in no zone hears, is the chains as their Enabled boxes say: dry and clear.

  1. Select mix. On Master, press + beside Slots: a second slot, a Gain of 0 dB as a slot comes. Set its Effect to LowPass, its Cutoff to 800 and its Resonance to 0.707, and untick its Enabled.
  2. On Sfx, press + beside Slots: a third slot, after the Panner. Make it a Reverb: Size 0.8, Decay 3, Damping 0.3, Mix 0.5. Untick its Enabled.
  3. Press + again: a fourth. Make it a Delay: Time 0.4, Feedback 0.3, Mix 0.4. Untick its Enabled.
  4. Press Ctrl+S.
The Inspector’s column, widened and narrowed to audio, on mix: Master’s Slots with two items, 1 Compressor shut and 2 LowPass open, Cutoff 800 Hz, Resonance 0.707, Enabled unticked; Music’s one slot, Gain, shut; Sfx’s Slots with four items, 1 Compressor and 2 Panner shut, 3 Reverb open, Size 0.800, Decay 3.00 s, Damping 0.300, Mix 0.500, Enabled unticked, and 4 Delay open, Time 0.400 s, Feedback 0.300, Mix 0.400, Enabled unticked; then Snapshots with three items, 1 cave, 2 passage and 3 well, Ducking and Sends with none
The three new slots, each unticked: Master’s LowPass, Sfx’s Reverb and Delay.
The LowPass’s Cutoff
Above this, in hertz, the sound is rolled away; under it, it passes. At 800, the body of the music and of the water passes and their brightness goes: a sound heard through water, or through a wall. From 20 to 20000.
The LowPass’s Resonance
How the filter treats the frequencies at its Cutoff: 0.707 is flat, rolling away smoothly; higher lifts a peak there, a ringing edge. From 0.05 to 24.
The Reverb’s Size
How far apart the walls are, 0 a narrow shaft and 1 a cavern. The cave is big: 0.8.
The Reverb’s Decay
How long the room’s tail takes to fall sixty decibels, all but out of hearing, in seconds: here 3. It is its own field, apart from Size: a small tiled room can ring long, and a big soft one hardly at all.
The Reverb’s Damping
How much faster the highs die in the tail than the lows: 0 is bare stone, every frequency ringing alike, 1 a room full of soft things. The cave’s 0.3 is wet rock.
The Reverb’s Mix
How much of what comes out is the room rather than the sound as it came: at 0.5, half each. The dry half is quieter than the sound alone, so a step in the cave lands softer and rings on.
The Delay’s Time
How long until the first repeat, in seconds: 0.4, a well deep enough to answer.
The Delay’s Feedback
How much of each repeat feeds the next: 0 is one echo; at 0.3 each repeat is three tenths as loud as the one before, and they fade out quickly. Up to 0.95.
The Delay’s Mix
How much of what comes out is the echo rather than the sound as it came: at 0.4, two parts echo to three of the step, so the answer is a little softer than the step.

Three snapshots

A snapshot is a named mix: each bus’s volume, and which of its effects are on. The mix can slide to one, and back. The crypt gets three, one for each room with an effect: cave, passage and well. Each switches on its room’s effect and leaves every other slot as the chain has it.

  1. Select mix and press + beside Snapshots: a snapshot with no name, every Volume at 1 and no switches. Open it and type cave into its Name.
  2. Open its Master, and press + beside its Effects twice: two switches, one for each of Master’s slots, each as its slot is, Compressor ticked and LowPass unticked. Press the + beside Music’s Effects once, and beside Sfx’s four times. Then tick Sfx’s third, Reverb.
  3. Press + beside Snapshots again: a new snapshot, empty as the first was. Name it passage, and give it the same presses cave got: + beside Master’s Effects twice, beside Music’s once and beside Sfx’s four times, each press a switch as its slot is. Then tick Master’s second, LowPass.
  4. Press + beside Snapshots once more: a third, empty too. Name it well, give it the same seven presses, tick Sfx’s fourth, Delay, and set Music’s Volume to 0.5.
  5. Press Ctrl+S.
The Inspector’s column on mix with Effects shut and the snapshot 1 cave open: Name cave; Master, Volume 1.000, Effects with two items, 1 Compressor ticked, 2 LowPass unticked; Music, Volume 1.000, Effects with one item, 1 Gain ticked; Sfx, Volume 1.000, Effects with four items, 1 Compressor ticked, 2 Panner unticked, 3 Reverb ticked, 4 Delay unticked; Send Amounts with no items; 2 passage and 3 well shut below it; Ducking and Sends with none
The cave snapshot: a switch for every slot, each named by its slot’s effect, and the Reverb ticked.
SnapshotMaster: Volume, switchesMusic: Volume, switchesSfx: Volume, switches
cave1; on, off1; on1; on, off, on, off
passage1; on, on1; on1; on, off, off, off
well1; on, off`0.5`; on1; on, off, off, on
The Audio Mix’s Snapshots
The named mixes the mix can slide to. A zone slides it to one while the knight stands inside it, and a script can ask for one (chapter 9). Besides these, every mix has one of its own, default: the chains as their Enabled boxes say, every bus at 1, which a room in no zone hears.
A snapshot’s Name
What a zone, or a script, calls it: cave, passage, well. A zone whose Snapshot names none the mix has does nothing, and the Problems tab says so.
A snapshot’s Master: its Volume and its Effects
Volume is the bus’s level in this mix, from 0 to 1; the slide takes it there from wherever the mix stands. Effects is a list of switches, one for each slot of Master’s chain, in order: ticked, the slot is on in this mix, unticked, off. Each reads its slot’s place and effect, 1 Compressor, 2 LowPass.
A snapshot’s Music: its Volume and its Effects
The same for Music: the well’s takes it to 0.5, so the well’s answer, softer than the step, is heard over the music; its one switch keeps the Gain on.
A snapshot’s Sfx: its Volume and its Effects
The same for Sfx, four switches: the Compressor on in all three, the Panner off, and the Reverb or the Delay on in its own room.

Three zones

An Audio Zone slides the whole mix to a snapshot while the listener is inside its Area, and back to the room’s default as he leaves. The + Add node menu’s Audio Zone comes with both: an Area, which is where, and the zone, which is what.

  1. Select cave. Press + Add node and choose Audio Zone. Rename it cave_zone. In its Area’s Shape, set Size to 240, 144 and Offset to 8, 0: the cave and the arch to its east. Leave Layer and Mask as they come: each reads 0, the first layer, the knight’s.
  2. In its AudioZoneComponent, set Snapshot to cave: type it, or choose it from the list beside the field, which holds the mix’s snapshots. Set Fade to 1.5.
  3. Select passage, add an Audio Zone and rename it passage_zone: Size 240, 144, Offset -8, 0, the arch and the passage; Snapshot passage, Fade 0.5 as it comes, Priority 1.
  4. Select well_room, add an Audio Zone and rename it well_zone: Size 208, 160, the well room’s floor; Snapshot well, Fade 0.25.
  5. Press Ctrl+S.
The whole crypt at 85.5% with passage_zone selected: a yellow outline with handles round the flooded passage, from the arch on its west to its east wall, labelled passage in pink at its top; a fainter pink label, well, over the well room; the Inspector, narrowed to zone, shows AudioZoneComponent with Snapshot passage, Fade 0.5 s and Priority 1
The passage’s zone: its Area takes in the arch, which the cave’s takes in too.
The Inspector’s column, widened, on cave_zone: Node with Position 0, 0; Metadata; AreaComponent with its Shape open, Kind Rectangle, Size 240.0, 144.0, Offset 8.0, 0.0, Layer 0, Mask 0; and AudioZoneComponent with Snapshot cave, Fade 1.50 s and Priority 0
cave_zone: an Area over the cave and the arch, and the zone that names cave.
The Audio Zone’s Snapshot
The snapshot of the scene’s mix the zone slides to while the listener is inside its Area. Empty, as a zone comes, it does nothing.
The Audio Zone’s Fade
How long the slide takes, in seconds, both in and out: from 0 to 10, 0.5 as a zone comes. What slides over it is the volumes, and from chapter 8 the send; a switch is on from the slide’s first step, and on the way out stays on until the slide is over. So the cave’s Reverb rings from his first step in, and on as he leaves until the slide back is over; in chapter 8 its 1.5 carries the music’s ring in. The well room’s 0.25 takes the music down to its 0.5 over a quarter of a second, and its Delay answers from his first step in.
The Audio Zone’s Priority
Where two zones overlap, the higher wins: 0 as a zone comes. The passage’s 1 wins the arch. On a tie, the first zone in the Hierarchy wins: without the 1, the cave’s, and the arch would ring.

The cave’s and the passage’s zones both take in the arch between them, so the way from one to the other is never in neither: a gap would slide the mix back to the default and out again in a step. They overlap in the arch, and the passage’s Priority wins it: the mix turns to the passage’s within a step of his feet passing the arch’s west edge. The entrance hall and the bridge room are in no zone, and keep the default.

Rooms that sound like rooms

  1. Press F5 and click the Sound tab.
  2. Walk below the cave’s door and about; then up into the cave, and about again. Walk east through the arch into the passage. Go back, down through the bridge room and west through the arch into the well room, and step by the well.
  3. Press F5 to stop.
On the bridge room’s east bank, below the cave’s door, in no zone: he walks a second one way and a second back. Listen to each step end as it lands, and nothing after the last.
What it sounds like

Calm music, and footsteps on stone, each short and clean, then the music alone.

The same walk in the cave’s east side, in the cave’s zone. Listen for each step landing softer and ringing on into the next, and, after the last, the cave’s ring hanging for most of a second.
What it sounds like

The same calm music with a distant roar under it; footsteps, each followed by a wash of echo that fills the gaps between them and fades away after the last.

The editor two seconds into Play with the knight in the cave’s east side: the Viewport shows the cave, the cave zone’s yellow outline round it; the Sound tab’s Mix band reads Held by The zone the listener is in, "cave", Now On "cave"; Voices (8): the waterfall heard at -25.3 dB and the music at -3.1 dB, the rest silent; the Inspector shows cave_zone’s AudioZoneComponent, Snapshot cave, Fade 1.5 s, Priority 0
In the cave: its zone holds the mix, settled on cave.
From the cave by the arch, a second and a half standing, then he walks east through the arch into the flooded passage and stands. Listen for everything losing its highs as he comes through the arch, the music, the water ahead of him and his steps all dull at once: muffled, not quieter.
What it sounds like

Calm music and a distant roar; footsteps; then the music, the lapping water and the steps all go dull and dark together, at about the same loudness, as if heard from under water.

The editor two seconds into Play with the knight in the arch between the cave and the passage: the Viewport shows the arch, the passage zone’s yellow outline starting at it, the ghost in the passage to his east; the Mix band reads Held by The zone the listener is in, "passage", Now On "passage"; Voices: water heard at -6.8 dB, waterfall at -39.5 dB; the Inspector shows passage_zone, Snapshot passage, Fade 0.5 s, Priority 1
In the arch, inside both zones: the passage’s Priority holds the mix.
From the bridge room’s west bank, in no zone, he walks west through the arch into the well room, to the well; then one step east, and one back. Listen for the music stepping back as he comes into the well room, and for each single step answered four tenths of a second later, a little softer, and again, softer still.
What it sounds like

Calm music and footsteps on stone; through the arch the music grows quieter and each step starts to echo; then two single steps, each followed by two fading echoes.

By the well, the answer comes 0.4 s after his foot lands, 3.5 dB under the step, two parts of echo to three of the step; and again 0.4 s later, three tenths as loud. The music there is 6 dB under what it is on the bridge room’s bank, the well’s Volume of 0.5. In the passage, what is over twice the LowPass’s 800 Hz is far under what it is with the LowPass unticked, and what is under half of it is the same.

Held by, in the Sound tab’s Mix band
Who has the mix now, and the snapshot they asked for: The zone the listener is in, here "cave"; The room’s default, "default", in no zone; or, from chapter 9, A script’s set_mix.
Now, in the Mix band
Where the mix stands: On a snapshot once it has slid there, or Sliding to one, with how far it has got.

Who decides what you hear

The rooms

NodeComponentFieldValue
audio/waterfall.wav, audio/water.wavtheir DetailsStreamNever
waterfallAudio SourceClip, Volumeaudio/waterfall.wav, 0.5
Looping, Autoplayticked, ticked
Max Distance, Rolloff, Min Distance192, Quadratic, 32
waterAudio SourceClip, Volumeaudio/water.wav, 0.6
Looping, Autoplayticked, ticked
Max Distance, Rolloff, Min Distance176, Quadratic, 112
mixAudio MixMaster slot 2LowPass: 800 Hz, 0.707; unticked
Sfx slot 3Reverb: 0.8, 3 s, 0.3, 0.5; unticked
Sfx slot 4Delay: 0.4 s, 0.3, 0.4; unticked
Snapshotscave, passage, well, as the table above
cave_zone, under caveAreaShape Size, Offset240, 144; 8, 0
Audio ZoneSnapshot, Fade, Prioritycave, 1.5, 0
passage_zone, under passageAreaShape Size, Offset240, 144; -8, 0
Audio ZoneSnapshot, Fade, Prioritypassage, 0.5, 1
well_zone, under well_roomAreaShape Size208, 160
Audio ZoneSnapshot, Fade, Prioritywell, 0.25, 0

Check it works