Skip to content

Commit

Permalink
Roland DJ-505: Add Loop Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Aug 11, 2019
1 parent 1b5f62b commit 163629b
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ DJ505.PadSection = function (deck, offset) {
"roll": new DJ505.RollMode(deck, offset),
"sampler": new DJ505.SamplerMode(deck, offset),
"velocitysampler": new DJ505.VelocitySamplerMode(deck, offset),
"loop": new DJ505.SavedLoopMode(deck, offset),
"pitchplay": new DJ505.PitchPlayMode(deck, offset),
};
this.offset = offset;
Expand Down Expand Up @@ -1076,11 +1077,9 @@ DJ505.PadSection.prototype.controlToPadMode = function (control) {
case DJ505.PadMode.VELOCITYSAMPLER:
mode = this.modes.velocitysampler;
break;
// FIXME: Loop mode can be added as soon as Saved Loops are
// implemented: https://bugs.launchpad.net/mixxx/+bug/692926
//case DJ505.PadMode.LOOP:
// mode = this.modes.loop;
// break;
case DJ505.PadMode.LOOP:
mode = this.modes.loop;
break;
case DJ505.PadMode.PITCHPLAY:
mode = this.modes.pitchplay;
break;
Expand Down Expand Up @@ -1169,6 +1168,9 @@ DJ505.HotcueMode = function (deck, offset) {
off: this.color + DJ505.PadColor.DIM_MODIFIER,
colors: hotcueColors,
outConnect: false,
unshift: function () {
this.inKey = 'hotcue_' + this.number + '_activatecue';
},
});
}
this.paramMinusButton = new components.Button({
Expand Down Expand Up @@ -1403,6 +1405,43 @@ DJ505.RollMode.prototype.setLoopSize = function (loopSize) {
this.reconnectComponents();
};

DJ505.SavedLoopMode = function (deck, offset) {
components.ComponentContainer.call(this);
this.ledControl = DJ505.PadMode.ROLL;
this.color = DJ505.PadColor.GREEN;

var savedloopColors = [this.color].concat(DJ505.PadColorMap.slice(1));
this.PerformancePad = function(n) {
this.midi = [0x94 + offset, 0x14 + n];
this.number = n + 8 + 1;

components.Button.call(this);
};
this.PerformancePad.prototype = new components.Button({
sendShifted: true,
shiftControl: true,
shiftOffset: 8,
group: deck.currentDeck,
colors: savedloopColors,
outConnect: false,
on: this.color,
unshift: function() {
this.outKey = "hotcue_" + this.number + "_enabled";
this.inKey = "hotcue_" + this.number + "_activateloop";
},
shift: function() {
this.inKey = "hotcue_" + this.number + "_reloop";
},
});

this.pads = new components.ComponentContainer();
for (var n = 0; n <= 7; n++) {
this.pads[n] = new this.PerformancePad(n);
}
};
DJ505.SavedLoopMode.prototype = Object.create(components.ComponentContainer.prototype);


DJ505.SamplerMode = function (deck, offset) {
components.ComponentContainer.call(this);
this.ledControl = DJ505.PadMode.SAMPLER;
Expand Down

0 comments on commit 163629b

Please sign in to comment.