diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2021-03-29 20:32:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 20:32:50 +0200 |
commit | 70c263f4ae2b4f99ccbcc152cc4bd6b4213edaa2 (patch) | |
tree | e619116abb473cda2de2b133e3abfd2e65fa0080 /res | |
parent | d7a5c3755dbb472bd1c75392e7b59668371eddb4 (diff) | |
parent | 849488735f003f80bd10321fb1313518422b710c (diff) |
Merge pull request #3742 from fkbreitl/ddj-200-fix
Pioneer DDJ-200: fix hotcue button release
Diffstat (limited to 'res')
-rw-r--r-- | res/controllers/Pioneer-DDJ-200-scripts.js | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/res/controllers/Pioneer-DDJ-200-scripts.js b/res/controllers/Pioneer-DDJ-200-scripts.js index e6c0f68ff6..25fc5d9700 100644 --- a/res/controllers/Pioneer-DDJ-200-scripts.js +++ b/res/controllers/Pioneer-DDJ-200-scripts.js @@ -281,22 +281,26 @@ DDJ200.cueGotoandstop = function(channel, control, value, status, group) { }; DDJ200.hotcueNActivate = function(channel, control, value, status, group) { - var vDeckNo = DDJ200.vDeckNo[script.deckFromGroup(group)]; - var vgroup = "[Channel" + vDeckNo + "]"; - var hotcue = "hotcue_" + (control + 1); - engine.setValue(vgroup, hotcue + "_activate", true); - midi.sendShortMsg(status, control, - 0x7F * engine.getValue(vgroup, hotcue + "_enabled")); - var deckNo = script.deckFromGroup(group); - midi.sendShortMsg(0x90 + deckNo - 1, 0x0B, 0x7F * - engine.getValue(vgroup, "play")); // set play LED + if (value) { // only if button pressed, not releases, i.e. value === 0 + var vDeckNo = DDJ200.vDeckNo[script.deckFromGroup(group)]; + var vgroup = "[Channel" + vDeckNo + "]"; + var hotcue = "hotcue_" + (control + 1); + engine.setValue(vgroup, hotcue + "_activate", true); + midi.sendShortMsg(status, control, + 0x7F * engine.getValue(vgroup, hotcue + "_enabled")); + var deckNo = script.deckFromGroup(group); + midi.sendShortMsg(0x90 + deckNo - 1, 0x0B, 0x7F * + engine.getValue(vgroup, "play")); // set play LED + } }; DDJ200.hotcueNClear = function(channel, control, value, status, group) { - var vDeckNo = DDJ200.vDeckNo[script.deckFromGroup(group)]; - var vgroup = "[Channel" + vDeckNo + "]"; - engine.setValue(vgroup, "hotcue_" + (control + 1) + "_clear", true); - midi.sendShortMsg(status-1, control, 0x00); // set hotcue LEDs + if (value) { // only if button pressed, not releases, i.e. value === 0 + var vDeckNo = DDJ200.vDeckNo[script.deckFromGroup(group)]; + var vgroup = "[Channel" + vDeckNo + "]"; + engine.setValue(vgroup, "hotcue_" + (control + 1) + "_clear", true); + midi.sendShortMsg(status-1, control, 0x00); // set hotcue LEDs + } }; DDJ200.pfl = function(channel, control, value, status, group) { |