Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct point ordering #153

Merged
merged 3 commits into from
Jan 27, 2022
Merged

Ensure correct point ordering #153

merged 3 commits into from
Jan 27, 2022

Conversation

firthm01
Copy link
Contributor

@firthm01 firthm01 commented Jan 21, 2022

Because effective time is adding of 2 floats which can introduce precision error, it can be that the effective time of the previous block if AFTER the start time of the block you're processing. This fix shifts start times according to the previous effective time to retain correct ordering. We're really only interested in effective time when placing points anyway - although those would be subject to precision error too!
This is the easiest fix. The best fix would be to use the adm::Time class throughout the entire code base, but that's huge work!
This fix uses chrono::nanoseconds in AutomationPoint class to avoid precision error when calculating effective time. Also includes a fixEffectiveTimeOverlaps function when processing the vector of AutomationPoints, which forces the effective time of a point to occur at or before the start time of the successive point (i.e, successive AudioBlockFormats rtime)

Because effective time is adding of 2 floats which can introduce precision error, it can be that the effective time of the previous block if AFTER the start time of the block you're processing. this shifts start times according to the previous effective time to retain correct ordering. We're really only interested in effective time when placing points anyway.
@firthm01 firthm01 changed the title Ensure correct point ordering by accounting for FP error Ensure correct point ordering Jan 25, 2022
@rsjbailey rsjbailey merged commit c2b11d9 into main Jan 27, 2022
@rsjbailey rsjbailey deleted the discontinuity-ordering-fix branch January 27, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants