-
Notifications
You must be signed in to change notification settings - Fork 35
Description
TL;DR - got it to work by changing the script to use client.play_state instead of client.state. Use with caution.
Good day,
Maybe this isn't really an "issue", but maybe someone will have an idea how to make it work.
I was attempt to use midiclock.py to sync a hardware device connected via USB. The script works as intended, but I noticed that there was no BPM change when I adjusted the slider on either of my playing CDJ-2K decks.
Looking at the code, I noticed that the update_master() callback function does nothing unless one of the decks returns "master" from client.state. Since the original 2000s don't have beat sync, there is no value in state.
The only logical workaround I could think of was to modify so that it checked if client.play_state == "playing". Now, this is fine when only one deck is playing, but if it's more than one, the resulting MIDI clock signal flips back and forth between the BPMs of each deck. If they're the same tempo, or at least reasonably close (within ~0.1 BPM) this is a non issue. And for many of us in the EDM/Dance scene, we usually beatmatch anyway. But while prepping the next track, one deck's BPM can change more dramatically; I haven't even tried to see how it responds to a backspin yet.
I don't know if there's a way to get the midiclock script to check the play state of both decks, since it's reacting to incoming packets regardless of where they come from.
If any reading this has any ideas, please do share. I'll obviously update if I figure something out on my own, and push up a PR accordingly.