Skip to content
Closed
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
26 changes: 21 additions & 5 deletions res/controllers/Denon-MC7000-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,9 @@ MC7000.PadButtons = function(channel, control, value, status, group) {
}
}
} else if (MC7000.PADModeCueLoop[deckNumber]) {
return;
// TODO
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert these unrelated changes.

} else if (MC7000.PADModeFlip[deckNumber]) {
return;
// TODO
} else if (MC7000.PADModeRoll[deckNumber]) {
// TODO(all): check for actual beatloop_size and apply back after a PAD Roll
i = control - 0x14;
Expand Down Expand Up @@ -561,7 +561,7 @@ MC7000.PadButtons = function(channel, control, value, status, group) {
midi.sendShortMsg(0x94 + deckOffset, control, MC7000.padColor.sliceron);
}
} else if (MC7000.PADModeSlicerLoop[deckNumber]) {
return;
// TODO
} else if (MC7000.PADModeSampler[deckNumber]) {
for (i = 1; i <= 8; i++) {
if (control === 0x14 + i - 1 && value >= 0x01) {
Expand Down Expand Up @@ -589,9 +589,9 @@ MC7000.PadButtons = function(channel, control, value, status, group) {
}
}
} else if (MC7000.PADModeVelSamp[deckNumber]) {
return;
// TODO
} else if (MC7000.PADModePitch[deckNumber]) {
return;
// TODO
}
};

Expand Down Expand Up @@ -883,6 +883,22 @@ MC7000.censor = function(channel, control, value, status, group) {
}
};

// Auto-Loop Button
MC7000.autoLoop = function(channel, control, value, status, group) {
if (value) { // Button Down == 0x7F
if (engine.getValue(group, "loop_enabled")) {
engine.setValue(group, "loop_enabled", false);
engine.setValue(group, "reloop_toggle", true);
} else {
// NOTE:
// `script.toggleControl` does not work here,
// so we have to do it manually.
engine.setValue(group, "beatloop_activate", true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This invocation sequence requires a comment, i.e. why you need a negative edge trigger. Does this even work as intended?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is imprecise and wrong. script.toggleControl() works as expected and inverts a boolean value, i.e. 0/false -> 1/true or 1/true -> 0/false. Setting beatloop_activate to true and then to false is a completely different use case.

How about setting beatloop_activate to true on button down and to false otherwise (button up or when entering the other if arm on button down)?

I am using this pattern a lot in the MC6000MK2 script to avoid getting stuck in inconsistent states, e.g. when a button is pressed shifted and released unshifted or the other way round. All control values that might be affected by a button and all invocation sequences must be considered.

engine.setValue(group, "beatloop_activate", false);
}
}
};

// Set Crossfader Curve
MC7000.crossFaderCurve = function(control, value) {
script.crossfaderCurve(value);
Expand Down
16 changes: 8 additions & 8 deletions res/controllers/Denon-MC7000.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1645,42 +1645,42 @@
</control>
<control>
<group>[Channel1]</group>
<key>beatloop_activate</key>
<key>MC7000.autoLoop</key>
<description>AutoLoop Ch1</description>
<status>0x94</status>
<midino>0x32</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel2]</group>
<key>beatloop_activate</key>
<key>MC7000.autoLoop</key>
<description>AutoLoop Ch2</description>
<status>0x95</status>
<midino>0x32</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel3]</group>
<key>beatloop_activate</key>
<key>MC7000.autoLoop</key>
<description>AutoLoop Ch3</description>
<status>0x96</status>
<midino>0x32</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
<group>[Channel4]</group>
<key>beatloop_activate</key>
<key>MC7000.autoLoop</key>
<description>AutoLoop Ch4</description>
<status>0x97</status>
<midino>0x32</midino>
<options>
<normal/>
<script-binding/>
</options>
</control>
<control>
Expand Down