-
-
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
update Pioneer DDJ-SB2 mapping for Mixxx 2.1 #1243
Conversation
Button LEDs indicate the focused effect short press effect button: focus that effect, or unfocus if it is already focused. long press effect button: toggle enable switch for that effect knob: control metaknob of focused effect or dry/wet if no effect is focused Update copyright notice because Components is licensed under GPL
and cleanup code
* make vinyl/slip button only show status of vinyl or slip mode, depending on invertVinylSlipButton option. Also make slip button a momentary instead of toggle switch button. * do not show status of quantize on sync button LED when shift is pressed This commit removes MIDI output for play, cue, and sync buttons, but that is restored in the next commit.
clean up code for gain, EQ, QuickEffect knobs plus play, cue, and sync buttons
from left to right: beatloop_toggle, shift beatlooproll_activate beatloop_halve, shift loop_move_backward beatloop_double, shift loop_move_forward reloop_toggle, shift reloop_andstop
I have not had a chance to test this. If this does anything, I presume it queries the controller for the position of potentiometers on startup.
I have not actually tested this because I no longer have access to a DDJ-SB2. The 0x9B, 0x08, 0x7F message works for requesting the potentiometer positions on the DDJ-SX, so hopefully it works for the DDJ-SB2 as well.
and loop_scale for manual loops
now that loop_move_forward/backward have been removed
Who is able to review this? |
@nikmartin, @DJMaxergy, or @dg3nec, could one of you test this? |
Absolutely, just pulled out my SB2 and will test today. This issue states that it's dependent on #1127 and #1187. Should I merge those two PRs into master to test this? Since #1151 is now in master, do I need to do anything to make Tango use the new controls in PR #1187? I want to make sure I have my test environment setup correctly. |
Both PRs this depended on have been merged to master. You can test it with the version of Tango in master, but you won't see the beatloop_size or beatjump_size on screen unless you use #940. |
@nikmartin, can you report whether Mixxx loads the positions of the knobs and faders of the controller on startup? If so, please try commenting out lines 183 and 184 in the JS file, one line at a time, to test which one of those lines is working. Put |
I loaded a track that has hotcues immediately on startup, and the first three pads lit, corresponding to the three hotcues in the track. Also, the hotcues work properly right after loading. |
Okay, so sending those MIDI messages does change the MIDI messages the controller sends when the pads are pressed. We could add an easy to configure user preference to pick the pad mode to set the controller to on startup. However, I think it would be better to avoid changing it on shutdown. In the
with this:
and remove the code I posted above from the |
OK, now on shutdown, everything 'cleans up' and the controller is left in a nominal state. |
Another not so small change is that shift+play used to reverse the track only while the play button was depressed. Now, it stays reversed until you release and hit play again. Can that be changed into an option in the script header? I use that function pretty heavily to censor tracks that I don't have a clean version of, and now it's not very easy to use when you are back masking over a single bad word. |
I wrote a VERY close approximation of the native Pad Trans effect in the SB2. It's actually wired to the padtrans key in the midi xml, so the implementation below is hard coded to 1/8 of a beat. I think I may replace the Pads - kill (shift + manual loop) to see how it works in practice. If the pad trans wasn;t a proprietary non-midi control, we could use it as an on / off, but it takes over the pads midi values when it's on.
|
When you start Mixxx again, is the pad mode the same as when Mixxx shut down?
Hmm, could that be fit into the mapping elsewhere? Maybe shift + Pad Trans? That could get tricky though. I think the mapping would have to track the active pad mode and reset it to the last mode when shift + Pad Trans was released.
Proprietary non-MIDI control? It's a USB MIDI class compliant device. Do you mean the pads send different MIDI messages when Pad Trans is active? That's how the other pad modes work. I don't see those MIDI codes listed in Pioneer's documentation though, so it would be up to you to map those. You could make a pull request for my ddj_sb2_mapping branch, or we could merge this, then you could make another pull request for the master branch of this repository. |
Upon further debugging, on shutdown, almost everything is reset to nominal with just the hotcue button on, and it comes up that same way. It does reset the vinyl mode, but that's a javascript variable. If the Shift + Manual Loop light is blinking, it remains that way when mixxx exits, and when restarted, everything is set back to a nominal state.
It is, except for the pad-trans button. it sends
On channel 1, BUT it somehow short circuits the performance pads 1-4. While the padTrans button is enabled, pads 1-4 (top row ) all send:
And only send that when they are released. There's a lot of grumbling about this over at Traktor. In fact, if you start Serato once, use the pad trans effects, then exit and start mixxx, the pad trans effect works until you unplug the controller. The effect is actually loaded in the controller until it's unplugged. |
Hmm, that's strange. Maybe when the Pad Trans button is pressed Serato sends the controller a MIDI message that sets the controller to a state where it sends distinct messages for each pad. I doubt they went so far out of their way to use something that isn't a standard MIDI message. Perhaps that mysterious "DJ App Connect" message has something to do with it. If you want to get that to work, I suggest using MIDI Monitor (Mac) or MIDI OX (Windows) to intercept the MIDI messages that Serato sends to the controller. From Pioneer support, apparently Serato sends the controller a message with the tempo, then the controller firmware uses that to send volume on/off MIDI messages repeatedly when a pad is pressed in Pad Trans mode. |
Yes, my guess is that since the effect works after being disconnected from Serato and connected to mixxx, that the effect is actually being done in the soundcard on the SB2, and the performance pads are no longer sending valid midi messages when the PAd Trans button is on.. You SB2 mapping is quite well written, but I'm having a time finding an unused latching button (like the Shift+Manual Loop button) that will let me add this effect to the mapping. I know that the Filter Kill effect commands are now deprecated in lieu of the Effects framework, but I don't want to get rid of them until the commands are actually removed from mixxx. Any other ideas for an unused Shift + Button combo? |
I think it's highly unlikely that Pioneer put audio DSP inside the DDJ-SB2. That would be a huge waste of money for them. It doesn't even have an analog-to-digital converter for the microphone input. From this video, it looks like the firmware makes the effect just by sending messages as if the volume fader was jumping up/down really fast, like how the filter fade feature sends MIDI messages as if the filter knobs are being turned. Getting Pad Trans to work might be as simple as figuring out the MIDI message Serato sends to the controller to tell it the tempo to use. |
Agreed, the effect itself is pretty simple, so that's probably it. My implementation works pretty well, but the timer api will drift out of sync after a while, but longer than you'd actually use the effect. My initial thought was to try to do it using the mixxx effects chain, assigning the effect to a high numbered effects slot, but couldn't grok the effects framework to figure it out. |
Let me debug it a bit more and make it deck independent and find an unused effect enable key in the mapping, and I'll do a pull request |
Those are the MIDI messages for the deck volume fader (it uses 2 MIDI messages, one for a least significant byte and another for a most significant byte). |
I think it would be a better idea to figure out how Serato communicates the tempo to the controller and work with how the controller is designed. |
midi capture here : https://forums.pioneerdj.com/hc/en-us/community/posts/205846443-DDJ-SB2 |
@nikmartin: I added an option to use shift + cue for reverseroll like it was mapped in Mixxx 2.0. Are there any issues remaining? Ready for merge? If someone who has the controller wants to implement the Pad Trans functionality, I think that should be done in a new PR after merging this. |
@Be-ing I will test heavily the next few days, and open new issues that I find (Edit: My opinion is that it's ready to merge as-is). I will also make an attempt at the Pad Trans effect and do a PR based on master after this is merged. Based on your earlier reply to my comment about what the controller is sending on pad trans + effect buttons, the effect seems to rely on the controller knowing the BPM of the song, and the rapid volume switches are in sync with the bpm. My attempt is just using the bpm from the track, but is not synced in any way. I'm not sure that that is available to javascript from the mixxx engine. I don't think the controller has any DSP capability, but does seem to possibly know how to do beat detection? Not sure yet. |
@daschuer: could you merge this? @nikmartin: I doubt the controller has any way to detect the beat. It probably gets that information from Serato with some undocumented MIDI message. You'd have to intercept the MIDI messages from Serato to find that. Mixxx does make the BPM available to controller mappings through the "bpm" Control. |
Thank you for all the work. And for reviewing this. |
Update Pioneer DDJ-SB2 for new effects and looping UIs in Mixxx 2.1 and fix various other issues. New mappings for autoloop pad layer and effects are documented on the wiki.
I did this while I was staying with a friend who happened to have a DDJ-SB2. I do not have access to the device to test further changes.
It would be nice to finish rewriting this using Components, but I did not have time to do that.
Depends on: