I want a parameter to pause an event playing, which isn't 'linked' to the event

I think I may be overcomplicating this one.

Basically, I have an event which contains multiple tracks within it - playing music.
All these tracks are triggered by a parameter using transition loop regions.
This event is the ‘map music event’ (which plays the main music tracks of the game for each type of map). This is all fine.

However, I have a separate number of music events in the project which are not the ‘main music’. These events are for cinematic scenes in the game.
These are my ‘Cinematic events’.

These ‘Ciney events’ have no special trigger behaviour, such as parameters etc… They simply get played in the Unity Timeline. Piece of cake.

Now, the problem is, SOME of the ciney scenes in the game are part of the maps in the game - in functionality, code-wise. So can’t change that.

Therefore, when a ciney scene starts playing (whether it is at the start of a map, in the middle or at the end) the map music starts playing. (obviously, not helpful. Rather, I want my custom ciney music events to play instead, and I want my map music to stop).

Basically, I’m wondering what the best way to do this is?

We currently have a parameter setup called ‘CinematicMode’
Values:
0 - Off
1 - On.

I am hoping this parameter can be triggered inside the Map Music event; so as to pause it (with a fade in and out) and when the Ciney scene finishes, the map music can presume where it left off (smoothly, of course).

I’m still pretty fresh to FMOD, but so far, I have looked at the:

  • command instrument (looks like it can stop events? Pretty straight forward?)
  • Magnet Regions (was going to place them under my music tracks in the map event and have it transition to a sustain point?)

I haven’t been able to get these to work, but I am sure that I am probably doing something wrong.

Any help is much appreciated.
Let me know if you want screen grabs or even a video of the project.

There’s a whole bunch of different tools you could use to do this.

  • Command instruments can stop events, as you have noted. If you want to be able to start events as well as stop them, you will need to use additional command instruments set to “start event” mode.
  • Magnet regions (and more broadly, all transition regions and markers) can be used to move the playback position of an event, and so can be used to move it away from instruments whenever you don’t want them to play.
  • Sustain points don’t actually pause an event; rather, they pause the movement of the timeline playback position while the event continues playing. Synchronous instruments will fall silent when the timeline playback position stops moving, but asynchronous instruments do not as long as they remain triggered.
  • Instrument trigger conditions can cause an instrument to be untriggered when specific parameter conditions are not met, and so can be used to silence instruments when your parameters are set to specific values.
  • Sidechain modulators can adjust the volume of one track or bus when audio is playing in another track or bus, and so can be used to duck music or ambient sounds while more important sounds are playing.
  • Snapshots can be triggered by snapshot instruments, and can make arbitrary adjustments to your game’s mix.

Any of these tools could potentially do what you want. The question of which to use comes down to your personal preference and your project’s unique requirements.

If you want one event instance to set a parameter’s value and for that change to affect event instance, it will need to be a global parameter. If you’re able to alter the parameter’s value from code instead of from within another event, a local parameter will do.

1 Like

Hi, thanks for this.

These are great.

However, upon reflection, I think they don’t exactly do what I need.

Specifically, I’m wanting to pause the timeline of event ‘map music’ (the pause would be triggered by ‘ciney music’).

Then, upon the ‘ciney music’ finishing, I want the ‘map music’ to be retriggered and unpaused from it’s exact current position of where it was paused.

In that case, there is no way to do what you want within FMOD Studio, as there is no way for an event to issue pause and unpause commands.

You will have to use your game’s code to pause and unpause the relevant event instances.

cool, no worries.

in the API calls, does [Studio::EventInstance::setPaused] pause the event in a way that ADSMR would come into play?

Effectively, if it got pause by this callback, the event would pause with a fade?
Or is it sudden?

No. It’s sudden. This is to support instantly falling silent on pause even when gradual fading is also an option, which is a requirement in some games.

If you want an event to fade out, you will have to build that behavior into the event, and trigger it by some means prior to pausing the event. Similarly, if you want an event to fade back in when unpaused, you will have to build that behaviour into the event, and untrigger it when the event is unpaused.

The easiest way to do this would probably be to automate the volume of a gain effect on a parameter with seek speed, and set the value of that parameter shortly before pausing and immediately after unpausing.