Skip to content

Commit

Permalink
Denon MC7000: Use parameter buttons for beat jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
flosse committed Sep 20, 2021
1 parent f593ac1 commit 97f965e
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 40 deletions.
40 changes: 40 additions & 0 deletions res/controllers/Denon-MC7000-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,46 @@ MC7000.autoLoop = function(channel, control, value, status, group) {
}
};

// Parameter Button '<'
MC7000.parameterButtonDown = function(channel, control, value, status, group) {
if (value) {
script.triggerControl(group, "beatjump_backward");
}
};

// Parameter Button '>'
MC7000.parameterButtonUp = function(channel, control, value, status, group) {
if (value) {
script.triggerControl(group, "beatjump_forward");
}
};

// Parameter Button '<' + 'SHIFT'
MC7000.parameterButtonDownShifted = function(channel, control, value, status, group) {
if (value) {
const beatJumpSize = engine.getValue(group, "beatjump_size");
let decreasedIndex = MC7000.beatJump.indexOf(beatJumpSize) - 1;
if (decreasedIndex < 0) {
decreasedIndex = 0;
}
const newBeatJumpSize = MC7000.beatJump[decreasedIndex];
engine.setValue(group, "beatjump_size", newBeatJumpSize);
}
};

// Parameter Button '>' + 'SHIFT'
MC7000.parameterButtonUpShifted = function(channel, control, value, status, group) {
if (value) {
const beatjumpSize = engine.getValue(group, "beatjump_size");
let increasedIndex = MC7000.beatJump.indexOf(beatjumpSize) + 1;
if (increasedIndex >= MC7000.beatJump.length) {
increasedIndex = MC7000.beatJump.length === 0 ? 0 : MC7000.beatJump.length - 1;
}
const newBeatJumpSize = MC7000.beatJump[increasedIndex];
engine.setValue(group, "beatjump_size", newBeatJumpSize);
}
};

// Set Crossfader Curve
MC7000.crossFaderCurve = function(control, value) {
script.crossfaderCurve(value);
Expand Down
80 changes: 40 additions & 40 deletions res/controllers/Denon-MC7000.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1886,162 +1886,162 @@
<!-- PARAMETER BUTTONS -->
<control>
<group>[Channel1]</group>
<key>stars_down</key>
<key>MC7000.parameterButtonDown</key>
<description></description>
<status>0x94</status>
<midino>0x28</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel1]</group>
<key>stars_up</key>
<key>MC7000.parameterButtonUp</key>
<description></description>
<status>0x94</status>
<midino>0x29</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_prev</key>
<group>[Channel1]</group>
<key>MC7000.parameterButtonDownShifted</key>
<description></description>
<status>0x94</status>
<midino>0x2A</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_next</key>
<group>[Channel1]</group>
<key>MC7000.parameterButtonUpShifted</key>
<description></description>
<status>0x94</status>
<midino>0x2B</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>stars_down</key>
<key>MC7000.parameterButtonDown</key>
<description></description>
<status>0x95</status>
<midino>0x28</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>stars_up</key>
<key>MC7000.parameterButtonUp</key>
<description></description>
<status>0x95</status>
<midino>0x29</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_prev</key>
<group>[Channel2]</group>
<key>MC7000.parameterButtonDownShifted</key>
<description></description>
<status>0x95</status>
<midino>0x2A</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_next</key>
<group>[Channel2]</group>
<key>MC7000.parameterButtonUpShifted</key>
<description></description>
<status>0x95</status>
<midino>0x2B</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel3]</group>
<key>stars_down</key>
<key>MC7000.parameterButtonDown</key>
<description></description>
<status>0x96</status>
<midino>0x28</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel3]</group>
<key>stars_up</key>
<key>MC7000.parameterButtonUp</key>
<description></description>
<status>0x96</status>
<midino>0x29</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_prev</key>
<group>[Channel3]</group>
<key>MC7000.parameterButtonDownShifted</key>
<description></description>
<status>0x96</status>
<midino>0x2A</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_next</key>
<group>[Channel3]</group>
<key>MC7000.parameterButtonUpShifted</key>
<description></description>
<status>0x96</status>
<midino>0x2B</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel4]</group>
<key>stars_down</key>
<key>MC7000.parameterButtonDown</key>
<description></description>
<status>0x97</status>
<midino>0x28</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel4]</group>
<key>stars_up</key>
<key>MC7000.parameterButtonUp</key>
<description></description>
<status>0x97</status>
<midino>0x29</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_prev</key>
<group>[Channel4]</group>
<key>MC7000.parameterButtonDownShifted</key>
<description></description>
<status>0x97</status>
<midino>0x2A</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Library]</group>
<key>track_color_next</key>
<group>[Channel4]</group>
<key>MC7000.parameterButtonUpShifted</key>
<description></description>
<status>0x97</status>
<midino>0x2B</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<!-- LIBRARY -->
Expand Down

0 comments on commit 97f965e

Please sign in to comment.