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

Traktor Kontrol Z1 - RangeError: index out of range #13832

Open
JoergAtGithub opened this issue Nov 3, 2024 · 7 comments
Open

Traktor Kontrol Z1 - RangeError: index out of range #13832

JoergAtGithub opened this issue Nov 3, 2024 · 7 comments

Comments

@JoergAtGithub
Copy link
Member

I´m a new user and when I tried to connect my unity to mix, and error was reported. Could anyone help me, please?:

Uncaught exception: file:///Volumes/mixxx-2.4.1/Mixxx.app/Contents/Resources/controllers/common-hid-packet-parser.js:455: RangeError: index out of range
Backtrace: unpack@file:///Volumes/mixxx-2.4.1/Mixxx.app/Contents/Resources/controllers/common-hid-packet-parser.js:455
parse@file:///Volumes/mixxx-2.4.1/Mixxx.app/Contents/Resources/controllers/common-hid-packet-parser.js:989
parsePacket@file:///Volumes/mixxx-2.4.1/Mixxx.app/Contents/Resources/controllers/common-hid-packet-parser.js:1636
readCurrentPosition@file:///Volumes/mixxx-2.4.1/Mixxx.app/Contents/Resources/controllers/Traktor-Kontrol-Z1-scripts.js:123
init@file:///Volumes/mixxx-2.4.1/Mixxx.app/Contents/Resources/controllers/Traktor-Kontrol-Z1-scripts.js:26

Originally posted by @Karaku in #1989 (comment)

@JoergAtGithub
Copy link
Member Author

@Karaku Could you try to replace the following lines in Traktor-Kontrol-Z1-scripts.js at Line 119

 readCurrentPosition() {
     // Sync on-screen controls with controller knob positions
     const report0x01 = new Uint8Array(controller.getInputReport(0x01));
     // The first packet is ignored by HIDController
     this.controller.parsePacket([0x01, ...Array.from(report0x01.map(x => x ^ 0xFF))]);
     this.controller.parsePacket([0x01, ...Array.from(report0x01)]);
 }

by


 readCurrentPosition() {
     // Sync on-screen controls with controller knob positions
     const report0x01 = new Uint8Array(controller.getInputReport(0x01));
     // The first packet is ignored by HIDController
     this.incomingData([0x01, ...report0x01.map(x => ~x)]);
     this.incomingData([0x01, ...report0x01]);
 }

@Karaku
Copy link

Karaku commented Nov 13, 2024

Hey! Is working!

After modifying the code, the option to map it via midi with the learning assistant via midi has been enabled. I still need to map the Main Knob and the FX "On" and "Mode" buttons, if someone would be so kind as to Explain to me if they have any correspondence, thanks again!

The other two options have these errors:

The mapping "Apple Mikey HID Driver " and "Traktor Kontrol Z1 F76A_3":

Uncaught exception: file:///Applications/Mixxx.app/Contents/Resources/controllers/Traktor-Kontrol-Z1-scripts.js:129: SyntaxError: Unexpected token `identifier'
Backtrace: @file:///Applications/Mixxx.app/Contents/Resources/controllers/Traktor-Kontrol-Z1-scripts.js:129

@JoergAtGithub
Copy link
Member Author

The mapping that comes with Mixxx is a HID mapping, you must load it to the Traktor Z1 HID device, not to the MIDI device (which is just a software emulation).

@Karaku
Copy link

Karaku commented Nov 13, 2024

Sorry, I'm quite new to these issues, I see that in the Controllers folder, in addition to the .js file, there is a hid.txt file and a hid.txt file, but line 119 does not exist there... :)

@JoergAtGithub
Copy link
Member Author

The file name on your system is: file:///Applications/Mixxx.app/Contents/Resources/controllers/Traktor-Kontrol-Z1-scripts.js

@Karaku
Copy link

Karaku commented Nov 13, 2024

Yes, that is the file that I modified with line 119 and as a result it only let me map the controller manually...

@JoergAtGithub
Copy link
Member Author

Do you get any error message after the change? Can you share a Screenshot of your controller settings in the Preference dialog?

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