Skip to content

Fix controller mapping for Pioneer DDJ-SB - #12280

Open
tonell-m wants to merge 15 commits into
mixxxdj:2.6from
tonell-m:fix/pioneer-ddj-sb-mapping
Open

Fix controller mapping for Pioneer DDJ-SB#12280
tonell-m wants to merge 15 commits into
mixxxdj:2.6from
tonell-m:fix/pioneer-ddj-sb-mapping

Conversation

@tonell-m

@tonell-m tonell-m commented Nov 9, 2023

Copy link
Copy Markdown

Hi all,

I'm using Mixxx with a Pioneer DDJ-SB but the built in controller mapping was not fully working properly so I've fixed the following issues in this PR:

  • When clicking the rotary selector to preview a track an error message was showing up because the script was missing a rotarySelectorClick handler.
    • Clicking the encoder now loads and starts the selected track in the preview deck.
    • Clicking it a second time without changing the selected track will pause playback.
    • Preview playback now starts by default in the middle of the track similarly to DDJ-SB2 behaviour. The playback start position can be edited in the script's user options.
  • The FX selection buttons were not working (clicking them did nothing), so the FX knobs could only control the Mix knob of each unit
    • For that I've removed the existing code for handling the FX units and replaced that with an implementation using the Components library

I've tested this updated script on Mixxx 2.3, 2.4 and 2.5 (all built from source) on macOS 12.6.7 (Monterey) using my DDJ-SB-L and it all seems to be working smoothly.

This is my first time contributing so let me know if some things are missing / need to be changed 🙂

@JoergAtGithub

Copy link
Copy Markdown
Member

Welcome at Mixxx!
As a first-time contributor we need you to sign the Mixxx Contributor Agreement and comment here when you have done so. It gives us permission to distribute your contribution under the GPL v2 or later license and the Apple Mac App Store. It is also helpful for us to have contact information for contributors in case we may need it in the future.

@tonell-m

tonell-m commented Nov 9, 2023

Copy link
Copy Markdown
Author

Done!

@Swiftb0y Swiftb0y left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey there, thank you for caring about this mapping. It is very much appreciated. Please see my questions down below. Also, please understand that in order for us to merge this, we need you to sign the Mixxx Contributor Agreement It gives us permission to distribute your contribution under the GPL v2 or later license and the Apple Mac App Store. It is also helpful for us to have contact information for contributors in case we may need it in the future. (comment race 😅)

Thank you.

Comment thread res/controllers/Pioneer-DDJ-SB.midi.xml
Comment thread res/controllers/Pioneer-DDJ-SB-scripts.js Outdated
Comment thread res/controllers/Pioneer-DDJ-SB-scripts.js
@tonell-m
tonell-m changed the base branch from main to 2.3 November 10, 2023 12:35
@tonell-m
tonell-m marked this pull request as draft November 10, 2023 12:39
tonell_m added 3 commits November 10, 2023 16:46
- Added missing PioneerDDJSB.rotarySelectorClick function and made it start/stop preview deck for the selected track
- Playback start is now defaulted to the middle of the track, the playback start point is configurable via the script's user options section
- Changed declaration of root object from `function() {}` to `{}`
- Removed spaces after `function` keyword
- Removed existing code for controlling effect units
- Replaced with implementation using Components
@tonell-m
tonell-m force-pushed the fix/pioneer-ddj-sb-mapping branch from 8663fc7 to c7dd1d6 Compare November 10, 2023 15:46
@tonell-m
tonell-m marked this pull request as ready for review November 10, 2023 15:47
Comment thread res/controllers/Pioneer-DDJ-SB-scripts.js Outdated
Comment thread res/controllers/Pioneer-DDJ-SB-scripts.js Outdated
@Holzhaus
Holzhaus changed the base branch from 2.3 to 2.4 November 10, 2023 19:00
@Holzhaus

Copy link
Copy Markdown
Member

Thanks for your contribution. I changed the base branch to 2.4, as we won't do another 2.3 release. Could you please check if the mapping still matches the behavior documented in manual (https://manual.mixxx.org/2.4/en/hardware/controllers/pioneer_ddj_sb) and file a PR for the manual repository if changes are needed?

tonell_m added 9 commits November 11, 2023 12:25
Instead of overriding unshift behaviour with a custom input function
…anual

- The DDJ-SB manual states that a non shift press on the buttons should toggle effects on or off instead of selecting the focused effect (this should be done by shift clicking the buttons as the controller labels indicate)
- Renamed `buttons` to `enableButtons` for the sake of clarity and consistency with the default EffectUnit implementation
- Updated parameter names that were marked as deprecated
- Updated usage of `connectControl` in favour of `makeConnection` using a new utility method in the common controller script to limit modifications and allow easier update of other DDJ-SB* scripts
- Turning rotary selector moves vertically in the Library using [Library] MoveVertical
- Clicking rotary selector calls [Library] GoToItem
Since this control is now unused and shift + click loads the track in the preview deck, it can be useful to move the playhead around to quickly preview different sections of the selected track
- Toggling shift updates the fx buttons leds to show either enabled effects (unshift) or currently focused effect (shift)
- Bound right shift button to also trigger `PioneerDDJSB.shiftButton`
- Clicking BACK calls [Library] MoveFocusBackward to allow switching focused library element
- Shift clicking BACK maximises the library by toggling [Skin] show_max_library
@tonell-m

tonell-m commented Nov 17, 2023

Copy link
Copy Markdown
Author

@Swiftb0y @ronso0 I've updated my implementation to take all your comments into consideration, I would recommend you look at the final result instead of going commit per commit as there has been a bit of trial and error 😅

The final mappings are the following:

  • Browser:
    • Turning rotary selector: [Library] MoveVertical
    • Clicking rotary selector: [Library] GoToItem
    • Shift clicking rotary selector: [PreviewDeck1] LoadSelectedTrackAndPlay
    • Shift turning rotary selector: moves [PreviewDeck1] playposition around to allow scrolling through the previewed track
    • Clicking BACK button: [Library] MoveFocusBackward (I think it makes more sense than MoveFocusForward as it directly selects the tree view when the focus is on the track list, which is usually what we want)
    • Shift clicking BACK button: toggles [Skin] show_maximized_library (as the BACK button shift label on the controller is "PANNEL")
  • Effect units:
    • Clicking FX buttons: toggles [EffectRack1_EffectUnitX_EffectX] enabled
    • Shift clicking FX buttons: changes [EffectRack1_EffectUnitX] focused_effect
    • Holding the shift button updates the FX buttons LEDs to show the currently selected effect

If you're okay with these mappings I'll submit a PR for updating manual to reflect those changes.

I've also took the opportunity of making this PR to update various usages of deprecated functions / control names. Let me know if you have further comments / questions!

@daschuer

Copy link
Copy Markdown
Member

Oh sorry to not review this in time. Now I see a conflict has developed.
@Swiftb0y how is the state here?

@acolombier

Copy link
Copy Markdown
Member

@tonell-m do you have interest to continue this PR? As I understand, it only need to get the conflict fixed to be merged. Happy to help with that otherwise.

@tonell-m

Copy link
Copy Markdown
Author

@acolombier sorry for the late response, I haven't had much time to continue this PR lately and probably won't either in upcoming weeks, so if you want to pick it up from there, feel free to do so!
Otherwise I will come back to it later :)

@daschuer
daschuer changed the base branch from 2.4 to 2.5 January 25, 2025 22:29
@acolombier

Copy link
Copy Markdown
Member

No problem at all - glad to hear you haven't lost interest to complete it at some point! I'll mark it as draft for now, but feel free to mark ready as soon as we should get back to it

@acolombier
acolombier marked this pull request as draft February 6, 2025 01:02
@acolombier
acolombier force-pushed the 2.5 branch 2 times, most recently from cd725b1 to d7d5934 Compare June 20, 2025 18:01
@github-actions

Copy link
Copy Markdown

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions Bot added the stale Stale issues that haven't been updated for a long time. label Oct 12, 2025
@ronso0

ronso0 commented Oct 12, 2025

Copy link
Copy Markdown
Member

@tonell-m Any updates on this?
Unfortunately conflicts have emerged.
IIRC lodash is not required anymore, someone please correct if I'm wrong.

@github-actions github-actions Bot removed the stale Stale issues that haven't been updated for a long time. label Nov 8, 2025
@tonell-m

Copy link
Copy Markdown
Author

Hi, sorry for the wait!

I've merged the 2.5 branch back in to resolve conflicts. Also removed the lodash dependency as @ronso0 mentioned and fixed a bug where the updateLeds function would crash if the shift button was not pressed at least once before pressing one of the effects button.

Atm I could only test if everything still worked properly with Mixxx 2.6 beta because of this crash that I couldn't yet solve #16067

@tonell-m
tonell-m marked this pull request as ready for review February 28, 2026 15:59
@tonell-m
tonell-m requested review from Swiftb0y and ronso0 February 28, 2026 16:54

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this change needed? Doesn't look like this file is included in scriptfiles elements?

@ronso0
ronso0 changed the base branch from 2.5 to 2.6 June 4, 2026 08:33
@ronso0

ronso0 commented Jun 4, 2026

Copy link
Copy Markdown
Member

FYI in order to prepare for the 2.6 release (and clean up our milestone list) I just moved this to the 2.6.1 milestone and changed the base to 2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants