From 932d897d2ab6543edcd29523011b9c3cf32b66ec Mon Sep 17 00:00:00 2001
From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:11:37 +0200
Subject: [PATCH] Numark NS6II: add workaround for firmware-buggy splitcue
toggle
---
res/controllers/Numark NS6II.midi.xml | 60 ++++++++++++++++++++-----
res/controllers/Numark-NS6II-scripts.js | 29 +++++++++---
2 files changed, 70 insertions(+), 19 deletions(-)
diff --git a/res/controllers/Numark NS6II.midi.xml b/res/controllers/Numark NS6II.midi.xml
index 5a1b218e9425..91b83e906131 100755
--- a/res/controllers/Numark NS6II.midi.xml
+++ b/res/controllers/Numark NS6II.midi.xml
@@ -1006,7 +1006,7 @@
[Channel1]
- NS6II.decks[0].jog.touch.input
+ NS6II.decks[0].jog.inputTouch
0x80
0x06
@@ -1015,7 +1015,7 @@
[Channel2]
- NS6II.decks[1].jog.touch.input
+ NS6II.decks[1].jog.inputTouch
0x81
0x06
@@ -1024,7 +1024,7 @@
[Channel3]
- NS6II.decks[2].jog.touch.input
+ NS6II.decks[2].jog.inputTouch
0x82
0x06
@@ -1033,7 +1033,7 @@
[Channel4]
- NS6II.decks[3].jog.touch.input
+ NS6II.decks[3].jog.inputTouch
0x83
0x06
@@ -1069,7 +1069,7 @@
[Channel1]
- NS6II.decks[0].jog.touch.input
+ NS6II.decks[0].jog.inputTouch
0x90
0x06
@@ -1078,7 +1078,7 @@
[Channel2]
- NS6II.decks[1].jog.touch.input
+ NS6II.decks[1].jog.inputTouch
0x91
0x06
@@ -1087,7 +1087,7 @@
[Channel3]
- NS6II.decks[2].jog.touch.input
+ NS6II.decks[2].jog.inputTouch
0x92
0x06
@@ -1096,7 +1096,7 @@
[Channel4]
- NS6II.decks[3].jog.touch.input
+ NS6II.decks[3].jog.inputTouch
0x93
0x06
@@ -1132,7 +1132,7 @@
[Channel1]
- NS6II.decks[0].jog.turn.input
+ NS6II.decks[0].jog.inputWheel
0xB0
0x06
@@ -1141,7 +1141,7 @@
[Channel2]
- NS6II.decks[1].jog.turn.input
+ NS6II.decks[1].jog.inputWheel
0xB1
0x06
@@ -1150,7 +1150,7 @@
[Channel3]
- NS6II.decks[2].jog.turn.input
+ NS6II.decks[2].jog.inputWheel
0xB2
0x06
@@ -1159,7 +1159,7 @@
[Channel4]
- NS6II.decks[3].jog.turn.input
+ NS6II.decks[3].jog.inputWheel
0xB3
0x06
@@ -4910,6 +4910,42 @@
+
+
+ NS6II.PCSelectorInput
+ 0x8F
+ 0x3C
+
+
+
+
+
+
+ NS6II.PCSelectorInput
+ 0x9F
+ 0x3C
+
+
+
+
+
+
+ NS6II.PCSelectorInput
+ 0x8F
+ 0x3D
+
+
+
+
+
+
+ NS6II.PCSelectorInput
+ 0x9F
+ 0x3D
+
+
+
+
diff --git a/res/controllers/Numark-NS6II-scripts.js b/res/controllers/Numark-NS6II-scripts.js
index ea93cb95b1fc..80b4332d695b 100755
--- a/res/controllers/Numark-NS6II-scripts.js
+++ b/res/controllers/Numark-NS6II-scripts.js
@@ -415,13 +415,22 @@ NS6II.MixerContainer = function() {
// There is a bug in Firmware v1.0.4 which causes the headsplit
// control to be sent inverted when the controller status is sent
// (either on PC1/PC2 switch or when requested via sysex).
- // Numark is aware of the issue, though they have not confirmed
- // if they consider it a bug and if they're working on a fix.
- // I'd prefer to disable the feature rather than trying to find a workaround
- // midi: [0x9F, 0x1C],
- // group: "[Master]",
- // inKey: "headSplit",
- input: function() {},
+ // Numark is aware of the issue but they don't seem to be interested
+ // in fixing it, so this implements a workaround.
+ invertNext: function() {
+ this._invertNext = true;
+ this._timerHandle = engine.beginTimer(200, function() {
+ this._invertNext = false;
+ }, true);
+ },
+ _invertNext: false,
+ midi: [0x9F, 0x1C],
+ group: "[Master]",
+ inKey: "headSplit",
+ isPress: function(channelmidi, control, value, status) {
+ var pressed = components.Button.prototype.isPress.call(this, channelmidi, control, value, status);
+ return this._invertNext ? !pressed : pressed;
+ }
});
this.crossfaderContour = new components.Pot({
midi: [0xBF, 0x09],
@@ -1281,6 +1290,12 @@ NS6II.deckWatcherInput = function(midichannel, _control, _value, _status, _group
toDeck.takeoverLeds.trigger();
};
+NS6II.PCSelectorInput = function(_midichannel, _control, value, _status, _group) {
+ if (value > 0) {
+ NS6II.mixer.splitCue.invertNext();
+ }
+};
+
NS6II.EffectUnits = [];
for (var i = 1; i <= 2; i++) {
NS6II.EffectUnits[i] = new components.EffectUnit(i);