A Tutorial Look at the Unity-FMOD Example Code
A Look at the FMOD Example Code: Lately, I’ve been working through drafts of how to best write code modifying parameters in FMOD through Unity C# code, but, honestly, I’m way out of practice and I still don’t have the best answer yet. To re-familiarize myself, I wrote this up for some of the folks who have been emailing me about how to work with Parameters in code. I suspect that many of those questions have to do with not completely understanding some of the best coding practices with FMOD so I wrote this up using the included FMOD Tutorial file. It is a heavily commented, re-organized and restructured version of the FMOD StudioEventEmitter.cs document which is imported into your project as part of the Unity-FMOD Integration package found on the FMOD website. Please forgive any formatting errors – I tried to pretty-ify this as much as possible to ease in readability, but I’m painfully aware that other desktop monitors might display this differently. In any case, without further ado here is the FMOD Example Code, re-structured and described in detail:
Miller Puckette’s “The Theory and Technique of Electronic Music”, Ch. 1 Exercises
“The Theory and Technique of Electronic Music” – Miller Puckette, Chapter 1 Hey folks! I recently came across the phenomenal book, available for free online, “The Theory and Technique of Electronic Music” by Miller Puckette, renowned designer of Pure Data the open-source cousin Cycling ’74’s famous Max/MSP environment. It’s a fascinating subject and I highly recommend checking it out here! I wont lie, a lot of this book has the tendency to go straight over my head in a lot of places if I don’t read and reread sections of it, so I’m doing the exercises here, publicly, so that I can hopefully make sense of what Mr. Puckette is saying and to maybe elicit feedback and correct the places where I’m not understanding some of the mathematics and relationships being presented, since there’s no answer key given. I’ll attempt to work through the answers in as long a form as possible to break it down to the simplest level and explain/show all of my work along the way. Though the book appears to be geared more toward using the concepts in the context of PD or Max, I’m more interested in more wholly understanding digital audio, so just for the heads up: somewhere down the line, I may skip a PD-centric question or two 🙂
An Introduction To FMOD, part 5: Integration Into Unity
Lesson 5: Integration Into Unity Alright! Now it’s REALLY been a while since last time! I think it’s finally time to start wrapping up these lessons by answering the one question that everyone has: “Alright Chris, I’m now a master of FMOD thanks to you, but now I need to shove this thing into Unity and make them work so that I can be the master of Interactive Audio!” Well first, that’s not a question, but point taken – to the folks who have e-mailed me, prodding me into finishing up, I can only offer my sincerest apologies because life has gotten way busy this past year. Thanks for the outreach. 🙂 We’re gonna do this. Right here, right now. If you’ve followed along with the set of tutorials so far, you should be able to efficiently bring your ideas into FMOD using the tools available to you. If you need a refresher, you can check out the overview of all the lessons at this link here or hop back to the very first one here. Unlike the last four lessons, this lesson will not build on previous concepts directly since this lesson will focus on integration concepts in tying FMOD into Unity. However, it is still crucial to know the inner workings of FMOD before you try tackling integration, so review if you need to. The instructions are the easy part – it’s knowing the concepts that will take you far. Let’s get started. And as always – if you have any questions, require further explanations, or wish to suggest further topics, email me at Hello@ChrisPrunotto.com or reach out to me on twitter @SoundGuyChris!
An Introduction to FMOD, part 4: The Mixer
Lesson 4: FMOD Mixing Hello again, and welcome to the fourth installment of my lessons on using FMOD! This lesson will focus on mixing in the FMOD Studio environment. As always, you can jump on back to lesson one by clicking here, or see the entire list of lessons over here. Up until now, we’ve been focused on getting things to play in the editor, and to get the events that contain those things to play the way we want them to. We’ve covered the interface, parameters, and logic function. The next step, naturally, is getting all those fancy sounds to play nice with one another. Just like in any other music situation, you can’t just turn all the dials up to eleven and call it a day (caveat: unless you’re Motörhead and “everything is louder than everything else”). It just doesn’t work like that. You need to have control. Now, before we begin, I want to mention that mixing is very, very much an art in of itself. It takes years to master when sitting behind a traditional mixing desk, and I make no claim to have mastered the art myself. But even more so than the wizard-like job of engineering in a traditional studio, the work of mixing interactively is even more nebulous. There’s a LOT of ground to cover – much more than is in the scope of an overview lesson attempting to teach the fundamentals and paradigms underlying a single computer program. As a result, this lesson might feel a bit more disjointed, and might be less intuitive, when compared to some of the others I’ve written thus far . The reason for that is because the primary purpose is not to teach you the basics of mixing, but rather how to do it in FMOD. So, like in our introductory lesson, this will very much focus on the core ideas of facilitating a great mix, and the tools used to create those great mixes. With that said, please do not hesitate to send any questions my way regarding FMOD! Feel free to leave a comment here, email me at Hello@ChrisPrunotto.com, or shoot me a message on twitter @SoundGuyChris! So, with that said, grab some coffee and read on to continue.
An Introduction to FMOD, part 3: The Logic Track
Lesson 3: FMOD Control How To Think Like A Time Lord, And Other Useful Tips For Everyday Sound Design Welcome to my third lesson on the Audio Middleware Engine known as FMOD. If you’re new here, jump on back to week 1 by clicking here to get the basics down. This week will deal with how to further control FMOD events using the Logic tracks. It bears repeating the analogies I’ve been making (that are hopefully apt!): Everything in FMOD is an Event that details something. Parameters are sort of like adjectives. I don’t have any parts of speech up my sleeve to describe the Logic track, but if Parameter’s provides a description about an event, then the Logic control describes when it happens in time, and how often. Remember how the Timeline in FMOD is just another Parameter, as we covered in the second lesson? Did knowing that bother you a little bit last week? As a Parameter, shouldn’t we have some sort of control over it, like the rest of the Game Parameters we can create? Last week’s lesson dealt primarily with controlling events which spanned just one single scenario. For instance, explosions were the primary example, and while we were able to create a nearly infinite amount of variations of that explosion, they’re only good for whenever you have…well…an explosion happening. While useful, our game will also have events (such as music) that need to work to move fluidly back and forth between different states and levels of action. This is most tidily accomplished by skipping around the Timeline of your events, sort of like skipping back and forth between tracks on an album to suit your mood. The good news is that FMOD does allow you to control the Timeline Parameter. The bad news is that just letting you run wild by stopping, rewinding, and skipping around in time at will would create paradoxes and could literally ruin the space time continuum and tear the fabric of space and time itself…it’s just a LOT of responsibility, for even someone so well disposed as a sound designer. But you DO get some tools. And this week, I’m going to focus on explaining the concepts behind how you can utilize the timeline itself to offer some more advanced and complex control of how the game deals with events that span that can span many different kinds of scenarios (like, say, footsteps, which can happen on dirt, gravel, wood flooring, carpet, etc.) or single, constant events that need to react fluidly depending upon a scenario (for example, music tracks which react to the parameters of the game.) So, read on to continue, and as always – if you have any questions, require further explanations, or wish to suggest further topics, email me at Hello@ChrisPrunotto.com or reach out to me on twitter @SoundGuyChris!
An Introduction to FMOD, part 2: The Parameter
If Everything is an Event in FMOD, then parameters are how you describe everything. Parameters are adjectives that describe the scenarios that take place in your game world.
An Introduction to FMOD, part 1: The Interface
Lesson 1: Welcome to FMOD Hello! It’s been a while! A long time ago, I may or may not have promised a tutorial on FMOD, and in either case it’s been on my to-do list, so I’m gonna begin the process in striking it off here, right now. Welcome to the first post in my series on the use of FMOD. I was inspired to write this tutorial after meeting some of the FMOD/Firelight Technologies crew in March 2014 at the Game Developers Conference in San Francisco. You may have noticed, if you’ve come across my blog before, that all of my previous writings on game audio engine tutorials were written about Wwise. So why am I climbing aboard the S.S. FMOD now? Well, I’m not really doing that. I’m actually trying to just ride both horses. Why start now? Approximately five years ago, I rather disliked FMOD. The program felt kind of nebulous, it’s usage (which either I misunderstood, or it did not explain) went over my head, and the documentation for the software was notoriously under-developed and sparse. In short, the choice to use Wwise was made for me when I simply could not access the program, and so Wwise was what I stuck with. Fast forward to 2014, the FMOD Designer is now replaced with FMOD Studio and, even more excitingly, it is now absolutely free for indie designers to use in their games. Because of the flexibility that FMOD offers, there can be no excuses anymore. Any and all interactive audio designers should be expected to know FMOD, and Wwise, inside and out. These programs are no longer just for the big boys, and are no longer out of your budget or your reach. I would dare be the person to make the bold claim that you should never again be working on a game that is not using some sort of audio middleware ever again. What gives me the authority to make such a claim? Because, as the FMOD manual so succinctly describes it: The sound file is not the sound that the game needs. A game designer, and certainly a game audio designer, does not live in the linear world. You only have so much space on your CD/DVD/hard disk for menial footstep samples. We can do so much more, with so much less. Especially in the indie games world, the lines between the sound creator and implementer are blurred and you will make your job so much more rewarding, while also increasing your value as an audio designer when you know and understand how to not only create the sounds your game needs, but how to implement them – something FMOD allows you to do quite easily. It is no longer acceptable to simply be satisfied with delivering folders full of .wav files to programmers and expecting them to put them in the game for you. You are much more than that. Before we get down to business here, I want to stress […]
How to Integrate Wwise into Unity
Hey there folks. I’ve decided it would probably be a great idea to start doing more hands-on stuff with both Wwise and Unity. So, I’m going to start by showing you how to integrate the incredibly powerful Wwise middleware engine into Unity. I first got my hands on Wwise three years ago, and boy, was that program a nightmare at first. I didn’t understand how you could use sliders and graphs made of arbitrary parameters to “code” sound and then make them somehow fit into a game. I mean, the concept was there, but trying to practice Wwise in the capacity of designing sound – before I even knew how to use Unity, let alone integrate the two tools together, no less – was an incredibly huge challenge that took much longer than it rightfully should have. Keep in mind, back then, the Unity Integration Tool wasn’t immediately accessible the way it is today; you had to actually ask for it from AudioKinetic, and the documentation was not as good as it is now, either. As of the past few versions of Wwise, that particular barrier of entry has effectively been eliminated. It’s now easier than ever to implement high-quality, nuanced audio into your games using Wwise and only a handful of necessary commands. So today, we’re going to set aside using both programs, and focus on making them talk to one another. We’ll come back to doing stuff with them another day.
The McCarthy Show #5: Discovering Alignments, and Concluding My Own.
This is it! Week five. The final installment of my series on The McCarthy Protocols. I hope, if you’ve followed along, that these protocols have gotten clearer and clearer as they’ve been explained. There’s only two short protocols left. The Investigate protocol, and the Personal Alignment, arguably two of the most important protocols in the Core, and the latter of which is, in my own opinion, the cornerstone of what the Core is all about (hence, I saved it for last!) You may have noticed these introductions have been getting shorter and shorter, and that’s simply, I feel, because the pieces are falling into place. It’s less explanation and more internalization – that’s kind of how this process works. It always feels really goofy and silly in the beginning, but as it comes together, it really cements the dynamic of a team together. As always, you can return to the very first introduction post here and read from the beginning if something doesn’t make sense, or click here to go to official online Core Document. Additionally, leaving comments and feedback is a welcome way to Ask For Help on using the Core, or simply talk more about it in general. – I really enjoy working with them, and have done my best to implement them with the various teams I’ve worked on since graduating college even a few short months ago. Anyway. Let’s get started. Read on!
The McCarthy Show #4: Team Decisions
Week four! This series has now been running for a month! Is it weird to say I’m a little bit proud of myself at the moment? I know I don’t have a ton of readers yet, but even still, it feels good knowing that I can take something I learned and know it enough to the point where I can explain and demonstrate it to someone else. And after all, that is the purpose of keeping this blog: Showing to myself and to anyone watching that I know my stuff, through and through. As always, you can return to the introductory post to get an overview of all of the protocols, and read forward from there. Or you can go to the Official Core online page and get an overview (and more) over there. If you’ve been following along (Thank you!), then read on. This week I’m going to cover three more protocols. They are, in my opinion, some of the most practical ones in the Core set of protocols, and are important to keep things moving fluidly in a given team. More decisions being made earlier helps turnover, and turnover means more gets done. These protocols relate to decision making. Read onward!