fix(controllers): fix crossfader cut on Traktor Kontrol Z1#14451
fix(controllers): fix crossfader cut on Traktor Kontrol Z1#14451JoergAtGithub merged 4 commits intomixxxdj:2.5from
Conversation
This fixes the issue mixxxdj#14450 (mixxxdj#14450)
|
Hi Arthur, |
|
Hi Eve, I think @djantti developed the original HID mapping. Would it be possible for you (@djantti) to test the values received from the crossfader and tell me if your crossfader really reaches the boundaries (0 and 4045)? |
|
re calibration tool: |
|
@ronso0 If I understand correctly, it is actually possible to create per-controller settings GUI elements directly from the controller mapping JS file? I looked for that in the controllers code but didn't find clear examples. Is it related to the Component JS API? If it's possible, I will clearly do that! |
|
Controller settings are available for MIDI and HID, so unrelated to components. One example mapping you could take a look at would be that for the Traktor S4 Mk3. |
|
Oh yes! I was not aware of this! I definitely love Mixxx!!! |
|
The Z1 stores calibration values for the end and center positions of all the faders and knobs in a device internal memory, accessed via HID FeatureReports. The current Z1 mapping does not read these values and therefore every Z1 will have slightly different fader behavior. This means that the hard-coded values you suggest are suitable for the current wear condition of your controller, but others may require different values. |
|
On my Z1 I get crossfader values from 4 to 4087, so there's definitely variation between devices. 😅 I did a fair bit of NI Traktor USB sniffing back in the day and only briefly experimented with reading the Z1 calibration data. But calibration data import with spinboxes for manual override would be a great modern solution for this! |
cd725b1 to
d7d5934
Compare
|
This PR is marked as stale because it has been open 90 days with no activity. |
|
@ArthurVimond Do you intend to finish this by implementing the calibration method used in the Traktor S2 Mk1 mapping? |
|
Hi @ronso0, |
|
Hi @djantti! @ronso0 If @djantti confirms it's working fine with his device, could you review it again, please? |
|
Sure thing! I'll test the PR tomorrow and will report back here. It's awesome that you're working on this feature again! 🤩 |
djantti
left a comment
There was a problem hiding this comment.
Testing done and the PR works great!
Looks like the crossfader on my Z1 was calibrated to 4 - 4079. I do see it go up 4087, but that's close enough for factory calibration. Or maybe I've just punched it to the sides too much. 😅
I also left some small code suggestions.
|
Hi @ronso0, this PR is ready for review. Thanks! |
|
@JoergAtGithub do you mind taking a look? |
djantti
left a comment
There was a problem hiding this comment.
Nice work, the code is better structured now. I also did another test with my Z1 and the calibration is still functioning as expected. Thank you for improving this mapping. 🙏
|
@ArthurVimond @djantti Did you test this mapping change with Mixxx 2.5 or with a newer version of Mixxx? |
|
This was a while ago, but I'm pretty sure I tested it with 2.5 branch. And I've been testing 2.5 branch Flatpak builds ever since and haven't had any issues with my Z1. |
Problem
When the crossfader curve is set to scratching in the settings, the physical crossfader of the Traktor Kontrol Z1 doesn't cut the sound of the corresponding deck.
Cause
In theory, the crossfader value range is from 0 to 4095, but in practice, it never reaches the boundaries. On my unit, the minimum safe value is 36 (32 at the lowest) and the maximum safe value is 4083 (4087 at the highest).
Approach
When setting the crossfader parameter value, we should apply those safe "margins" to ensure that the crossfader will always cut the sound.
Update: We now get the crossfader calibration values using
controller.getFeatureReport()and apply them to the value to set. We also apply extra safe "margins" (5 on a total range of 4096) to compensate the value returned by the hardware, which can fluctuate a little bit on some crossfader movement (it doesn't always reach the calibrated value everytime).Steps to reproduce
Linked issue
#14450