Skip to content

Commit

Permalink
Roland DJ-202: Add range button
Browse files Browse the repository at this point in the history
  • Loading branch information
Lykos153 committed Mar 16, 2018
1 parent d89e9cc commit f9213a8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
27 changes: 25 additions & 2 deletions res/controllers/Roland_DJ-202-scripts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var DJ202 = {};

DJ202.tempoRange = [0.08, 0.16, 0.5]

DJ202.init = function () {

DJ202.leftDeck = new DJ202.Deck([1,3], 0);
Expand Down Expand Up @@ -61,9 +63,30 @@ DJ202.Deck = function (deckNumbers, offset) {

this.keylock = new components.Button({
midi: [0x90 + offset, 0x0D],
type: components.Button.prototype.types.toggle,
inKey: 'keylock',
shiftOffset: 1,
shiftControl: true,
sendShifted: true,
outKey: 'keylock',
currentRangeIndex: 0,
unshift: function () {
this.type = components.Button.prototype.types.toggle;
this.input = components.Button.prototype.input;
this.inKey = 'keylock';
},
shift: function () {
this.inKey = 'rateRange';
this.type = undefined;
this.input = function (channel, control, value, status, group) {
if (this.isPress(channel, control, value, status)) {
print(this.currentRangeIndex)
this.currentRangeIndex++;
if (this.currentRangeIndex >= DJ202.tempoRange.length) {
this.currentRangeIndex = 0;
}
this.inSetValue(DJ202.tempoRange[this.currentRangeIndex]);
}
}
}
});

engine.setValue(this.currentDeck, "rate_dir", -1);
Expand Down
9 changes: 9 additions & 0 deletions res/controllers/Roland_DJ-202.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
<script-binding/>
</options>
</control>
<control>
<group>[Channel1]</group>
<key>DJ202.leftDeck.keylock.input</key>
<status>0x90</status>
<midino>0x0E</midino>
<options>
<script-binding/>
</options>
</control>
<control>
<group>[Channel1]</group>
<key>DJ202.leftDeck.hotcueButton[1].input</key>
Expand Down

0 comments on commit f9213a8

Please sign in to comment.