diff --git a/res/controllers/Behringer CMD PL-1.midi.xml b/res/controllers/Behringer CMD PL-1.midi.xml new file mode 100644 index 00000000000..215e6da5ffc --- /dev/null +++ b/res/controllers/Behringer CMD PL-1.midi.xml @@ -0,0 +1,75 @@ + + + + Behringer CMD PL-1 + Yann Le Doaré + Mapping for the Behringer CMD PL-1 single-deck controller + https://mixxx.discourse.group/t/behringer-cmd-pl-1/15755/2 + https://github.com/mixxxdj/mixxx/wiki/Behringer%20CMD%20PL-1 + + + + + + + + [Channel1] + play i + Play i + 0x90 i + 0x23 + + + + [Channel2] + play + Play + 0x91 + 0x23 + + + + [Channel1] + cue_default + Cue + 0x90 + 0x22 + + + [Channel2] + cue_default + Cue + 0x91 + 0x22 + + + + [Channel1] + CMDPL1.wheelTurn + 0xB0 + 0x1F + + + + [Channel2] + CMDPL1.wheelTurn + 0xB1 + 0x1F + + + + [Channel1] + CMDPL1.pitchSlider + 0xE0 + + + + [Channel2] + CMDPL1.pitchSlider + 0xE1 + + + + + + diff --git a/res/controllers/Behringer-CMD-PL-1-scripts.js b/res/controllers/Behringer-CMD-PL-1-scripts.js new file mode 100644 index 00000000000..6c56a24a900 --- /dev/null +++ b/res/controllers/Behringer-CMD-PL-1-scripts.js @@ -0,0 +1,48 @@ +var CMDPL1 = {}; + +CMDPL1.init = function() { + // mixxx --controllerDebug + //print("> Init CMDPL1 Done"); +}; + +CMDPL1.pitchSlider = function(channel, control, value, status, group) { // Lower the sensitivity of the pitch slider + const currentValue = engine.getValue(group, "rate"); + //print("> Current : "+currentValue); + //print("> value : "+value); + engine.setValue(group, "rate", (value-64)/64); +}; + +CMDPL1.wheel = function(channel, control, value, status, group) { // Lower the sensitivity of the pitch slider + const currentValue = engine.getValue(group, "rate"); + //print("> Current : "+currentValue); + //print("> value : "+value); + engine.setValue(group, "rate", currentValue+(value-64)/128); + // engine.setValue(group,"rate",(value-64)/64); +}; + +// The wheel that actually controls the scratching +CMDPL1.wheelTurn = function(channel, control, value, status, group) { + let deckNumber = script.deckFromGroup(group); + //print("> value : "+deckNumber); + + // A: For a control that centers on 0: + let newValue; + if (value < 64) { + newValue = value; + } else { + newValue = value - 128; + } + + // B: For a control that centers on 0x40 (64): + newValue = value - 64; + + // --- End choice + + // In either case, register the movement + deckNumber = script.deckFromGroup(group); + if (engine.isScratching(deckNumber)) { + engine.scratchTick(deckNumber, newValue); // Scratch! + } else { + engine.setValue(group, "jog", newValue); // Pitch bend + } +};