Newbie Trying to Do Something Complicated

Hi!

I’m very new to FMOD, but am both a musician and a programmer so I’m understanding some of the concepts behind it pretty quickly, since it’s basically an intersection between a DAW and programming logic. :slight_smile:

For our next game, I’m trying to do something new with adaptive music, and am trying to figure out if FMOD is the proper tool for the job.

Here is the setup:

  • The FMOD project will be integrated with a Unity project.
  • We’re making a board game. Between 1 and 4 players can play the game, since it is cooperative.
  • At the start of each new game, each player selects 1 of the 8 available characters. That means that each game session will only have 1-4 of the 8 available characters.
  • The music has a bed track, which always plays.
  • On top of that, there are 1-4 harmony tracks playing. The harmony tracks that are used are based on the characters in the game. For example, if Adam and Bob are in the game, it will play Adam Harmony AND Bob Harmony at the same time. It will NEVER play Charlie Harmony or Daniel Harmony within the whole game, since those characters are not in the game.
  • On top of that, there is a single melody track playing at any one time, and this too is based on the characters in the game. For example, if Adam and Bob are in the game, it will play EITHER Adam Melody OR Bob Melody, but not both at the same time. At certain intervals (example every 8 bars), it can either continue playing Adam Melody OR it could switch to Bob Melody (based on some parameters). It will NEVER play Charlie Melody or Daniel Melody, since those characters are not in the game.
  • Additionally, the melody that is playing dictations which section the music will transition to next. For example, if Adam Melody is playing in Section 1, it will transition from Section 1 to Section 2. If Bob Melody is playing in Section 1, it will transition from Section 1 to Section 3.

My questions are:
A) Is the above POSSIBLE with FMOD?
B) If so, is it simple enough to do with built-in FMOD features, or would it require a lot of work-arounds and convoluted hacks?
C) How much can be done in FMOD itself, versus having Unity taking some of the logical load?
D) How would you suggest I go about this project?

I have made my own attempt at the above as an example. I had no problem with the bed track and the harmony layers being based on who is in the game. I have a single parameter for each character, which is a Labeled Parameter with 2 values: False and True. If False, they are not in the game, and the harmony layer has no volume. If True, they are in the game, and the harmony layer has full volume.

However, I get stuck when it comes to playing either Adam Melody OR Bob Melody BUT NOT Charlie Melody or Daniel Melody. It seems to me that a multisound is the preferred way of choosing between a set of sounds, but I want it so that only a subset of those multisounds can be chosen based on which characters are in the game, and I don’t know how to do that.

Thank you very much!!

Yes.

It’s possible using only basic FMOD Studio features. The resulting event will be fairly complex because the behavior you describe is fairly complex, but you won’t need any convoluted workarounds or hacks.

You’ll need your game to tell FMOD which characters are in the game. Beyond that, all the behavior you describe can be built inside FMOD Studio.

This sounds like a job for transition markers and trigger conditions.

Transition markers are things you can put on the timeline of an event. Each transition marker targets a specific destination marker, and causes the timeline playback position to jump to that destination marker.

Trigger conditions are rules that define when an instrument or transition marker can be triggered. For example, if you give a transition marker a parameter trigger condition, it will only trigger when the associated parameter has a specific value.

By combining these two features, you can create highly complex behavior. For example, you can “stack” multiple transition markers with different trigger conditions at the same timeline position, and whichever is highest and has all its trigger conditions met will be the one that affects the timeline playback position.

I should mention that, because this is a relatively complex event involving multiple long audio files playing simultaneously, you should set your assets to not stream, as most platforms do not support more than a small number of simultaneous streams.

For information about logic markers and trigger conditions, see the Timeline Logic section of the Authoring Events chapter of the FMOD Studio User Guide.

Some simple examples of trigger conditions can be found in the “Music/Level 01” event in the examples.fspro project included with FMOD Studio. That event also includes some quantized transition regions that function in a manner similar to transition markers.

Hello Joseph,

Thank you for your detailed reply! I’m very sorry I did not respond sooner; got caught up in other things and forgot about this thread. What you wrote is helpful, however project requirements have changed a bit since I wrote this, so I’ll post another thread with something specific I’m trying to do and we’ll see if it’s possible! :slight_smile: