summaryrefslogtreecommitdiffstats
path: root/res/controllers/Hercules-DJ-Console-4-Mx-scripts.js
diff options
context:
space:
mode:
authorJosepMaJAZ <josepma@gmail.com>2017-01-21 23:22:53 +0100
committerJosepMaJAZ <josepma@gmail.com>2017-01-21 23:22:53 +0100
commit5984e20430dfa5c925c97dde5182c82c838ea1f9 (patch)
treec07377ff6365b912019aeffab1ed47000fa2288b /res/controllers/Hercules-DJ-Console-4-Mx-scripts.js
parent56de13766776486a0eb122a0bd80f90a858d0a67 (diff)
precision improvement for the pitch slider
Diffstat (limited to 'res/controllers/Hercules-DJ-Console-4-Mx-scripts.js')
-rw-r--r--res/controllers/Hercules-DJ-Console-4-Mx-scripts.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/res/controllers/Hercules-DJ-Console-4-Mx-scripts.js b/res/controllers/Hercules-DJ-Console-4-Mx-scripts.js
index 65ebd85905..7b4467c936 100644
--- a/res/controllers/Hercules-DJ-Console-4-Mx-scripts.js
+++ b/res/controllers/Hercules-DJ-Console-4-Mx-scripts.js
@@ -1475,9 +1475,9 @@ Hercules4Mx.deckRateMsb = function(midichan, control, value, status, group) {
var deck = script.deckFromGroup(group);
//Calculating this always, or else the first time will not work
//(which is precisely when the controller reports the initial positions)
- Hercules4Mx.pitchMsbValue[deck - 1] = value * 0x80;
+ Hercules4Mx.pitchMsbValue[deck - 1] = value;
if (Hercules4Mx.pitch14bitMode === false) {
- engine.setParameter(group, "rate", value / 0x7F);
+ engine.setValue(group, "rate", script.midiPitch(0,value, 0xE0));
}
}
};
@@ -1488,8 +1488,7 @@ Hercules4Mx.deckRateLsb = function(midichan, control, value, status, group) {
var deck = script.deckFromGroup(group);
var msbval = Hercules4Mx.pitchMsbValue[deck - 1];
Hercules4Mx.pitch14bitMode = true;
- engine.setValue(group, "rate", script.absoluteLin(msbval + value, -1, 1, 0, 0x3FFF));
- //TODO: how to use script.midiPitch() instead?
+ engine.setValue(group, "rate", script.midiPitch(value,msbval,0xE0));
}
};