Lesson 2: The Parameter
Hello! Welcome back! This is part two of my Introduction to FMOD. Now that we’re done with the absolute basics, things should start moving a bit quicker. The first part of this look at FMOD focused on breaking down the Event Editor and helping a new user find their way around the program, as well as how to lay out samples and modules on the time line. If you missed it, you can find it by clicking here, or check out all of my FMOD Lessons here. I closed the last lesson by mentioning that it was absolutely okay if things felt a little bit linear in the last segment. With any luck, by the end of this one you’ll start seeing the power of the parameter and how to really start making the world a bit less predetermined. The parameter is arguably the most important part of FMOD, so if you desire to make a living working with FMOD, make sure you understand what is being presented here. Before stepping forward, please know that I use the words “Game Parameter” specifically to refer to parameters that supply information to, or get information from, your game. “Effect Parameter” refers to the various knobs, levels, and faders in your effects chains and throughout your routing signal path. “Parameter” is sometimes used interchangeably, but most often refers to Game Parameters, especially in this lesson. It goes without saying that if you have any questions about any specifics regarding FMOD, feel free to leave a comment here, email me at Hello@ChrisPrunotto.com or shoot me a message on twitter @SoundGuyChris! Knowledge is power, so ask away!
Now, read on to continue!
A Parameter Is An Adjective
Concept: If, in FMOD, Everything is an Event, then parameters are how you describe everything.
How big? How loud? From which direction? How far away? These are all questions that parameters have the descriptions for. One of the quickest ways of learning what FMOD parameters do is by simply opening the FMOD tutorials project (My Documents > FMOD Studio > examples > Examples.fspro on Windows) and going through some of the events, hitting play, and turning the knobs at the top of each events respective Event Editor window. Or grab a sandwich, read this lesson on Parameters, and either put the knowledge to use, or grab some samples and go nuts. Both are equally valid approaches. As always, the operations manual of FMOD is one F1 keystroke away.
And what exactly, does it offer me?
At its core, a game parameter is nothing more than an arbitrary value. Like I mentioned in part one while discussing the scatterer module and how the game will interpret what values FMOD is using will mean, a game parameter is very much the same. FMOD will interpret what the values that the game is sending it will mean. Or more accurately, you will design sounds for those interpretations that FMOD creates.
It’s a bit more difficult to explain in words than it is to see in action, but imagine you had a completely arbitrary linear scale of 0 through 2 called “size.” Size can be applied to pretty much anything, but in FMOD, we’re creating a size scale for one single event, called “explosion.” So we can now describe our thing (explosion) with a description (called size). The non-middleware approach to game sound design might have three samples: explosion_small, explosion_medium, explosion_large and you’ll simply pick the appropriate sound effect and play it in your game. That’s kind of limiting isn’t it? All you get are three sounds with no variation. Even pitch randomization won’t really help you to add variety here. And what if you wanted more sounds added in? Say you wanted an explosion_medium-large for those times when the large explosion was too much, but medium wasn’t cutting it? Well then you might need to get your programmer involved to add to some arrays and create some new functions depending on the complexity…and let’s be honest: What programmer has the time to help the poor sound guy or gal out? This is the problem that parameters can help solve.
Using parameters, instead of small, medium, and large, you now have an arbitrary 3-point scale (0, 1, and 2. You’ll soon see though, that I’m lying – this scale is definitely not limited to just whole numbers!). Setting the intensity to 0 and clicking play will pop off your small explosion. Setting it to 1 will be your medium and 2 will be your large one. Those are your basic explosions. That’s the absolute basic solution that parameters offer. In code, it’s just as easy to pass in a playsound(0) function as it is to pass in a playsound(‘explosion_small.wav’) function (Note: This is a gross oversimplification of both the setting of FMOD parameters in code and of any given engine’s audio playback functionality. The analogy however, is not far off base. I am by no means suggesting that sound implementation is a quite so trivial a process. We’ll come to implementation later!). They essentially do the same thing. But what if you wanted the aforementioned “explosion_medium-large” sound? Well, with FMOD, you can just plug in playsound(1.5) and you’ll be smack dab between 1, our medium explosion, and 2, our large explosion! No new samples required!
Concept: Game Parameters are a means of describing game scenarios and dynamically generating and interpolating the results in between them.
You can take this a few steps further with some creative sound design to really make the most out of the three samples you have (which is, as I said before, one of the core tenets of interactive sound design for video games – to stretch even the tiniest sounds as far as they can possibly be taken). Let’s exaggerate our sounds a bit: At zero on our size scale, let’s increase the pitch of the small explosion, and decrease the volume so that it sounds a bit tinnier…in other words, smaller! Tiny even! We can gradually scale back these shifts toward their zero points over our scale so that by the time we get to 0.5 on our scale, our pitch alteration is back to an unaltered 0 semitones and volume is back to 0dB. What have we done here? Well, at 0, we have the equivalent of an “explosion_tiny” in our arsenal of sounds, and our 0.5 now represents our “explosion_small.” We didn’t create any new samples though! We just used what we had to create something new. We can also extrapolate our scale in the other direction too. Let’s take increase our scale from 0-2 and make it 0-3. Remember, the numbers are arbitrary! All you have to do is right-click “Size” and type in a new number. From 2 until our scale reaches 3, let’s gradually add reverb and boost the Sound Size property of FMOD’s 3D-Panner for our event. By the time your scale reaches 3, your “explosion_large” now sounds more like “explosion_nuclearbomb.”
So now you essentially have 5 sound effects created from your original 3. There is a tiny explosion (which is the small one pitch shifted up) at 0, the small explosion at .5, medium at 1, large at 2, and a huge one (which is the large explosion with reverb and increased size and presence) at 3. And in between them all, you have a range of unique characters of explosions that cross-fade between them from small to large. But wait! There’s more! By applying just a small amount of pitch variation on each press of play, to the master track, we can create a virtually endless amount of explosions all with not only a unique pitch, volume, and reverb parameters but with unique character as well! All of this is being dynamically created from just three samples, all of which can be accessed by simply passing a new number as the argument for your “playsound” function, and none of which requires buying your programmer a round at the pub for taking time out of his schedule to make your sounds function correctly for you.
…and did I mention that if this weren’t enough for you, you could turn those single sound modules into multi-sound modules, and further multiply – or even exponentially increase – the amount of explosions you’re now able to pick from? I’m not much of a nerd, but if I were, I’d think it was pretty cool.
Now, I mentioned earlier, it might be easier to see this in action than just to read about it. Well, luckily, this lesson has thus far effectively replicated one of the examples included with FMOD Studio, which I’ve included an image of above. Go ahead and open up the Examples project and navigate to the Explosions > Single Explosion event. Play around with it for a moment if you wish and then we’ll continue, and start creating some parameters of our own.
Let’s Create Some Adjectives
The way to create a game parameter is simple. Open up an event and look above your time line.
Click it and you can create a parameter from scratch – just select “Add Parameter…”. Give it a name, and then minimum and maximum values. It’s important to remember that, again, these values are 100% arbitrary. What that means is that you are free to choose the scale that makes the most sense for you. For example, our 0-3 scale worked just fine above, but if you’re designing a car engine, 0-3 makes no sense. 0-10,000 would allow you to be more accurate when mapping out how your engine sounds at different gears and when revving up or downshifting – though you could STILL use 0-3 without any repercussions. By the same token, negative values are allowed. If you’re designing sound for, say, a football game, you might pass either the number of yards gained or lost in a single play to help determine the sound of the crowd reaction for the event. 0-1 tends to be the range that I use when working with percentages, but 0-100 works as just as easily! The key is flexibility – you’re not forced to use any scale, you’re allowed to use what works for you. The Notes section of the Properties pane is an absolutely perfect place to describe what measurements your parameters are in, and will help others working on the same project to understand what you have done, are doing, and intend to do.
Concept: Even though parameters are nothing more than arbitrary values, planning ahead is the best way to ensure that you don’t have to go back later and change your scale in your game. Always try to shoot for consistency across many events in your project to avoid having to change it all later.
Once you’ve decided on your scale, click OK. A tab will appear next to the Timeline tab with whatever name you typed and you’ll be looking at…a blank Timeline. If you haven’t guessed it by now, the Timeline is in of itself a parameter, answering the question of “When” something happens. For instance, a door slamming might happen at 1 second into Timeline parameter, in the same way that the exemplified explosion_medium happens 1 point into the Size parameter described earlier. The difference is that the Timeline generally (though not always) scrolls along at a fixed rate, and in only one direction (forward!), while a Game Parameter can scroll either backward, forward, or stay perfectly still and change directions based on your game.
Right click on your Audio 1 track and create a new multi sound module. Populate it with some sounds and drag it all the way to the right edge of the screen. You’ll notice that there is a hard limit to where you can drag the module. You can’t endlessly go to the right like in the Timeline parameter. Why? This happens because you gave your parameter an explicit boundary. Hit play on your timeline and you’ll hear…(assuming your playlist is empty, and your Parameter 1 knob at the top of the screen is dialed down to zero, or whatever minimum you’ve set)…you’ll hear nothing. Make sure it’s still playing and then turn your new Parameter’s dial up. You’ll notice the cursor scroll across, like the playhead on the Timeline parameter. When it finally intersects with the multi-sound module, you’ll hear it play. If the module is set to globally loop, you’ll hear all the entire playlist loop through endlessly. Conversely, if the sample is set to loop, then you’ll hear that sample. Otherwise, the sound will play just once. In all cases, the sound will stop looping once the cursor exits the multi-sound module.
Digging Into Parameter Automation
So as you’ve seen, you can use a parameter to actually play back modules. You can do this for a Multi Sound, Single Sound, Programmer Sound…any of them! When the cursor intersects it, it will play. But did you know that you can also use it to automate parameters over time, or across the values of a parameter? I actually described it above in the explosions example, without necessarily saying so. Let’s make it happen! For the audio-uninitiated, an automation curve is nothing more than telling a specific knob or fader how to operate and when. It allows the mixing console or DAW to remember your choices so you don’t have to try and perfectly recreate them every single time you play your track. In the contexts of a Game Parameter, it simply replaces the always-moving-forward time parameter (say, increasing the volume of a track by 3dB), with an arbitrary number that can sweep back and forth as the game decides. Much like any other modern DAW you can automate almost any knob or fader in FMOD. Again, this is one of those things that is best shown and not told.
So let’s try it.
Drop a longer sample, like a song, into a blank event on the Timeline parameter. A single sound module will do fine. Create a new parameter and call it “EQ PARAM” and give it a range from -50 to 50. We’re going to adjust an Equalizer over time, using the Equalizer parameter. Click the Audio 1 track to bring it into focus on the Deck and add a 3-EQ plugin, post-fader. Now right-click on the Low knob of the EQ and click “Add Automation”, then repeat for the Mid and High knobs. You should see a little triangle appear at the lower-left hand corner of the Audio 1 track strip. Click it to expand the automation lanes we’ve just created, and begin drawing in automation to your hearts content by clicking and dragging on the lane. Using 0 as my reference point (the middle of the screen) and working backwards into the negatives, I rolled off the high end as the numbers increased, and boosted the low end as we got into the negative space. I created curves for the mids to just sweep through, but made sure that there was no change for any parameter at zero. Now bring the EQ PARAM knob from -50 to 0, right click it and hit “Set as Initial Value” so that you can quickly return to zero by double clicking on it. Play your event, and your long sample should start. It should sound normal at first because your EQ PARAM is set to 0, and none of the knobs have changes at zero. Sweeping your EQ PARAM knob and you should begin to hear some pretty drastic changes as you turn it. If your Audio 1 3-EQ effect is still displayed in the deck, you can even watch the knobs move in real time. If this is confusing, flip back to the Timeline tab and keep turning the EQ PARAM knob. It should make sense relatively quickly. Your timeline cursor dictates what is playing, your EQ PARAM knob affects the knobs. The most important thing to consider right now is that, before, in the explosions example, you had NOTHING on the time line. All your play events (The explosions) took place on the Size parameter. In this example, what you are doing with one parameter is affecting the playback of an entirely different parameter. (remember: The Timeline IS a parameter!). It is absolutely crucial to your understanding of FMOD to realize what is going on here. If you have any questions about what is going on please leave them in the comments below an I will do my best to explain them in other words.
Concept: Pretty much anything can have an automation curve. Anything. Just right click and find out. An Automation curve ties a specific track or effect setting to a specific plot point of the Game Parameter. Like most other things, FMOD will interpolate values between the ones you explicitly plot out. Automation curves can affect the way things placed on different Parameters sound.
The ability to automate parameters and use them to control other tracks which are playing, is by and large one of the most amazing things about a software such as FMOD. It allows a near unlimited flexibility with designing not just sound but entire environments and gives you, the audio designer, the ability to truly put together not a scene at a point in time, but rather a space at any point in time. Parameters are even flexible enough to allow parameters to automate OTHER parameters! Just create an Event Module (or reference an existing one) and any parameters that the nested event has can be automated as well. This can go as many levels deep as your situation requires. Because it is so incredibly powerful, it’s worth spending a few moments creating a few parameters and discovering how the process works.
And by the way…! Did you know that there are a few built-in parameters? When you click the plus tab to create a new parameter, instead of simply creating a new one, try one of the five built in ones.
To understand these built in parameters, it’s necessary to understand a few concepts about how things work when they’re actually in the game. The Listener is whatever is listening for the sound. The listener is your ears. Generally, either the player character, or the camera is the listener. Some games might make use of a Listener in other ways, like for instance on a security camera, while your character is looking at a camera feed on a video screen. It depends on the scenario. An Event Emitter is whatever is playing the sound. The NPC with a quest is the emitter when he waves over to you and shouts “Hey! Hero! I have some menial tasks for you!” Your race cars roaring engine is an emitter. There might be a few listeners and emitters working in tandem as well. In the security camera example, whatever is making noise in the room being monitored is the first emitter, the camera is the first listener, the television that the camera is broadcasting to is the second emitter, and your character who is watching is the next listener.
Concept: Listener objects are your ears and the emitters are your sources.
The Listener/Emitter relationship is fundamental to the built in parameters and their usage. These parameters take advantage of some complex math functions to help you in your sound design.
Unlike other Parameters, these are calculated automatically during the game and fed into your event as needed. Because these parameters are at the core of FMOD’s 3D sound engine, these parameters are intrinsically linked to the 3D Previewer. Moving the arrow in the 3D previewer will affect the related Built-In Parameter knobs, and vice-versa. All you have to do is properly tag what an emitter is and what a listener is. These parameters are:
- Distance: Sets the value of the parameter to the distance between the Listener and an instance of the Event’s Emitter. Besides the obvious “make something sound farther away”, it is incredibly useful for adding the aural equivalent of LOD (Level of Detail) effects to your sounds. For instance, a 16th century crowded Spanish marketplace can still be audible from 50 meters away, but you probably won’t be able to pick out any specific conversations – maybe just a few of the louder vendors shouting, or a donkey braying in a stall. What you’ll really just be hearing is the din and clamor that’s ever-present in the marketplace. Use distance to fade the more specific sounds out as they get farther away.
- Direction: Represents the angle to an event emitter from the listener’s direction of facing from left to right. Ranges from -180 to 180, with 0 being directly in front, and +/-180 directly behind. Negative values are to the left, positive to the right. This is most obviously used for panning and positioning, but can often be applied very creatively in the game world. Games with puzzle elements, especially RPGs, can often benefit from sounds or music becoming more or less prominent as the player turns toward or away from correct or incorrect solutions.
- Elevation: Similar to the Direction, Elevation measures the angle of the vertical plane. No trigonometry is necessary, I promise. The range of the parameter is from -90, which is directly below you, to 90, which is directly above you. It combines with Direction and Distance to position events in 3D space! It’s important to realize, however, that Elevation can change with distance. It uses angles after all. If your character is at point (0,0) and an enemy is at point (3,5), he is at a much higher elevation than an enemy at point (5,3) even though the enemy is exactly the same distance away (5.83 units). The first enemy at (3,5) has 59.04 degrees, while the second enemy at (3,5) has an elevation of 30.96. Be aware of this when using the Elevation parameter. Okay. Maybe there was a little bit of trig involved there.
- Event Cone Angle: The Event Cone Angle is a bit nebulous in its description in the manual and in its function. It represents the angle between the direction to the Listener from the Event’s facing. It’s used to define the size of the emission cone when an Event does not use the typical spherical emission pattern. It ranges from 0 degrees to 180 degrees. Some general approximations that I’ve found useful are that human eyes have a range of vision of about 170 in the far peripherals, and that the average video game first person shooter has a field of view of anywhere from 60-90 degrees. Do not let these number deceive you into thinking that the Event Cone Angle is something applicable to all events or that it is tied to vision in any way – these are just approximations to help you decide how focused the sound should be. An event cone angle of .05 degrees will still be fully audible if the Listener is still inside the (tiny) cone. It’s just that once s/he moves out of that cone, it will no longer be audible. Think very carefully about when to use this Parameter.
- Event Orientation: The Event Orientation parameter measures the difference between the orientation of the Listener and the orientation of the sound Emitter. If both Listener and Emitter are facing the same direction, the difference is 0. If the Listener is facing forward and the Emitter faces directly to the right, then the difference is 90 degrees. By the same token, if the Listener is facing forward and the Emitter is facing backward, the orientation is 180. As with Event Cone Angle, the Event Orientation Parameter is one that is a bit more specialized. It works in incredibly close conjunction with the previous Parameters to help you create some incredibly detailed aural representations of any world you can imagine. But it’s best to dive into them after you’ve gained a concrete understanding of the basic parameters.
With a little creativity, these five parameters can do a very great amount of legwork for you, and they are extremely efficient for it.
A quick note on modulation
Before we move on, a quick side note: It’s worth knowing that you can also add three other kinds of modulation to any parameter or Game Parameter: Random, AHDSR, and Sidechain modulations, and one which applies only to sound modules, the Autopitch.
- Random allows you to specify a range of values which will be selected at random each time a given event happens to module that value of the knob by (for example, we explored pitch modulation in part one. You can randomize pitch by a given amount of semitones.).
- AHDSR stands for Attack Hold Decay Sustain Release and allows you to draw in envelopes describing the velocity of changes to your parameters. For example, a slow attack on volume can soften an impact and turn it dull, while a quick attack on a compressor gate will allow it to react faster. This usage can be extrapolated to pretty much any knob in FMOD.
- Sidechain allows the incoming value of another parameter to modulate a given parameter. The most obvious use of side chaining is compression wherein volume output of one track can duck the volume of the compressed track. To use it, you must first create a side-chain somewhere in the same event (either on the same track, or another track), and then right click on the Sidechain module and select the proper input.
- Autopitch, according to the FMOD manual, is specifically designed to support and facilitate the creation of engine sounds, but can of course be adapted to other sounds with some creativity. Autopitch creates a linear function to increase or decrease the pitch of a sound, relative to its root value.
For more information on these four modulators, check out the FMOD manual or the included FMOD example files (although, admittedly, only one of the examples uses modulation at all (AHDSR to control the way playback of the music ends in the music example).
A Final Note On Signal Flow
One thing you should probably realize when dealing with parameters is that your data flow is cumulative from one step to the next. It’s kind of like signal flow in traditional audio recording (actually, it’s exactly like that kind of signal flow). You’re never hearing anything in FMOD until it exits the Master Bus of the mixer. I’ll go into more detail about mixing in a later part of this series, but for now, understand that an Event’s Master track is not the final Master Output Bus that the player will hear. There is another step in the process! For this reason, it’s important to always be aware of what is affecting your parameters and the values of your settings at all times. Once the values enter the mixing stage, there is a possibility that you may more easily lose track of your signal path and experience undesirable issues.
To demonstrate, say that one parameter boosts your bass EQ by 6dB, and another cuts it by 12dB, neither of these are absolute. The end result will decrease the bass knob by 6dB, but it will be relative to wherever the bass knob started from. So your EQ knob started at -5dB, the result outputted will be -11dB. Again, everything is relative (the only exception to this (that I know of) is when you create automation curves directly onto the Timeline parameter. Then the knob being automated greys out and the curve becomes the absolute position of the knob. Other parameters are still able to change it but they are relative to the Timeline’s automation curve.). Luckily, in most situations, events will not be directly interacting with the parameters of other events and so the cumulative effects of automation can be seen quite clearly on the Deck in the form of the associated knob turning. But sometimes they will, and if you get to the mixing stage and a snapshot from another event changes the EQ’s bass knob to drop by another 20dB, then you may not see the change quite so obviously when in game and everything sounds like the bass was forgotten about.
Congratulations! Your journey into interactive sound design has begun!
And that’s it for Lesson 2! Part 1 covered the essential foundations of FMOD, which is. of course. learning how to lay things out and while it was slightly linear, hopefully that basis has helped you to understand the true interactive functionality of FMOD and how non-linear sound is created. By the end of this lesson you should be able to create parameters, and understand how they interact with one another and begin to see the possibilities of what they can do in a game scenario. The principles developed from automation and parameter controls will help solidify the next section of learning control methods and how musicality can be developed in a non-linear fashion, and can further your understanding of how mixing is actually accomplished in a dynamic environment. As before, you can’t break anything in FMOD so never let fear stop you from clicking something and trying to see what it does.
The next section will be a somewhat one, explaining a few control methods and how to start jumping around the timeline. As always, if you have any questions, feel free to reach out to me by leaving a comment here, emailing me at Hello@ChrisPrunotto.com or throwing me a twitter message @SoundGuyChris.
Things to try out:
- Create a single Game Parameter to alter the pitch of a Single Sound Module. Drop the pitch when the parameter is near zero, raise it when it is near 100.
- Create a single Game Parameter which affects many effect parameters on a single track (for example, a 3-EQ and a Distortion controlled by one Game Parameter)
- Create a single Game Parameter which affects many effect parameters on multiple tracks in the same event.
- Create a nested Game Parameter which is controlled by a game parameter one level above it (hint! use an event module!)
- Create a single Game Parameter which both triggers a Sound Module and has automation lanes for EQ settings (hint! You can put both modules on automations on a single track in an event!)
- Create multiple Game Parameters which affect different effect parameters on a single track.
- Create multiple Game Parameters which affect the same effect parameter in order to see how relative values can stack up.
- Add AHDSR to the volume parameter of a single sound.
- Add a short loop of an engine sound and apply autopitch to it. See how changing the Game Parameter value affects the pitch and how the Root Pitch setting determines where the “zero change” point is for that sample.
Keep on twiddling those knobs,
– Chris Prunotto