-
-
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
Traktor S2 MK1: Add calibration and refactor #11237
Conversation
On a first look, the code looks very clean. |
You might be interested in initializing Mixxx with the knob positions at startup, using getInputReport (which is another new HID feature in 2.4). Example: e221885 |
We have issue #10667 where this mapping was derived from. |
This PR is marked as stale because it has been open 90 days with no activity. |
I’m back. The mapping of knobs seems to have changed. Only goes non-linearly halfway. 🤔 |
What does that mean? Mixxx is not Traktor. |
Turning Browse: go up or down in track list. I guess the desired behavior would be (based on Traktor S4 Mk2): So if you would like to select a track in the track list, you have to do the following:
MoveFocus also shifts focus to the text search box, a bit odd when using the controller. |
|
And with this implementation there's no way to move focus to the library sidebar, right?
Yes, one possibility.
Yep. But if you don't click on any beatsize spinboxes the focus remains on Tracks, even if you toggle the maximized library.
Why is that odd? You can then cycle through the list of saved search queries. If you never do that and want to prevent accidental query change, you can disable the Up/Down functionality in Preferences > Library. |
In my implementation pressing shift moves focus to the sidebar (Tracks, Auto-DJ, …). Releasing shift moves focus back to the Track list. Have a look at |
There are dedicated controls for beatsize adjustment. When selecting the beatsize with the mouse, The current system is optimized for people who navigate around their library with the side bar and the track list, maybe frequently switching between them as they navigate a folder structure. And do not use the Do you have a better idea of what to do when pressing Browse in track-list? I think I messed up the terminology in my previous comments. |
I seems that different equalizers need different parameter scaling. How should this be handled? |
Btw what I expect the Browse mapping to do is pretty much what @JoergAtGithub proposed in your previous PR #3905 (comment)
Yes, correct. Since the spinboxes can only be focused by mouse click it is assumed the beat size is change by mouse or keyboard. With |
@ronso0 are you happy with the browse knob behavior now? |
Could you please explain step by step, how you tested that the calibration values are used in the same way as in Traktor Pro. |
Yeah, I think this can work well. |
I captured the USB Traffic from Traktor Pro with Wireshark and USBPcap. When doing the calibration sequence I would only turn/move one knob/slider. Traktor Pro seems to have a check in place that writes default values if you do not move a knob/slider. This can be used to check which values have changed. As the calibration sequence demands left, right, center for knobs, and three values which are the exact same as in the last received input packet, I figured that the corresponding values are the ADC readings of the left, right, center position. Sliders only have the two end positions in the calibration routine. I hope this explains that enough. As decompilation was not used, I can not for example tell how the calibration values are used in Traktor Pro.
Good catch. I changed it to |
This describes the capture of the calibration procedure, but did you also captured the readout when Traktor Pro starts up? Did you tried to intentionally calibrate intentionally "wrong", e.g. left and right cross-fader positions close to the center, to get extra sharp cuts? If you do, does it cut at the same fader position with Traktor Pro and Mixxx? |
When Traktor Pro 2 starts up the feature reports |
I calibrated the crossfader to about 5 mm from the edge. When slowly moving the slider from the outside inwards the crossfader in the software starts moving at the same point for Traktor and Mixxx. |
03acb98
to
697e9eb
Compare
this.decks[0].registerInputs(InputReport0x01, InputReport0x02, { | ||
gainEncoderPress: [0x0E, 0x01], | ||
shift: [0x0D, 0x80], | ||
sync: [0x0D, 0x40], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This registerInputs structure is very difficult to understand. For me it's not clear anymore, in which InputReport an input data item is located. Please rethink how to make this part of the code easier readable for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code structure is much better readable now - but I found some small points. Please have a look!
return; | ||
} | ||
// was enabled, and button has been let go. maybe latch it. | ||
if (now - this.syncEnabledTime > 300) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.syncEnabledTime is not a numeric type, it's defined as this.syncEnabledTime = {};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would NaN
be better? isNaN(now - NaN) === true
and NaN > 300 === false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Waiting for CI.
Thank you! |
There is a report in our forum, that this mapping is not working on Linux: https://mixxx.discourse.group/t/ni-traktor-s2-mk1-linux-only-half-of-the-mapping-works/29468 |
As discussed in #3905 with @JoergAtGithub this PR add the capability to read the feature report of the controller and apply the calibration stored in it.
I cleaned up the messy code and replaced it with nice OOP code.
I guess this has to wait until #3905 gets into 2.4.