How to do something every x seconds based on audio's track position


I'm trying to make a rhythm game and right now I have an alarm that triggers every 0.43 seconds to go along with the song but that can go out of sync after a while and there are parts in the game where the music will slow down or speed up respectively and everything will go out of sync.

I was wondering if I could just make the code run every 0.43 seconds based on the track position of the audio that's playing. If someone could help me figure this out it would be greatly appreciated!


might help. you could test that each step and check where it is,
then use audio_sound_get_pitch or get_gain to check for your beats? Id almost say you need a map file to the track to align beats you need to hit to beats in the song.