/usr/share/mixxx/controllers/Behringer-BCD3000-Advanced-scripts.js is in mixxx-data 2.0.0~dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | function BehringerBCD3000 () {}
//sensitivity setting
BehringerBCD3000.UseAcceleration = true;
BehringerBCD3000.JogSensivity = 0.5;
BehringerBCD3000.init = function (id) { // called when the device is opened & set up
BehringerBCD3000.reset();
// Ask BCD to send the current values of all rotary knobs and sliders
midi.sendShortMsg(0xB0,0x64,0x7F);
// Set jog acceleration
if (BehringerBCD3000.UseAcceleration)
midi.sendShortMsg(0xB0, 0x63, 0x7F);
else
midi.sendShortMsg(0xB0, 0x63, 0x0);
};
BehringerBCD3000.shutdown = function () {
BehringerBCD3000.reset();
// Reenable jog acceleration
if (!BehringerBCD3000.UseAcceleration)
midi.sendShortMsg(0xB0, 0x63, 0x7F);
};
BehringerBCD3000.reset = function (id) {
// Turn off all the lights
for (i = 0; i <= 25; i++) {
midi.sendShortMsg(0xB0, i, 0);
}
// reset global variables
BehringerBCD3000.id = id;
BehringerBCD3000.onKey = false;
BehringerBCD3000.actionKey = false;
BehringerBCD3000.keyKey = false;
BehringerBCD3000.alt = false;
BehringerBCD3000.inputA = false;
BehringerBCD3000.inputB = false;
BehringerBCD3000.scratchMode = [false, false];
BehringerBCD3000.scratchTimer = [-1, -1];
};
BehringerBCD3000.getDeck = function (group) {
if (group == "[Channel1]")
return 0;
else if (group == "[Channel2]")
return 1;
print("Invalid group : " + group);
return -1; // error
}
BehringerBCD3000.actionKey = function (value) {
if (value)
midi.sendShortMsg(0xB0, 28, 0x7F)
}
//Scratch, cue search and pitch bend function, browse
BehringerBCD3000.jogWheel = function (channel, control, value, status, group) {
deck = BehringerBCD3000.getDeck(group);
if (BehringerBCD3000.scratchMode[deck]) {
scratchValue = (value - 0x40);
engine.scratchEnable(deck + 1, 100, 33+1/3, 1.0/8, (1.0/8)/32);
engine.scratchTick(deck + 1, scratchValue);
BehringerBCD3000.scratchTimer[deck] = engine.beginTimer(20, "BehringerBCD3000.stopScratch(" + deck + ")", true);
} else if (BehringerBCD3000.onKey) {
if (value > 0x40){
engine.setValue("[Playlist]","SelectNextTrack",1);
} else {
engine.setValue("[Playlist]","SelectPrevTrack",1);
}
} else if (BehringerBCD3000.actionKey) {
if (value > 0x40){
engine.setValue("[Playlist]","SelectNextTrack",1);
} else {
engine.setValue("[Playlist]","SelectPrevTrack",1);
}
} else {
jogValue = (value - 0x40) * BehringerBCD3000.JogSensivity;
engine.setValue(group, "jog", jogValue);
}
};
//Scratch button function => set scratch flag
BehringerBCD3000.scratchButton = function (channel, control, value, status, group) {
deck = BehringerBCD3000.getDeck(group);
if (value) BehringerBCD3000.scratchMode[deck] = !BehringerBCD3000.scratchMode[deck];
if (BehringerBCD3000.scratchMode[deck]) {
// Turn on the scratch light
if (!deck)
midi.sendShortMsg(0xB0, 0x13, 0x7F);
else
midi.sendShortMsg(0xB0, 0x0B, 0x7F);
} else {
// Turn off the scratch light
if (!deck)
midi.sendShortMsg(0xB0, 0x13, 0x00);
else
midi.sendShortMsg(0xB0, 0x0B, 0x00);
engine.scratchDisable(deck + 1);
}
};
// Stop scratch by timer
BehringerBCD3000.stopScratch = function(deck) {
BehringerBCD3000.scratchTimer[deck] = -1;
engine.scratchDisable(deck + 1);
}
//Set loop function
BehringerBCD3000.loop = function (channel, control, value, status, group) {
if (value)
action = "loop_in";
else
action = "loop_out";
engine.setValue(group, action, 1);
};
//On button function
BehringerBCD3000.On = function (channel, control, value, status, group) {
if (BehringerBCD3000.actionKey){
BehringerBCD3000.actionKey = false;
midi.sendShortMsg(0xB0, 0x3, 0x00);
}
deck = BehringerBCD3000.getDeck(group);
if (value) BehringerBCD3000.onKey = !BehringerBCD3000.onKey;
if (BehringerBCD3000.onKey) {
// Turn on the On light
midi.sendShortMsg(0xB0, 0x6, 0x7F);
} else {
// Turn off the On light
midi.sendShortMsg(0xB0, 0x6, 0x00);
engine.setValue("[Channel1]","LoadSelectedTrack",1);
};
};
//Action button function
BehringerBCD3000.Action = function (channel, control, value, status, group) {
if (BehringerBCD3000.onKey){
BehringerBCD3000.onKey = false;
midi.sendShortMsg(0xB0, 0x6, 0x00);
}
deck = BehringerBCD3000.getDeck(group);
if (value) BehringerBCD3000.actionKey = !BehringerBCD3000.actionKey;
if (BehringerBCD3000.actionKey) {
// Turn on the Action light
midi.sendShortMsg(0xB0, 0x3, 0x7F);
} else {
// Turn off the Action light
midi.sendShortMsg(0xB0, 0x3, 0x00);
engine.setValue("[Channel2]","LoadSelectedTrack",1);
}
};
//Key button function
BehringerBCD3000.keykey = function (channel, control, value, status, group) {
// toggle "alt" flag
if (value) BehringerBCD3000.alt = !BehringerBCD3000.alt;
if (BehringerBCD3000.alt) {
// Turn on the Key light
midi.sendShortMsg(0xB0, 0x19, 0x7F);
engine.setValue("[Channel1]","keylock",1);
engine.setValue("[Channel2]","keylock",1);
} else {
// Turn off the Key light
midi.sendShortMsg(0xB0, 0x19, 0x00);
engine.setValue("[Channel1]","keylock",0);
engine.setValue("[Channel2]","keylock",0);
}
};
//Ext-A button function
//BehringerBCD3000.extakey = function (channel, control, value, status, group) {
// // toggle inputA flag
// if (value) BehringerBCD3000.inputA = !BehringerBCD3000.inputA;
// if (BehringerBCD3000.inputA) {
// // Turn on the Key light
// midi.sendShortMsg(0xB0, 0x08, 0x7F);
// } else {
// // Turn off the Key light
// midi.sendShortMsg(0xB0, 0x08, 0x00);
// }
//};
//Ext-B button function
//BehringerBCD3000.extbkey = function (channel, control, value, status, group) {
// // toggle inputB flag
// if (value) BehringerBCD3000.inputB = !BehringerBCD3000.inputB;
// if (BehringerBCD3000.inputB) {
// // Turn on the Key light
// midi.sendShortMsg(0xB0, 0x07, 0x7F);
// } else {
// // Turn off the Key light
// midi.sendShortMsg(0xB0, 0x07, 0x00);
// }
//};
|