Skip to content

Commit

Permalink
Fix crossfader handler
Browse files Browse the repository at this point in the history
  • Loading branch information
iRet committed May 21, 2021
1 parent af0d969 commit 6252a75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions res/controllers/Roland_DJ-202-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,15 @@ DJ202.crossfader = new components.Pot({
midi: [0xBF, 0x08],
group: '[Master]',
inKey: 'crossfader',
input: function () {
input: function (_channel, _control, value, _status, group) {
// We need a weird max. for the crossfader to make it cut cleanly.
// However, components.js resets max. to 0x3fff when the first value is
// received. Hence, we need to set max. here instead of within the
// constructor.
this.max = (0x7f << 7) + 0x70;
components.Pot.prototype.input.apply(this, arguments);
value = (this.MSB << 7) + value;
var newValue = this.inValueScale(value);
engine.setParameter(group, this.inKey, newValue);
}
});

Expand Down Expand Up @@ -380,7 +382,7 @@ DJ202.Deck = function (deckNumbers, offset) {

// =============================== MIXER ====================================

this.potInput = function (channel, control, value, status, group) {
this.potInput = function (_channel, _control, value, _status, group) {
value = (this.MSB << 7) + value;
var newValue = this.inValueScale(value);
engine.setParameter(group, this.inKey, newValue);
Expand Down

0 comments on commit 6252a75

Please sign in to comment.