I started a project to recreate piano tiles but I've been having a hard time with the timing and sync.
Using "Every X seconds" doesn't sync correctly and eventually the music (audio file) starts to lose the synchronization.
As a first solution, I've started using the "Wallclocktime" and compare it within itself.
This is what I have for sync so far:
ClockTimeRec = 0 - Number variable used to temporarily store wallclocktime
TickBPM = 0.5 - Number variable for beats (currently 0.5 for 120bpm whic is 60(secs)/120(beats))
On start of layout - Set ClockTimeRec to wallclocktime
Then I compared it back with wallclocktime:
[ClockTimeRec <= (wallclocktime - TickBPM)] - Trigger my event and set ClockTimeRec to wallclocktime
After this it will wait the amount of time on TickBPM and trigger again
This solution is working so much better but I feel like there can be a mayor improvement to this method, I'll appreciate any help to improve this and anything else in general that might help me with this rythm game.