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

Numark Mixtrack (Pro) 3 controller mapping - smartPFL incorrect LED behaviour and library browsing focus bug #14165

Open
endcredits33 opened this issue Jan 12, 2025 · 9 comments

Comments

@endcredits33
Copy link

endcredits33 commented Jan 12, 2025

Bug Description

Reporting 2 bugs with the Numark Mixtrack (Pro) 3 controller mapping. This is my very first time doing this so apologies if the formatting is off. Please note I am using an updated scripts.js file from a recent pull request with other fixes (#13659)

First bug: smartPFL is a configurable variable to automatically activate the Cue/PFL button on a deck when a track is loaded and deactivate it on the other deck (https://manual.mixxx.org/2.5/en/hardware/controllers/numark_mixtrack_pro_3#load). This also controls the LED of the PFL button on the controller itself.

If the variable is set to false, the PFL button within Mixxx is not activated (correctly), however the corresponding LED still lights up on the controller itself. This should not be happening and the LED should remain unlit if smartPFL is disabled, unless it has been manually activated.

I believe the solution is as follows:

Delete lines 1989-2004 below. Loading a track should not turn on the headphones LED as this interferes with normal usage of PFL.

NumarkMixtrack3.OnTrackLoaded = function(value, group, control) {
    var deck = NumarkMixtrack3.deckFromGroup(group);

    if (value !== 0) {
        if (!deck.faderstart) {
            // Light up the PFL light indicating that a track is loaded
            deck.LEDs["headphones"].onOff(ON);
        } else {
            // Flash up the PFL light button indicating that a track is loaded with fader start
            deck.LEDs["headphones"].flashOn(300, ON, 300);
        }
    } else {
        // Switch off the PFL light indicating that a track is ejected
        deck.LEDs["headphones"].onOff(OFF);
    }
};

Delete line 973 as it's now an unused control
"track_samples": "NumarkMixtrack3.OnTrackLoaded",

Delete line 1163 as it switches on the PFL led unconditionally
deck.LEDs["headphones"].onOff(ON);

Second bug: The current browse knob behaviour allows scrolling through the sidebar if Shift is held down. If the browse knob is pushed when Shift is held, the selected sidebar item is expanded. The problem is if you attempt to expand the Tracks, Auto DJ or Playlists element then the focus is shifted to the Tracks table and you have to refocus on the sidebar with your mouse/keyboard. Adding engine.setParameter("[Library]", "focused_widget", 2); and engine.setParameter("[Library]", "focused_widget", 3); improves the behaviour as it refocuses the sidebar when using shift+Browse:

NumarkMixtrack3.BrowseKnob = function(channel, control, value, status, group) {
    var shifted = (
        NumarkMixtrack3.decks.D1.shiftKey || NumarkMixtrack3.decks.D2.shiftKey ||
        NumarkMixtrack3.decks.D3.shiftKey || NumarkMixtrack3.decks.D4.shiftKey
    );

    // value = 1 / 2 / 3 ... for positive //value = 1 / 2 / 3
    var nval = (value > 0x40 ? value - 0x80 : value);

    // SHIFT+Turn BROWSE Knob : directory mode --> select Play List/Side bar item
    if (shifted) {
        engine.setParameter("[Library]", "focused_widget", 2);
	engine.setValue("[Playlist]", "SelectPlaylist", nval);
    } else {
        engine.setParameter("[Library]", "focused_widget", 3);
	engine.setValue("[Playlist]", "SelectTrackKnob", nval);
    }
};

Version

2.5.0

OS

macOS 15.2

@endcredits33 endcredits33 changed the title Numark Mixtrack (Pro) 3 controller mapping - disabling smartPFL variable causes incorrect LED behaviour Numark Mixtrack (Pro) 3 controller mapping - smartPFL incorrect LED behaviour and library browsing focus bug Jan 12, 2025
@ronso0
Copy link
Member

ronso0 commented Jan 13, 2025

Can you reproduce the issues with the built-in mapping?
If no, please post the issue in #13659

@ronso0
Copy link
Member

ronso0 commented Jan 13, 2025

Okay, the Browse encoder issue seems to be unrelated to #13659

The confusion stems from the fact that the [Plalyist] controls work independent of focus while [Library], GoToItem does (which is what Browse press dow, I presume).
There is no dedicated expand sidebar control so, in order to avoid confusion with the library navigation controls, I suggest to

  • map [Library], MoveFocus for jumping to searchbar, sidebar, tracks table
  • make Browse turn always use [Library], MoveVertical
  • then the context-specific action of [Library], GoToItem will make sense

@endcredits33
Copy link
Author

Can you reproduce the issues with the built-in mapping? If no, please post the issue in #13659

Yes, these issues persist from the built-in mapping and weren't fixed in #13659

map [Library], MoveFocus for jumping to searchbar, sidebar, tracks table

Since the (shift+)browse knob behaviour is linked only to the tracks table and the sidebar, I think it would make more sense to use [Library], focused_widget and specify these so the focus doesn't go to the searchbar. Let me know if you disagree.

@ronso0
Copy link
Member

ronso0 commented Jan 14, 2025

so the focus doesn't go to the searchbar

Why not?
With [Library], MoveVertical you can go through the saved queries. Confirm / jump to Tracks with GoToItem. Very handy if you want to navigate the library with controller only.

I see that Shift+Browse is mapped to expand/collapse sidebar item, that can be MoveFocus

I have the strong feeling that I proposed exactly that in another MixTrack discussion..
And I'll keep arguing for thsi to be the standard way of library navigation mapping, since it allows controlling the searchbar, too.
Exceptional use cases for the dedicated (and deprecated) [Playlist] controls are controllers with very few buttons (or with a lot of button ; ) or one needs to control Mixxx while another window has keyboard focus.

Let me know what you think!

@endcredits33
Copy link
Author

Ok, having re-read the above I think I understand a little better and I think that makes sense. So what I've done is the following:

  • Shift + turn Browse knob is MoveFocus
  • Turn browse knob is MoveVertical
  • Shift + press Browse knob is GoToItem

This looks like the following:

NumarkMixtrack3.BrowseButton = function(channel, control, value, status, group) {
    var shifted = (NumarkMixtrack3.decks.D1.shiftKey || NumarkMixtrack3.decks.
        D2.shiftKey || NumarkMixtrack3.decks.D3.shiftKey || NumarkMixtrack3.decks.D4.shiftKey);

    if (value === ON) {
	    if (shifted) {
	        // SHIFT + BROWSE push : directory mode -- > Open/Close selected side bar item
	        engine.setValue("[Library]", "GoToItem", true);
	    } else {
	        // Browse push : maximize/minimize library view
	        if (value === ON) {
	            script.toggleControl("[Skin]", "show_maximized_library");
	        }
	    }
    }
};

NumarkMixtrack3.BrowseKnob = function(channel, control, value, status, group) {
    var shifted = (
        NumarkMixtrack3.decks.D1.shiftKey || NumarkMixtrack3.decks.D2.shiftKey ||
        NumarkMixtrack3.decks.D3.shiftKey || NumarkMixtrack3.decks.D4.shiftKey
    );

    // value = 1 / 2 / 3 ... for positive //value = 1 / 2 / 3
    var nval = (value > 0x40 ? value - 0x80 : value);

    // SHIFT+Turn BROWSE Knob : directory mode --> select Play List/Side bar item
    if (shifted) {
        engine.setValue("[Library]", "MoveFocus", nval);
    } else {
        engine.setValue("[Library]", "MoveVertical", nval);
    }
};

@ronso0
Copy link
Member

ronso0 commented Jan 15, 2025

Well, does it work? Is it fun?

If yes & yes, please open a PR with your changes : )

@endcredits33
Copy link
Author

Yes & yes!

As this is my first time doing this and I'm working with the mapping proposed in #13659 , what's the best way of raising the PR?

@ronso0
Copy link
Member

ronso0 commented Jan 15, 2025

#13659 doesn't touch the Browse mappings so you'd simply create a branch off mixxx/2.5 and commit the Browse stuff only, then open a PR.

The LED fixes should be proposed in #13659
CC @amakea

endcredits33 added a commit to endcredits33/mixxx that referenced this issue Jan 16, 2025
Improve Browse knob/button behaviour by allowing focus shift between search, sidebar, and track table with Shift+turn Browse.

Browse button expands sidebar items or loads track depending on focus. Shift+press Browse maximises the track table.

Further discussion: mixxxdj#14165
@endcredits33
Copy link
Author

Pull request for changed Browse mappings done, hopefully I did everything correctly - #14180. Will add proposed LED changes to #13659

For clarity, I made some further changes after testing the mappings. The below is what I've settled on and I think it works well and minimises usage of the Shift button to create a simpler mapping.

  • Turn browse knob: scroll through focused library element
  • Shift+browse knob: move focus between search/sidebar/track table
  • Press browse knob: expand sidebar item or load track (depending on focus)
  • Shift+ press browse knob: minimise/maximise library

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

No branches or pull requests

2 participants