-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Denon MC7000: Handle autoloop button in script #4307
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -513,9 +513,9 @@ MC7000.PadButtons = function(channel, control, value, status, group) { | |
| } | ||
| } | ||
| } else if (MC7000.PADModeCueLoop[deckNumber]) { | ||
| return; | ||
| // TODO | ||
| } 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; | ||
|
|
@@ -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) { | ||
|
|
@@ -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 | ||
| } | ||
| }; | ||
|
|
||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 How about setting 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); | ||
|
|
||
There was a problem hiding this comment.
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.