Mixing and Snapshots for UE4
Checked with: Version 4.10 05/01/2016
In this video we’ll use mixer snapshots in a number of ways to trigger reverbs and adaptively mix our level in Unreal Engine 4.
Download FMOD Studio for UE4 and the tutorial assets from the Downloads Page
(0:06) This is the fifth video in the Unreal Engine tutorial series, where we are going to have a look at snapshots, mixer states and mixing with FMOD Studio and Unreal Engine 4.
(0:24) So far, we have created the multi track ambience and the 3D twister sound, and we have popped a mixer snapshot on that sound and we have implemented those sounds in to Unreal. We have also designed and implemented the character sounds, and we have got them triggering from both the animation blueprints and from the character blueprint.
(0:48) So now we are ready to jump into today’s tutorial, where we are going to create a tunnel reverberation snapshot area – so we are going to trigger a reverberation in the tunnel in our game. We are also going to design an event which triggers off a grenade explosion sound and create a hearing damage style effect with our snapshots feature. And then we are also going to set up a snapshot to duck the vehicle or character sounds depending on which character you possess (vehicle or Heraklios).
(1:18) Open up Studio to start off with, and I am going to open my mixer screen. I do that just by hitting ‘control+2′.
(1:53) So you see in this routing tab on the left hand side, we can see all of our inputs, which are our events and then also all the groups and returns that we create to help group and organise the sounds in our game. So, I have got a group for my Character sounds (same as the Character folder in my event window). And then I have also got my Environment group, so I will just drag my Twister sound into that group so it is grouped in with other Environment sounds.
(2:04) In 1.07 we updated FMOD Studio so that you get an automatically created Reverb return added to your project. If you are working in an earlier version, you will have to create this return by right-clicking in the Routing tab on the left side of the screen.
(2:30) Groups and returns are what automatically show up in the mixer window. If you wanted to individually control your inputs (events) that show in your Mixer window (for mixing), you need to select them in the routing area and assign them to individual groups.
(2:46) You can also create your own mixer view as well by hitting this plus sign right up here. You can name it what you like, and then all you need to do is drag and drop the groups or returns into that view (you can also right-click and add a Group to a Mixer View). You can have as many mixer views as you like as well, so if you have lots of events and groups you can hone in on particular elements of your game for mixing.
(3:11) The Mixer Window also includes the Snapshots view, which we already had a brief little look at in a previous tutorial.
(3:19) So I have my twister snapshot right here, and all we created it to do so far is duck the Character group.
(3:31) When you are working in Snapshots view, you are viewing the mixer that will be active when the Snapshot is active. It is important to remember that you can switch between your mixing desk and your Snapshot view really quickly, you just hit the mixing desk tab and you can switch back to your twister snapshot.
(3:58) What we are going to do now is create a new snapshot – a reverberation snapshot for the reverb tunnel. You can do this by right-clicking in the Snapshot tab on the left hand side, and select new Overriding Snapshot.
(4:05) Because we are using this snapshot to “turn on” the Reverb return, we have to scope in the reverb return. We are going to send all of the groups that I want the reverb to have an impact on to this Return with one Reverb effect on the Return (so they are all effected by the same reverb).
(4:20) At the moment we do not have anything that is sending IN to this reverb return, so we need to head back to the Mixer to set up some Sends. To do this, just right-click in the grey space below the title of the Channel and select “Add Post-fader send”. This gives us a dial that controls how much of the audio coming through this Group will be sent to the Reverb return after the signal comes out of the fader.
(4:30) So go through and right click and send the Ambience and Character groups to my reverb return. Make sure you turn up these volume dials so that there is some audio going through to the Reverb.
(4:42) The next step is to zeroing out this reverb return, because normally, we do not actually want any of this reverb return being able to be heard in the game.
(4:55) It is only in our snapshot area that I want any signal coming through this return, so let’s head back to the Reverb Snapshot to set the volume for our Reverb return.
(5:01) From here, add the reverb effect – we’re using the convolution reverb effect.
(5:05) Then open up my Audio Bin to find the impulse. It is called ‘Middle Tunnel One Way B Format 48 K’.
(5:17) Just drag and drop that into this little impulse window, and then it loads up the waveform for us to see. Scope in my wet level and dry level (so that I can see what is going on here). As you can see, when your dials are not scoped in, you can not see what values that they are set to. But because these values I will like to see at a glance, I scope them in even though I am not making any changes to them.
(6:36) So, we are ready to go with our reverb now, as we have set up our snapshot and also sent some signal through to the return. What I am going to do is save and I am going to build as well, and I am going to jump over into Unreal and we will implement the reverb.
(6:59) Back in Unreal, we can implement our Tunnel sound.
(7:13) So as you can see, our tunnel has this mysterious looking green box around it – this box is labeled in the World Outliner as a Reverb Trigger Volume, but we created this volume as a simple Trigger Volume.
(7:27) You can do that just by selecting Trigger volume on the left hand side. So, you can drag and drop one of these in, and you can make it as big or as little, or as sideways or as long, or in any location, depending on your needs.
(8:24) So what we will do is we will need to get some hooks, or behaviour triggers off this trigger volume for our Blueprint, so I just right click off the wire frame right there, and see where it says ‘level blueprint events’, just hit ‘add event’ and then where it says ‘on actor begin overlap’, click that.
(8:40) Now, Unreal is super smart, so when we click that option, it will open up the level blueprint right away, and it will add the ‘on actor begin overlap’ module right here for us to use right away. But instead of using that right away, we will also grab the ‘on actor end overlap’. So again, right click – add event – on actor end overlap. And this allows us to trigger something to happen when the actor walks into the volume and then when the actor walks out of the volume.
(9:10) The other thing that we will need to do before we can start working on our Blueprint logic, is we will actually have to grab the reverb snapshot and pop it in the tunnel (or somewhere near the tunnel so you can find it).
(9:31) Then, when you have the Reverb Snapshot selected, jump over into your level blueprint and right click, and you can add a reference to that reverb.
(9:40) From this module, drag off to type “FMOD play” and get the audio component and play command at the same time.
(9:55) And the other important one – stop – can be obtained in the same way. This time, you do not need to choose the option that gets the Audio Component for you as well.
(10:00) So all we need to do now is piece this logic together. When we walk into the trigger volume, ‘on actor begin overlap’ we want to play, and when the overlap ends, we want to stop.
(10:16) Hit compile to build the changes. Then we will jump over into the game and have a listen. Run straight over into the reverb volume that we just set up. So that is excellent, but we can make it even better.
(10:56) When we walk into a space that has a reverb, we would expect there to be some fade in and fade out, or the reverb to kind of gently trickle off once I walk out of the volume. So one way to do that is to set up an AHDSR. Jump back to Studio, and open the Mixer screen.
(11:22) Head back to the Reverb snapshot and when we select the Reverb snapshot, we can right-click on this intensity dial right here and add AHDSR modulation.
(11:51) This allows us to create an attack (fade in) and a release (fade out) around the start (trigger on) of the reverb and the end (trigger off) of the reverb. Sculpt the Attack and Release as you like – we set the Attack to one second and the release to be a bit longer, at two seconds.
(12:15) Then we save, build, and demo in the game so we can listen to what the AHDSR sounds like. After auditioning, you can choose to make mix changes like increasing or decreasing the amount of each Send that is going in to the Reverb.
(13:25) To set up the Grenade Event, we’ll start by setting up the Mixer for the Grenade sound and effects. Create a Group called “FX” and a Return called “Grenade Effect”. Make sure the Return has the volume pulled down in the Mixer as we do not want to hear the effect of this Return in normal Gameplay.
(13:46) Head back to the Event Editor window so we can start designing this sound.
(13:49) Create a new folder called “FX”, then create the Grenade sound event inside this folder. So the grenade is going to have several elements, so start off by creating two more audio tracks, to arrive having a total of 3 audio tracks. The first track will house the explosion sound effect, which we will pull out of the Audio Bin of course.
(14:14) And then we will also grab the Sine Tone from the audio bin too. Just make that one a looping sound by selecting the module and looking for the looping icon in the Deck area).
(14:42) The third track is for our Snapshot, which we can add by right-clicking in the track and selecting the “add new overriding snapshot” option. And I am just going to call it ‘Grenade Effect’. We will drag that one out as well.
(15:28) As the explosion sound is the first element of our sound design for this sound event, we line this one up at the start of the timeline, then we will key off the snapshot, and last of all the sine tone. We want the sine tone to fade in after these other elements, so let’s design the volume automation on the Sine Tone.
(15:40) Start by bringing the volume of the Sine Tone track down by about 24dB, then right click on the volume dial and select “add automation”. We want the tone to fade in from -80dB to -24dB from about 1 second to 1.5 seconds, then fade back down to -80dB at about 8 seconds. You can continue iterating on the design of this curve, however, however, iterating will be easier when you can hear the combined effect in the game.
(16:18) For the Snapshot, we’re aiming to automate the Intensity of the snapshot from 0% to 100% with a similar shape to the Sine Tone Volume automation. Setting this automation up now will mean that the fade in and out will be ready for us to hear when the event is completed. Simply right-click the Intensity dial in the Deck Area (when you have the snapshot selected) and select “add Automation”. Then, sculpt the curve from 0% to 100% to 0% between 0 and 10 seconds.
(17:12) Now, the last set up we have to do in the Event Editor screen is actually add on a low pass effect to the explosion track. We are creating this low pass effect specifically to impact on this explosion sound.
(17:42) We will automate the cutoff of the Low Pass to swoop down to muffle the sound at about the same time as our other automations take full effect. So we will start the cutoff at 22 kilohertz (this means that all the sound is passing through the Low Pass Filter) and then we will drop it down to 250 Hz
(18:06) Now that we have finished with the Low Pass Filter, double-click the snapshot to jump into the mixer screen, and we will start working with the snapshot.
(18:20) Let’s set up our Returns, Sends and Snapshot. For each of the groups, set up a Postfader send to the grenade effect, which we popped in just before. Now, this excludes the Effects group, as this is the group that the Grenade event is in.
(18:17) Jump over to the snapshot screen so we can start working on our Snapshot. So, what we will need to do is scope in the grenade effect return, and make sure that the volume is up to 0dB.
(19:24) Next we have to add a Low Pass Filter effect on the Return track (this can be done the same way as in the Event Editor Window, by adding the Effect in the Effect Deck area), but this time, because we have the intensity automation (in the Event Editor Window), we do not need to automate the cutoff in this window. So, just going to select the same cutoff as in the Event itself – 250Hz.
(19:54) The final effect we will design within this snapshot is a ducking for the character group and the environment groups (just like we did for the twister snapshot) but with a stronger ducking effect. To do this, simply click to scope in these groups and pull the volume of both faders down to about -50dB.
(20:06) We are ready to jump back to Unreal, but make sure that in your Event Editor window, ensure that your Event is assigned to the Master Bank. Then save and build. Switch back to Unreal so that we can implement this sound.
(20:32) Now, with our Grenade Event, we need to key this off in the Grenade Blueprint. Locate the Grenade blueprint through the Content Browser.
(21:02) At the moment, this Blueprint does is Spawn the Grenade Effect and Explosion Visual Effects. And it also clears the Grenade off screen when it has finished exploring. But as you can see we have a very conspicuous little gap right here, which is the location that we believe our explosion sound event is best to key off at. After the explosion visual effect is triggered, and before the actor is destroyed is a really good spot for us to throw in our sound.
(21:43) Drag off from the module, and create a “FMOD Play Event at Location” module, then, to get the location, we can actually use the ‘Get World’ location module, and just drag the return value in to the FMOD Location field.
(22:23) This is all the Blueprint code required for this sound event to play. So if we compile and save, we will jump over into the level and audition our sound event.
(22:46) Alright, so the sound triggers but you may have noticed that there was a lot of distance attenuation. To really bring this sound to the front of the listener’s attention, we will need to make this sound 2D.
(23:50) Back in FMOD Studio, select the Master track of the Grenade Sound Effect, and in the effect deck just delete this 3D panner and hit save and build. You can even run around and you can hear the various effects that we applied through the Grenade Sound Event. Take this opportunity to go back through your Event and do any balancing or adjustments that need to be made.
(24:41) When you have many snapshots listed in your FMOD Mixer window, the order that they are in actually dictates how they interact with other snapshots, it is their hierarchy.
(24:52) So with the grenade Snapshot, I want to drag that one to the top, so that it overrides any other Snapshots’ ducking. The Twister snapshot is just another layer character ducking anyway – less ducking than the Grenade Snapshot, so the Twister snapshot effect would be overridden by the Grenade Effect regardless of what order they are in.
(25:22) To get ready for the next tutorial, we will set up the vehicle snapshot for when we switch over into the vehicle. This snapshot is important to set up because the character breathing sound is an automatically activated and forever looping sound, so unless it is stopped or ducked out we will be able to hear it in the car.
(25:51) Create a new Overriding Snapshot for this Vehicle Ducking – right click in the Snapshots tab on the left hand side. With this new snapshot created, just scope in your Character group, and pull the volume down when you are inside the snapshot.
(26:02) That is all we need to do for this Vehicle Snapshot, so we will just build, and we will set it up in Unreal. And we will have a listen to it in the next tutorial when we set up the Vehicle.
(26:19) Implementing the Vehicle Snapshot is done in the same way as the Reverb snapshot – just drag it into the level, and we just select it, and in the level blueprint, all we need to do is right click, add a reference to the vehicle snapshot.
(26:49) In the Blueprint, we need to find the player pawn switching code – when we hit the ‘E’ key, it will switch between the vehicle and the Heraklion character in the game. So find the section where you jump into the vehicle (lower half). And after the last command (the possess command), we just need to tell the vehicle snapshot to play.
(27:14) So we do that, grab the audio component, and then from the audio component, just type in ‘play’ and make sure you grab the FMOD component that says only ‘play’.
(27:31) We also need to set up a ‘stop’ for this vehicle snapshot. This is done in the same way as the Reverb Snapshot, by getting an “FMOD Stop” module from the Audio Component of the Vehicle Snapshot module.
(27:54) Hit compile, and make sure you check the auto activate settings as this Snapshot should have Auto-Activate off.
(27:59) Now, when we hit play we should hear that when we switch to the vehicle (with the ‘E’ key) that the breathing sound actually ducks out completely.
(28:16) Okay, so that is everything for the snapshot tutorial.
(28:22) We are all ready to go on our final video on the vehicle, where we are actually going to set up the engine sound for that awesome looking buggy that we have in our level.
(28:31) So I will see you next time guys, ciao.
Credits and Attribution
Assets in the asset pack are provided by the Sound Librarian, Soundwave Concepts, Mixamo, Epic Games and Sally Kellaway by herself at Firelight Technologies. Please refer to the Read Me document for further information on licensing, attribution and commercial distribution.