Skip to content

Commit

Permalink
Traktor S2 Mk1: setValue -> setParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
leifhelm committed Jul 5, 2023
1 parent 786f321 commit 32c2834
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions res/controllers/Traktor-Kontrol-S2-MK1-hid-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ class EqualizerParameter {
hidReport.addControl(this.group, name, config, "H", 0xFFFF, false, callback.bind(this));
}
knob(field) {
setKnobParameterEq(this.group, "parameter" + this.number, field.value, this.calibration);
setKnobParameter(this.group, "parameter" + this.number, field.value, this.calibration);
}
}

Expand Down Expand Up @@ -1510,16 +1510,7 @@ const setKnobParameter = function(group, key, value, calibration) {
} else {
calibratedValue = script.absoluteLin(value, 0.5, 1, calibration.center, calibration.max);
}
engine.setValue(group, key, calibratedValue);
};
const setKnobParameterEq = function(group, key, value, calibration) {
let calibratedValue;
if (value <= calibration.center) {
calibratedValue = script.absoluteLin(value, 0, 1, calibration.min, calibration.center);
} else {
calibratedValue = script.absoluteLin(value, 1, 2, calibration.center, calibration.max);
}
engine.setValue(group, key, calibratedValue);
engine.setParameter(group, key, calibratedValue);
};
const setFaderParameter = function(group, key, value, calibration) {
const calibratedValue = script.absoluteLin(value, 0, 1, calibration.min, calibration.max);
Expand Down

0 comments on commit 32c2834

Please sign in to comment.