Time Lagging in Quartz

Sure thing! Yes, I would also advise against using a system clock as a sync source. My point was just if one were to insist on doing that, there is no benefit to doing it on a separate thread.

does Quartz replace the need for generating a beat event stream by automatically integrating with the audio subsystem and maintaining a beat (while taking both subsystem time-chunking and latency into account)? Failing that, does UE5 offer a way of accessing the necessary audio playback timing info to do it in the usual way?

Yes. There are 2 major components to Quartz: 1.) sample accurate onsets of sounds, and 2.) Communicating back to the game thread any timing information it needs (driven by the audio engine).

After you set the BPM on a clock and start it, there are notifications you can opt into through the Clock Handle (independent of playing any sounds).

These are called “Metronome Events,” and will call a Blueprint delegate every time one of these events transpires. These events can be used for your own musical time-keeping. The idea being that if you start your Audio clip on the beat w/ Quartz & “PlayQuantized,” then these events will allow you to track and respond to the musical duration you care about.

These events include a Transport Timestamp in the format {Bars : Beat : Beat Fraction } - represents the precise musical time as of the last audio engine buffer render.

Quartz is actively being worked on and improved (we have big plans for it), but it is tightly integrated with the audio renderer, so if there is something else that would be helpful to expose for rhythm games, it shouldn’t be hard to do so.

2 Likes