I’m currently working on a number of UE5 features that “react” to different parts of the game’s soundtrack (for example, every downbeat, I want a sphere to pulse).
My first thought was to set markers in the FMOD event, which, when reached, would trigger a function in a blueprint. However, I can’t seem to find any way to do this. It seems that for the most part, a blueprint can influence a FMOD event, but not vice versa.
I’m curious if there is a way to achieve this, or if there’s a better way of calling functions based on musical cues.
Yes, an FMOD Event can trigger blueprint functions. An FMODAudio Component exposes a number of event callbacks as Blueprint Events, such as
If you have an existing FMODAudioComponent, you can enable “Enable Timeline Callbacks” in the Details section of the Blueprint Editor for the component, and then use one of the component’s events. In this case, I’ve enabled “Auto Activate” on the component so that it plays automatically, and used the 'On Timeline Marker" event to print the names of each marker reached:
If you’re creating an FMODAudio Component dynamically, you’ll need to do a little more work to set it up. In this case, I’ve added an FMODAudio Component at runtime, assigned it to a variable, enabled timeline callbacks, and bound an Event to the Timeline Beat event to print out the beat and bar reached:
If you have any further questions, feel free to let me know.
Just following up on this - was my previous answer sufficient to address what you needed with triggering functions based on timeline markers? If not, can you elaborate on what else you need, or whether anything is unclear?
This is wonderful!! I don’t have any other questions at the moment ^^