-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix beatsync_phase depending on quantize #1679
Conversation
This should also go to 2.1.1. |
I really like to have this included in 2.1.1 who can have a look? |
This seems okay from brief testing, but I am wary to introduce such a big UX change in a point release. Are you sure this won't be unwanted in some use cases? |
Thank you for review. |
This changes the behavior of |
No tests? |
MM, that's odd, reading this code mixxx/src/engine/sync/enginesync.cpp Line 169 in d8fe4dd
It was original implemented that sync_enable also syncs phase. But I think that was wrong and we have evidentially fixed the "issue"? How continue here?
I propose to keep the "buggy" behavior of sync_enable, but keep all other changes of this branch targeting it to 2.1. Any other ideas? |
agree, the sync code is very brittle and has benefited tremendously from the exhaustive unit tests to keep it from regressing. It sounds like there should at least be a test that confirms that phase is not synced when sync is pressed. |
I believe on other programs, pushing sync would sync both bpm and phase, especially when both decks were playing. I replicated that behavior when writing this code. It's worth checking to see what happens when the decks are not synced, and are both playing, and then you click sync. |
The linked text was introduced here: #133 From the comments in #133 it looks like coupling the phase sync with quantize is desired. For me this makes fully sense that this is coupled to quantize. This way the user can enable quantize when there is a good beatgrid and can disable it otherwise. If you enable quantize during sync enabled, the track moves slowly in phase. This matches the initial behaviour as well. So IMHO the only thing to fix (change) here, is "beatsync" and "beatsync_phase" Do you agree? And yes, that should be verified by a test. |
OK, now the sync_enabled behaviour is unchanged, beatsync_phase works independently from quantize and a test for both is in place. Is this OK now? |
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.
my only real question is about the use of EXPECT_LT in the tests, otherwise this looks fine. thanks!
src/test/enginesynctest.cpp
Outdated
@@ -1429,3 +1429,52 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) { | |||
EXPECT_EQ(0.0, | |||
ControlObject::getControl(ConfigKey(m_sGroup1, "local_bpm"))->get()); | |||
} | |||
|
|||
TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) { |
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.
how about "QuantizeImpliesSyncPhase" (in your wording, it should be "too")
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.
ping
src/test/enginesynctest.cpp
Outdated
pButtonSyncEnabled1->set(1.0); | ||
ProcessBuffer(); | ||
// 0.02 where set after testing both cases. | ||
EXPECT_LT(0.02, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); |
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.
expect less-than? Should this be expect_float_eq or similar instead?
res/skins/Shade/style.qss
Outdated
selection-color: #0f0f0f; | ||
background-color: #0f0f0f; | ||
selection-background-color: #888; | ||
/* This combination of negative top/bottom padding & margin |
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 think your branch is behind a bit, causing these library CSS diffs
This would still change the behavior of the SyncButton in Components. |
Should bratsync also respect quatize? If we do so, we have the same as sync_enable. So it would be redundant. I see a demand for an bratsync button, that works like in other Apps and unconditionally syncs tempo and phase. I do not understand why we need a hack in Components at all. You should be able to just map sync_enable, to get the desired behaviour. |
My recollection is that "beatsync" was kept around for backwards-compatibility purposes. A short-press of sync_enable is indeed identical. |
Not when set through a controller script. |
@Be-ing can you explain why we need a hack in Components? Why can't you use plain sync_enable, to get the desired behaviour? Do I understand it right, you wish that we keep bratsync quantize dependent? |
The push-and-hold behavior for sync_enabled was implemented as a hack that only affects XML mappings and skins, not controller scripts. |
IMO this should not be changed because there should be a way to immediately activate master sync without having to push and hold a button. |
what's wrong with push and hold? |
It's easy to forget to hold, which can easily mess up a mix. |
has this happened or are you speculating? on my controller sync is a lighted button, so when I push and hold it it stays lit. It's easy to tell when master sync is on or off based on the lighted state of the button, so there's nothing to forget. |
Yes that happened to me when I had my controller mapped with push-and-hold, so I didn't keep it mapped that way very long and switched back to a simple toggle button. Seeing the master sync state on the controller doesn't solve the problem of having to hold down a button and manipulate other controls for a mix within a short span of time. |
I'm a little unclear of the use-case you describe. When I use master sync I turn it on at the beginning of my set and it stays on the whole time. Or if I'm turning it on it's during the previewing stage where I'm not in a rush. What were you doing that you needed to turn it on quickly while you were doing other things? |
I only use sync occasionally, so I have it off most of the time. |
is push-and-hold an operation on the buttons, or on the control object? Maybe it should be up to the controller configuration to decide how that works. |
It is an option of the ControlObject. I see, you cannot give a button release command from Controller scripts. Ok so i will restore the beatsync behavior. |
…ustment via quantize is not deired.
Ups, I have messed up my 2.1 branch. Fixed now. |
@Be-ing:ready to merge? I would like to release 2.1.1 including this. |
I'm confused what this new |
This PR does not introduce any new control. |
I have double checked it and only the track where I press sync does the seek. |
@Be-ing: merge? |
I think I got confused before because I tested tracks with very different tempos. |
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 a little confused now what this PR changes at this point. IIUC the only behavior change is that beatsync
only syncs phase if quantize is enabled now?
src/engine/sync/synccontrol.cpp
Outdated
if (isPlaying() && m_pQuantize->toBool()) { | ||
// only sync phase if the deck is playing and if quantize is enabled. | ||
// this way the it is up to the user to decide if a seek is desired or not. | ||
// This is helpfull if the beatgrid of the track doe not fit at the current |
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.
helpful
src/engine/sync/synccontrol.cpp
Outdated
// only sync phase if the deck is playing and if quantize is enabled. | ||
// this way the it is up to the user to decide if a seek is desired or not. | ||
// This is helpfull if the beatgrid of the track doe not fit at the current | ||
// payposition |
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.
playposition
src/test/enginesynctest.cpp
Outdated
@@ -1429,3 +1429,52 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) { | |||
EXPECT_EQ(0.0, | |||
ControlObject::getControl(ConfigKey(m_sGroup1, "local_bpm"))->get()); | |||
} | |||
|
|||
TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) { |
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.
ping
src/test/enginesynctest.cpp
Outdated
} | ||
|
||
|
||
|
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.
extra newlines at end of file
@@ -1179,7 +1179,7 @@ void EngineBuffer::processSeek(bool paused) { | |||
return; | |||
} | |||
|
|||
if ((seekType & SEEK_PHASE) && !paused && m_pQuantize->toBool()) { | |||
if (!paused && ((seekType & SEEK_PHASE) || m_pQuantize->toBool())) { |
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 familiar with this area of the code. Can you clarify what this change does?
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.
This allows to sync phase independent from quantize now. The sync signal of the controls that must not sync phase if quatize is of, is done in their buissnes logic.
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.
Okay thank you for explaining.
The changes are that beatsync_phase syncs always phase even if quantize is disabled and we put that to the right klick instead of other redundant controls. |
Done! |
I'm still confused. I just tested master and |
beatsync_phase did not work independently from quantize before. |
I checked again and couldn't reproduce that. So this PR LGTM. |
Thank you. |
This PR fixes
https://bugs.launchpad.net/mixxx/+bug/1772525
and
https://bugs.launchpad.net/mixxx/+bug/1772526
right click on sync seeking in phase.