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

Rework master sync internal clock behavior #2376

Merged
merged 113 commits into from
Apr 27, 2020

Conversation

ywwg
Copy link
Member

@ywwg ywwg commented Dec 2, 2019

See https://bugs.launchpad.net/bugs/1851985

This change reworks how master sync hands off between decks and the internal clock.

Before: Internal clock always active, so even if only one sync deck is playing, it's locked to the internal clock bpm. For beatmap (non-const beatgrid) tracks, this would cause the track bpm to be locked at the initial bpm. This causes weird effects as the track's bpm wants to change but isn't allowed to.

After: If only one sync deck is playing, it is Master. This allows its rate to remain constant and let the bpm float up and down. If two decks are playing, then Internal Clock takes over and both tracks play at the same rate. Once a single track is playing, the rate follows that deck.

I had to rework a lot of code and a lot of tests. This is a large change, sorry! Master Sync code has always been a little spaghetti-ish.

Note: This includes my change to remove half/double bpm adjustment. I'll restore that code for this PR soon.

@ywwg
Copy link
Member Author

ywwg commented Dec 2, 2019

bpm display not updated on track load -- will fix

@ywwg
Copy link
Member Author

ywwg commented Dec 2, 2019

bpm display not updated on track load -- will fix

huh, now I can't reproduce this. I'll keep an eye out for it though.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for picking this up.
I have left some minor comments.
The code looks good. I think we need sorrowly manual testing before merge.
I think it makes sense to do after the half/double remove is reverted.

ywwg added 2 commits December 2, 2019 21:22
Had to fix a bug in how beat distances are calculated because bpmcontrol didn't
know about beat distance adjustment.
@daschuer
Copy link
Member

daschuer commented Dec 3, 2019

Please apply this to make CMake work:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2873b5b..651df9f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -949,7 +949,6 @@ add_executable(mixxx-test
   src/test/soundproxy_test.cpp
   src/test/soundsourceproviderregistrytest.cpp
   src/test/sqliteliketest.cpp
-  src/test/synccontroltest.cpp
   src/test/tableview_test.cpp
   src/test/taglibtest.cpp
   src/test/trackdao_test.cpp

@daschuer
Copy link
Member

daschuer commented Dec 3, 2019

This works nice.
Unfortunately I have managed that auto DJ stops unintended and I cannot reproduce it.
I am sure this is not an issue here but an edge case with the new auto DJ implementation.

@ywwg
Copy link
Member Author

ywwg commented Dec 3, 2019

Please apply this to make CMake work:

I reintroduced this file in an update so this should work again

@ywwg
Copy link
Member Author

ywwg commented Dec 4, 2019

This is a very complicated PR, but if other people could test master sync mode (push and hold sync on more than one deck) and play around with it, including auto dj, I'd appreciate it! This goes double for tracks that are beatmapped (old disco, etc) rather than gridded.

This could eventually grow into an enum if necessary
Co-Authored-By: Be <be.0@gmx.com>
@ywwg
Copy link
Member Author

ywwg commented Apr 26, 2020

yeah there's a lot going on. And it looks like basesyncablelistener is probably not needed at all since only EngineSync inherits from it

@Holzhaus
Copy link
Member

Maybe we need it later when we add midi sync?

@ywwg
Copy link
Member Author

ywwg commented Apr 26, 2020

Maybe we need it later when we add midi sync?

midi sync would just be a Syncable like the decks are -- just a source of clock that can be Explicit Master

@Holzhaus
Copy link
Member

OK, we should probably merge the classes then.

@ywwg
Copy link
Member Author

ywwg commented Apr 26, 2020

Can that please wait for a followup PR?

@ywwg
Copy link
Member Author

ywwg commented Apr 27, 2020

I believe all notes are addressed

@daschuer
Copy link
Member

Did some brief test at the track end and everything works as expected.
LGTM .

@uklotzde Merge? You have an open review here.

@ywwg
Copy link
Member Author

ywwg commented Apr 27, 2020

notes addressed, thanks!

@ywwg
Copy link
Member Author

ywwg commented Apr 27, 2020

all approved, who wants to push the button?

@Holzhaus Holzhaus merged commit ebb5b8f into mixxxdj:master Apr 27, 2020
@ywwg
Copy link
Member Author

ywwg commented Apr 27, 2020

woo thanks!

@Holzhaus
Copy link
Member

By the way, I'd appreciate if you wrote a blog post about master sync and also give some usage examples for explicit master. I bet most users have no idea that this exists. If you agree, can you add yourself to the list in mixxxdj/website#77?

@Holzhaus
Copy link
Member

Any Ideas how to expose explicit master via GUI? We could make the sync button in a different color or with a highlighted border. Right clicking the sync button could toggle master sync.

@ywwg
Copy link
Member Author

ywwg commented Apr 27, 2020

Let's take that discussion to zulip

Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request Apr 28, 2020
uklotzde added a commit that referenced this pull request Apr 28, 2020
…mastersync

Roland DJ-505: Update for explicit sync_master change from #2376
@ywwg ywwg mentioned this pull request Mar 13, 2021
@daschuer daschuer mentioned this pull request Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants