I’m not able to test this yet, as I’m not at my workstation, so at the risk of looking silly… has anyone tried using Timeline objects?
Set up a timeline object to run for 2 seconds, and loop, and add an event track that fires off an execution pulse once every 0.5 seconds. That should be giving you quarter notes at 120BPM, no…?
That at least decouples you from the tick pulse, so it’s no longer framerate-dependent, and using a timeline node over a simple delay should give you more stability in terms of slowdowns accumulating.
I’d think the biggest problem with audio sync wouldn’t even be the timing itself, it would be queueing; in audio software programming, when handling real-time audio, there’s always some sort of buffer (on a good card usually like 2-4ms, on others it’s substantially higher) because audio buffers fill up inconsistently owing to the other processes running at the same time. Even if you could “fire off” execution pulses at the right time, Unreal still has to queue all those audio playback commands and execute them, which won’t always have correct timing. An audio sequencing system is usually looking ahead to the events that come in the future and prepping them, loading audio into memory, decoding, etc., and then playing the audio at the predetermined appropriate time. I would suspect that most dynamic music systems in games would tend to start all audio playing back in simultaneous loops and blending between them, as mentioned ITT, rather than trying to build it in real-time; if you need the game to do something in response to player input, you can’t look ahead to it. Even with a good audio card and using a dedicated spec like ASIO, it’s a challenge getting a machine to reliably fire off musical events in response to real-time user inputs. Trying to do so while ALSO doing everything else that the game needs to do in real-time seems like it would be nightmare-tier, especially considering most gaming rigs are not built with audio performance in mind. If all the audio is already synchronized, then all that needs doing is some very quick multiplication for volume control, rather than all the other tasks associated with playing back an audio file.