Hello, I’ve been planning to work on a rhythm game that gives feedback to the player based on how early or late the button was pressed (perfect, great, etc…) alongside the number of ms the player was away from the desired time.
For that reason, I need to retrieve an accurate timeline position each frame. At first I tried using getTimelinePosition(), I’ve also tried to get the DSPClock from the event’s channel group.
I’ve seen that the default update rate is 20ms so I tried lowering it.
The lowest interval of time I’ve gotten is 10ms, at 1ms update rate, 8 DSP buffer length, 4 DSP buffer count:
About the timeline callbacks, I tried them and they can help me track the current beat but I dont know if the callback can help to get the time distance (early or late) from the input moment to a note, which can be on beat or off beat.
I understand that I can track predetermined timestamps using markers, but my issue is that I can’t capture the exact moment (in milliseconds) when a player makes an input. Since inputs are not predetermined and can happen at any frame, I need a way to track the time each frame accurately. Right now the value updates each 3 or 4 frames like i showed previously (due to the 10 ms interval). For reference, Unity’s AudioSettings.dspTime allowed me to track the exact time each frame.