Skip to content

fix(controllers): fix crossfader cut on Traktor Kontrol Z1#14451

Merged
JoergAtGithub merged 4 commits intomixxxdj:2.5from
ArthurVimond:fix-traktor-kontrol-z1-crossfader-cut
Jan 30, 2026
Merged

fix(controllers): fix crossfader cut on Traktor Kontrol Z1#14451
JoergAtGithub merged 4 commits intomixxxdj:2.5from
ArthurVimond:fix-traktor-kontrol-z1-crossfader-cut

Conversation

@ArthurVimond
Copy link
Copy Markdown
Contributor

@ArthurVimond ArthurVimond commented Mar 7, 2025

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

  • Plug the Traktor Kontrol Z1 to the computer
  • Open Mixxx
  • In the Controllers settings, set the existing Traktor Kontrol Z1 HID mapping
  • In the Mixer settings, set the crossfader curve to scratching (slider completely on the right)
  • Load and play two songs on decks 1 and 2 respectively
  • On the Traktor Kontrol Z1, put the physical crossfader completely on the left
  • Notice the song on deck 2 can still be heard
  • On the Traktor Kontrol Z1, put the physical crossfader completely on the right
  • Notice the song on deck 1 can still be heard

Linked issue

#14450

@Eve00000
Copy link
Copy Markdown
Contributor

Eve00000 commented Mar 7, 2025

Hi Arthur,
I 'm just wondering if a calibration-tool would not be better?
Maybe the crossfader-value-differences can be higher/smaller on other controllers (of the same model and other models).

@ArthurVimond
Copy link
Copy Markdown
Contributor Author

ArthurVimond commented Mar 7, 2025

Hi Eve,
You are right, I thought about it and that's what Traktor do in the Kontrol Z1 settings, there is a calibration button for the knobs, faders and crossfader.

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)?

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Mar 7, 2025

re calibration tool:
a first step could be spinboxes for the upper/lower end in the controller settings, by default using the hardware min/max values.

@ArthurVimond
Copy link
Copy Markdown
Contributor Author

@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!

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Mar 7, 2025

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.
Options are created and grouped into layouts in xml and read in js.

@ArthurVimond
Copy link
Copy Markdown
Contributor Author

Oh yes! I was not aware of this! I definitely love Mixxx!!!

@JoergAtGithub
Copy link
Copy Markdown
Member

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.
Currently we've only one mapping, that reads these calibration values from the device and applies them. This is the mapping for the Traktor S2 Mk1.

@djantti
Copy link
Copy Markdown
Contributor

djantti commented Mar 9, 2025

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!

@daschuer daschuer marked this pull request as draft May 25, 2025 10:01
@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 Sep 19, 2025
@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Sep 19, 2025

@ArthurVimond Do you intend to finish this by implementing the calibration method used in the Traktor S2 Mk1 mapping?

@ArthurVimond
Copy link
Copy Markdown
Contributor Author

Hi @ronso0,
Sorry, yes, I do but didn't find the time to work on it yet.

@github-actions github-actions Bot removed the stale Stale issues that haven't been updated for a long time. label Sep 20, 2025
@ArthurVimond ArthurVimond marked this pull request as ready for review January 29, 2026 14:22
@ArthurVimond
Copy link
Copy Markdown
Contributor Author

Hi @djantti!
If you have some time and still have your Kontrol Z1, would you mind testing this PR again, please? I now use the crossfader calibration values (min and max) to set the corresponding value in Mixxx.

@ronso0 If @djantti confirms it's working fine with his device, could you review it again, please?
Many thanks!!

@djantti
Copy link
Copy Markdown
Contributor

djantti commented Jan 29, 2026

Sure thing! I'll test the PR tomorrow and will report back here. It's awesome that you're working on this feature again! 🤩

Copy link
Copy Markdown
Contributor

@djantti djantti left a comment

Choose a reason for hiding this comment

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

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.

Comment thread res/controllers/Traktor-Kontrol-Z1-scripts.js
Comment thread res/controllers/Traktor-Kontrol-Z1-scripts.js Outdated
Comment thread res/controllers/Traktor-Kontrol-Z1-scripts.js Outdated
@ArthurVimond
Copy link
Copy Markdown
Contributor Author

Hi @ronso0, this PR is ready for review. Thanks!

@ArthurVimond ArthurVimond requested a review from djantti January 30, 2026 13:01
@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Jan 30, 2026

@JoergAtGithub do you mind taking a look?
I'm not familiar with calbration stuff.

Copy link
Copy Markdown
Contributor

@djantti djantti left a comment

Choose a reason for hiding this comment

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

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. 🙏

Copy link
Copy Markdown
Member

@JoergAtGithub JoergAtGithub left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@JoergAtGithub JoergAtGithub merged commit 4ac4635 into mixxxdj:2.5 Jan 30, 2026
13 checks passed
@ronso0 ronso0 mentioned this pull request Feb 1, 2026
@acolombier acolombier added this to the 2.5.5 milestone Feb 25, 2026
@github-project-automation github-project-automation Bot moved this to Done in Releases Feb 25, 2026
@JoergAtGithub JoergAtGithub mentioned this pull request Mar 16, 2026
@JoergAtGithub
Copy link
Copy Markdown
Member

@ArthurVimond @djantti Did you test this mapping change with Mixxx 2.5 or with a newer version of Mixxx?
The release check for 2.5.5 failed with this mapping.

@djantti
Copy link
Copy Markdown
Contributor

djantti commented Mar 16, 2026

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.

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants