So I’m trying to make a rhythm game, and everything has been working fine using a quartz clock but when I set the start time to anything besides zero the song no longer matches the quantization.
I’m testing it by scheduling a clicking sound to play quantized to every beat. When I start at zero the click is perfectly on beat with the song for the entire duration.
I’ve tried to make the start time match beat increments but that doesn’t make a major difference, it seems at least slightly more consistent but certain start times are still way more out of sync than others even when they match an interval of a beat exactly.
Another thing to mention, it’s consistently out of sync (or in sync) at specfic start times, I just can’t for the life of me figure out why other than that there’s some time offset I need to calculate for that I’m just not seeing.
The time stamps in which the beat event goes off is consistent regardless of how I change the start time, so I believe the problem is solely with the audio itself. The quantization is correct relative to the clock, but I can’t get the audio to start on beat with a different start time, which I need to do for testing.
Update:
I changed my audio file from “Bink” to “PCM” and now it starts in sync but only after I run the game once, so for example, I set my start time to some number (still an increment to a beat), start the game, it’s out of sync, stop the game, run it again not changing anything, then it’s perfectly in sync every time I test it until I change the start time again.
This is definitely an improvement.