Skip to content

Commit

Permalink
Roland DJ-505: Add support for custom hot cue colors
Browse files Browse the repository at this point in the history
This depends on PR mixxxdj#2030. If the PR is merged, custom hot cue colors
will immediately work with this mapping. In the meantime, the pads will
light up in the mode's color (i.e. white in hot cue mode, blue in cue
loop mode).
  • Loading branch information
Holzhaus committed May 19, 2019
1 parent 77ebfda commit 33889a5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,18 @@ DJ505.PadColor = {
DIM_MODIFIER: 0x10,
};

DJ505.PadColorMap = [
DJ505.PadColor.OFF,
DJ505.PadColor.RED,
DJ505.PadColor.GREEN,
DJ505.PadColor.BLUE,
DJ505.PadColor.YELLOW,
DJ505.PadColor.CELESTE,
DJ505.PadColor.PURPLE,
DJ505.PadColor.APRICOT,
DJ505.PadColor.WHITE,
];

DJ505.PadSection = function (deck, offset) {
// TODO: Add support for missing modes (flip, slicer, slicerloop)
/*
Expand Down Expand Up @@ -1060,6 +1072,8 @@ DJ505.HotcueMode = function (deck, offset) {
components.ComponentContainer.call(this);
this.ledControl = DJ505.PadMode.HOTCUE;
this.color = DJ505.PadColor.WHITE;

var hotcueColors = [this.color].concat(DJ505.PadColorMap.slice(1));
this.pads = [];
for (var i = 0; i <= 7; i++) {
this.pads[i] = new components.HotcueButton({
Expand All @@ -1069,8 +1083,9 @@ DJ505.HotcueMode = function (deck, offset) {
shiftOffset: 8,
number: i + 1,
group: deck.currentDeck,
on: i + 1,
on: this.color,
off: this.color + DJ505.PadColor.DIM_MODIFIER,
colors: hotcueColors,
outConnect: false,
});
}
Expand All @@ -1094,10 +1109,10 @@ DJ505.CueLoopMode = function (deck, offset) {
this.ledControl = DJ505.PadMode.HOTCUE;
this.color = DJ505.PadColor.BLUE;

var cueloopColors = [this.color].concat(DJ505.PadColorMap.slice(1));
this.PerformancePad = function(n) {
this.midi = [0x94 + offset, 0x14 + n];
this.number = n + 1;
this.on = this.number;
this.outKey = "hotcue_" + this.number + "_enabled";

components.Button.call(this);
Expand All @@ -1107,7 +1122,9 @@ DJ505.CueLoopMode = function (deck, offset) {
shiftControl: true,
shiftOffset: 8,
group: deck.currentDeck,
on: this.color,
off: this.color + DJ505.PadColor.DIM_MODIFIER,
colors: cueloopColors,
outConnect: false,
unshift: function() {
this.input = function (channel, control, value, status, group) {
Expand Down

0 comments on commit 33889a5

Please sign in to comment.