Convert the global offset from seconds to beats before using it in TimingData calculations #302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've listed @phantom10111 as a co-author on this commit for their work on PR #300. Thank you!
The theory here is that converting the global offset to beats, instead of mixing beats and seconds, should keep the sync tighter when rate modding a song.
I'd like this to be tested by someone who has a better sense of timing accuracy than I do, but I think it's a better solution than going back to the old code (which seems to only work at the song level) or keeping the current code (Which seems to only work at the engine level).
The if-else statements inside
TimingData::GetElapsedTimeFromBeat(float fBeat)
andTimingData::GetBeatAndBPSFromElapsedTime(GetBeatArgs& args)
only execute the new code ifm_fMusicRate
is anything other than 1. They are necessary because stuff will break theme side if it's not done like this. Without the if-else statements, this will happen.