-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix for LFO Controller desync on changing play position with the mouse. #8081
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
base: master
Are you sure you want to change the base?
Conversation
Fixes LMMS#7528 LFO Controller phase is now updated properly on moving the playhead with the mouse. Unsure whether this fix has far reaching consequences.
Song.h: -Formatting: --Remove spaces (Leftover from copy-paste) TimeLineWidget.cpp: -Formatting: --Remove unnecessary parentheses for inversion (Leftover from copy-paste) --Unpack else --Remove spaces (Leftover from copy-paste) --Remove unused code Thanks to szeli1 for pointing it out.
165f284 to
8e57977
Compare
All instances of setToTime replaced by setPlayPos. Seemingly unused delta time in setPlayPos changed to absolute position. Associated unused code removed. Side effect: Loop-jumping in the editor now also calculates LFO Controller phases correctly. Export is unaffected as of yet. (Intended design for smoother song flow vs. reproducability of song in editor?)
|
As mentioned in that commit, exporting with loops is a case that handle differently. |
| m_elapsedTicks += ticksFromPlayMode - ticks; | ||
| m_elapsedMilliSeconds[static_cast<std::size_t>(playMode)] += TimePos::ticksToMilliseconds( ticks - ticksFromPlayMode, getTempo() ); | ||
| m_elapsedTicks = ticks; | ||
| m_elapsedMilliSeconds[static_cast<std::size_t>(playMode)] = TimePos::ticksToMilliseconds( ticks , getTempo() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not seeing a change in behaviour here.
It has been handled arguably incorrectly before:
-Run song from the beginning: Get total time correctly.
-Run song from after tempo change: Time is calculated on that point as if the current tempo was always the tempo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I am now seeing is a regression in that the timer on top no longer updates when you move the playhead with the mouse when it's not playing, so I will be fixing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out I was looking in the wrong place regarding the previous comment.
We have to explicitly specify both of these cases, otherwise the timer does not get updated.
Fixes #7528
LFO Controller phase is now updated properly on moving the playhead with the mouse.
Unsure whether this fix has far reaching consequences.