Synchronisation between 2 musical events

Hello,
I try to do something in FMOD for a game i work on, maybe someone could help me :
I have a music event and a jingle event, both are on the same tempo. Is there a way to synchronize them together in fmod (when i win/lose the jingle start like it’s the same music, no lag, no gap, and then i go back to music perfectly synchronised) ? I could to that if i have the music and the jingle in the same event but i have about 10 musics and a lot of jingles (and the jingles events are often build with many small musics, effects, loop etc) …
Is there a way to do this in FMOD ? Or do i need to manage this outside FMOD, and ask to developer to find a solution (the developers works on their own game engine using a small part of DearImgui).
Thank you !
SH

You should be able to do this using event instruments or just a single instrument if your jingle is a single rendered audio file. Try one of these three setups:

  • Place the jingle in an instrument that spans the music event in its own track. Set the instrument to be asynchronous, and set the trigger behaviour to trigger the instrument on a certain beat when the parameter conditions are met. An example is below:


    This method also requires you to mute the music track and you cannot return to where you left off (the timeline will continue going as per usual).

  • Use quantized transition regions to transition to a “jingle” destination marker to play the jingle, then a transition marker at the end of the jingle to transition back to the main music. If you need to return to where you left off, this requires a bit more of a setup, so let me know if you wish to go this route.

  • If needs be, you could also use game code to pause the music event and play a jingle event. To quantize this, you can use callbacks to get when the music event lands on a beat before pausing. Using this method lets you start the music again from where you left off.

1 Like

Riachard, are there any plans to add ADHSR functionality to event Pause?

Hello Richard,
Thanks you for answering. :slight_smile:
I’ve just tried the first setup, and it seems to work pretty well. I tried with instrument event for my jingle and nested event for the music with async setting (to loop under the jingle) and it works (i think), i have to test in game.


For the second solution, i’ve already try something like this, but after i play the jingle it always return to the beginning of music… so i yes if you can explain me the setup it would be nice !
And for the third, i will talk with the programmer , probably it should be the more safe.

The second solution requires you to use game code and callbacks to get which position you are at in the event’s timeline. You can then store this information in a “last position” variable when the parameter conditions for transitioning are met, before using event::setTimelinePosition(lastPosition) to jump back to this position once the jingle has been played.

For an example of using callbacks, take a look at the music_callbacks example in the Core API examples.

Thank you very much, i’ll tell the programer about this solution !

I will try to feedback here which solution we choose, and how it works in game.

I hope too this thing!!

Sorry I missed this message @FoxyMusic @Adrian66

Due to the way that pausing an event works, there currently aren’t any plans to implement ADHSR functionality to the pause event.