Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roland DJ-505: Map buttons for library sorting #2125

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ DJ505.browseEncoder = new components.Encoder({
});

DJ505.backButton = new components.Button({
// TODO: Map the BACK/SONG button
// TODO: Map the BACK button
midi: [0x9F, 0x07],
shiftOffset: 11,
sendShifted: true,
Expand All @@ -236,7 +236,6 @@ DJ505.backButton = new components.Button({
});

DJ505.addPrepareButton = new components.Button({
// TODO: Map the ARTIST button
midi: [0x9F, 0x1B],
shiftOffset: -7,
sendShifted: true,
Expand All @@ -246,6 +245,33 @@ DJ505.addPrepareButton = new components.Button({
type: components.Button.prototype.types.toggle,
});


DJ505.sortLibrary = function (channel, control, value, status, group) {
if (value === 0) {
return;
}

var sortColumn;
switch(control) {
case 0x12: // SONG
sortColumn = 1;
break;
case 0x13: // BPM
sortColumn = 14;
break;
case 0x14: // ARTIST
sortColumn = 0;
break;
case 0x1E: // KEY
sortColumn = 19;
break;
default:
// unknown sort column
return;
}
engine.setValue("[Library]", "sort_column_toggle", sortColumn);
};

DJ505.crossfader = new components.Pot({
midi: [0xBF, 0x08],
group: "[Master]",
Expand Down
12 changes: 6 additions & 6 deletions res/controllers/Roland_DJ-505.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3343,9 +3343,9 @@
<script-binding/>
</options>
</control>
<!--
<control>
<group>[Master]</group>
<group>[Library]</group>
<key>DJ505.sortLibrary</key>
<description>BPM</description>
<status>0x9F</status>
<midino>0x13</midino>
Expand All @@ -3354,15 +3354,15 @@
</options>
</control>
<control>
<group>[Master]</group>
<group>[Library]</group>
<key>DJ505.sortLibrary</key>
<description>KEY</description>
<status>0x9F</status>
<midino>0x1E</midino>
<options>
<script-binding/>
</options>
</control>
-->
<control>
<group>[Library]</group>
<key>DJ505.browseEncoder.input</key>
Expand Down Expand Up @@ -3405,7 +3405,7 @@
</control>
<control>
<group>[Library]</group>
<key>DJ505.backButton.input</key>
<key>DJ505.sortLibrary</key>
<description>SONG</description>
<status>0x9F</status>
<midino>0x12</midino>
Expand All @@ -3425,7 +3425,7 @@
</control>
<control>
<group>[Library]</group>
<key>DJ505.addPrepareButton.input</key>
<key>DJ505.sortLibrary</key>
<description>ARTIST</description>
<status>0x9F</status>
<midino>0x14</midino>
Expand Down