What's the best way to sync certain events/functions with your soundtrack?

All I want is to have waves of enemies spawn synchronized with the music playing. I have an idea of how to do it, but I wanted to see if you all had any better ideas on how to trigger events/functions at specific times during the song.

I have heard many people say that you should avoid using delay nodes and timelines, and that when you need to have specific events timed relative to one another you should use Set Timer By Event node.

In the full version of my ‘Survival Mode’ song, I want probably 50 different triggers for enemy spawns. I was thinking that I would put down all the timestamps for triggers into an array and somehow use a Set Timer By Event node to go through the array. My main song is broken up into about five segments which should really help if part of the song needs changed, then I will only have to adjust the timestamps in that one segment of the song. Still gonna be a pain though.

Ideally I would be able to put ‘notifies’ in the audio clip in Unreal, something similar to AnimNotifies, but I looked into that a while ago and it wasn’t a thing. Does anybody have any better ideas how to do this?

Set Timer by Event is probably the best approach.

I’d use a data table to store the times and any other data you feel is pertinent. Keep row names as integers.

Create a “Wave” integer var. When you spawn a wave increment the Wave int. Use that int as Row Name for look up. Get Row From Data Table

So, Spawn Wave → Set Timer → Increment Wave → Int to Name → Get Row → Set next Wave Time.

1 Like

Thats pretty good. I hadn’t even heard of data tables, but based off two minutes of research, they look like they would be really helpful in this situation.
Thanks.

Edit: Two small questions.

  1. Is there any way for me to just use the built in index numbers So I don’t have to manually name every single one myself when they are already numbered?
  2. Also, do you know why I don’t have the easy to use text box to edit Row Names? In the youtubes about halfway down the screen near the “Row Editor” tab there is a text box where people can just name one row, hit tab, and name the next row. I have to manually click on every single row name, which wouldn’t be that bad but I’ve been having some double clicking mouse issues lately so I have to click between 1 and 6 times to edit each name and it’s just a nuisance.

Also, I am aware of what you said in your message about the index numbers being the Row Names, so I didn’t need to make that it’s own column.

Naming rows is a pain I know. I use F2 key vs dbl clicking.

You could just create a CSV file and import it.

1 Like

here’s a way to do something similar to anim notifies
Unreal Tutorial - Timing Events To Music - YouTube

if your whole game is based around this, I think the most feasible thing would be to mathematically design your music so that a simple pattern could be relied on for events

1 Like

Pardon my language, but holy friggin moley! At first glance this seems to be EXACTLY what I was looking for. I posted a question about how to bind events to songs about a year ago, and the general answer was that I couldn’t do it. All I needed was a Level Sequence.

The only issue with your idea of designing the music with a pattern, is that I am extremely musically challenged. It is a really good idea, but is semi out of my hands because all of my music was made by Ai from Udio (highly recommended BTW).

Thanks!

1 Like

I feel you, I have wanted to do something like that for awhile but I won’t be able to until I can afford to hire a musician. thanks for the recommendation

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.