diff --git a/res/controllers/Hercules P32 DJ.midi.xml b/res/controllers/Hercules P32 DJ.midi.xml index 0f528f3fe57..81d4debd550 100644 --- a/res/controllers/Hercules P32 DJ.midi.xml +++ b/res/controllers/Hercules P32 DJ.midi.xml @@ -512,7 +512,7 @@ [Channel1] - P32.leftDeck.effectUnit.dryWetKnob.input + P32.leftDeck.dryWetKnobOrPregain.input 0xB1 0x09 @@ -521,7 +521,7 @@ [Channel1] - P32.leftDeck.effectUnit.dryWetKnob.input + P32.leftDeck.dryWetKnobOrPregain.input 0xB4 0x09 @@ -1548,7 +1548,7 @@ [Channel1] - P32.rightDeck.effectUnit.dryWetKnob.input + P32.rightDeck.dryWetKnobOrPregain.input 0xB2 0x09 @@ -1557,7 +1557,7 @@ [Channel1] - P32.rightDeck.effectUnit.dryWetKnob.input + P32.rightDeck.dryWetKnobOrPregain.input 0xB5 0x09 diff --git a/res/controllers/Hercules-P32-scripts.js b/res/controllers/Hercules-P32-scripts.js index fbeb36f5210..203dd920e60 100644 --- a/res/controllers/Hercules-P32-scripts.js +++ b/res/controllers/Hercules-P32-scripts.js @@ -16,6 +16,8 @@ var loopEnabledDot = false; var samplerCrossfaderAssign = true; // Toggle effect units between 1 & 3 on left and 2 & 4 on right when toggling decks var toggleEffectUnitsWithDecks = false; +// Set the dry/wet knob as a pregain +var dryWetKnobAsPregain = false; /** * Hercules P32 DJ controller script for Mixxx 2.1 @@ -378,7 +380,16 @@ P32.Deck = function(deckNumbers, channel) { this.effectUnit.knobs[1].midi = [0xB0 + channel, 0x06]; this.effectUnit.knobs[2].midi = [0xB0 + channel, 0x07]; this.effectUnit.knobs[3].midi = [0xB0 + channel, 0x08]; - this.effectUnit.dryWetKnob.midi = [0xB0 + channel, 0x09]; + if (dryWetKnobAsPregain) { + this.dryWetKnobOrPregain = new components.Pot({ + midi: [0xB0 + channel, 0x09], + group: "[Channel" + channel + "]", + inKey: "pregain", + }); + } else { + this.effectUnit.dryWetKnob.midi = [0xB0 + channel, 0x09]; + this.dryWetKnobOrPregain = this.effectUnit.dryWetKnob; + } this.effectUnit.enableButtons[1].midi = [0x90 + channel, 0x03]; this.effectUnit.enableButtons[2].midi = [0x90 + channel, 0x04]; this.effectUnit.enableButtons[3].midi = [0x90 + channel, 0x05]; diff --git a/res/controllers/common-controller-scripts.js b/res/controllers/common-controller-scripts.js index d83fde54e35..c20a54908b6 100644 --- a/res/controllers/common-controller-scripts.js +++ b/res/controllers/common-controller-scripts.js @@ -45,23 +45,19 @@ var printObject = function(obj, maxdepth) { }; var stringifyObject = function(obj, maxdepth, checked, prefix) { - if (!maxdepth) - maxdepth = 2; + if (!maxdepth) { maxdepth = 2; } try { return JSON.stringify(obj, null, maxdepth); } catch (e) { - if (!checked) - checked = []; - if (!prefix) - prefix = ""; + if (!checked) { checked = []; } + if (!prefix) { prefix = ""; } if (maxdepth > 0 && typeof obj === "object" && obj !== null && Object.getPrototypeOf(obj) !== "" && !arrayContains(checked, obj)) { checked.push(obj); var output = "{\n"; for (var property in obj) { var value = obj[property]; - if (typeof value === "function") - continue; + if (typeof value === "function") { continue; } output += prefix + property + ": " + stringifyObject(value, maxdepth - 1, checked, prefix + " ") + "\n"; @@ -74,8 +70,7 @@ var stringifyObject = function(obj, maxdepth, checked, prefix) { var arrayContains = function(array, elem) { for (var i = 0; i < array.length; i++) { - if (array[i] === elem) - return true; + if (array[i] === elem) { return true; } } return false; }; @@ -98,8 +93,7 @@ var msecondstominutes = function(msecs) { var secs = (msecs / 1000) | 0; msecs %= 1000; msecs = Math.round(msecs * 100 / 1000); - if (msecs === 100) - msecs = 99; + if (msecs === 100) { msecs = 99; } return (m < 10 ? "0" + m : m) + ":" @@ -351,6 +345,17 @@ script.crossfaderCurve = function(value, min, max) { } }; +/* -------- ------------------------------------------------------ + script.posMod + Purpose: Computes the euclidean modulo of m % n. The result is always + in the range [0, m[ + Input: dividend `a` and divisor `m` for modulo (a % m) + Output: positive remainder + -------- ------------------------------------------------------ */ +script.posMod = function(a, m) { + return ((a % m) + m) % m; +}; + /* -------- ------------------------------------------------------ script.loopMove Purpose: Moves the current loop by the specified number of beats (default 1/2) @@ -361,7 +366,7 @@ script.crossfaderCurve = function(value, min, max) { Output: none -------- ------------------------------------------------------ */ script.loopMove = function(group, direction, numberOfBeats) { - if (!numberOfBeats || numberOfBeats === 0) numberOfBeats = 0.5; + if (!numberOfBeats || numberOfBeats === 0) { numberOfBeats = 0.5; } if (direction < 0) { engine.setValue(group, "loop_move", -numberOfBeats); @@ -495,7 +500,7 @@ bpm.tapButton = function(deck) { bpm.previousTapDelta = tapDelta; bpm.tap.push(60 / tapDelta); // Keep the last 8 samples for averaging - if (bpm.tap.length > 8) bpm.tap.shift(); + if (bpm.tap.length > 8) { bpm.tap.shift(); } var sum = 0; for (var i=0; i diff --git a/res/skins/Tango/graphics/vumeter_clipping_over.png b/res/skins/Tango/graphics/vumeter_clipping_over.png deleted file mode 100644 index c1199eb0e05..00000000000 Binary files a/res/skins/Tango/graphics/vumeter_clipping_over.png and /dev/null differ diff --git a/res/skins/Tango/graphics/vumeter_clipping_over.svg b/res/skins/Tango/graphics/vumeter_clipping_over.svg deleted file mode 100644 index 0101bd4a2ef..00000000000 --- a/res/skins/Tango/graphics/vumeter_clipping_over.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/res/skins/Tango/graphics/vumeter_level.png b/res/skins/Tango/graphics/vumeter_level.png index 4a610422dbb..d6fe2361f82 100644 Binary files a/res/skins/Tango/graphics/vumeter_level.png and b/res/skins/Tango/graphics/vumeter_level.png differ diff --git a/res/skins/Tango/graphics/vumeter_level.svg b/res/skins/Tango/graphics/vumeter_level.svg index 1e59fd29507..07fdc7ed8e9 100644 --- a/res/skins/Tango/graphics/vumeter_level.svg +++ b/res/skins/Tango/graphics/vumeter_level.svg @@ -1 +1,57 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/skins/Tango/graphics/vumeter_level_over.png b/res/skins/Tango/graphics/vumeter_level_over.png index 389574ba821..c00ea67de76 100644 Binary files a/res/skins/Tango/graphics/vumeter_level_over.png and b/res/skins/Tango/graphics/vumeter_level_over.png differ diff --git a/res/skins/Tango/graphics/vumeter_level_over.svg b/res/skins/Tango/graphics/vumeter_level_over.svg index 8cbd579f8cd..ba73becfe31 100644 --- a/res/skins/Tango/graphics/vumeter_level_over.svg +++ b/res/skins/Tango/graphics/vumeter_level_over.svg @@ -1 +1,62 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/skins/Tango/graphics/vumeter_mini_clipping.png b/res/skins/Tango/graphics/vumeter_mini_clipping.png deleted file mode 100644 index b60c3eaba55..00000000000 Binary files a/res/skins/Tango/graphics/vumeter_mini_clipping.png and /dev/null differ diff --git a/res/skins/Tango/graphics/vumeter_mini_clipping.svg b/res/skins/Tango/graphics/vumeter_mini_clipping.svg deleted file mode 100644 index d14b618e951..00000000000 --- a/res/skins/Tango/graphics/vumeter_mini_clipping.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/res/skins/Tango/graphics/vumeter_mini_clipping_over.png b/res/skins/Tango/graphics/vumeter_mini_clipping_over.png index 12d26666216..d91f4909125 100644 Binary files a/res/skins/Tango/graphics/vumeter_mini_clipping_over.png and b/res/skins/Tango/graphics/vumeter_mini_clipping_over.png differ diff --git a/res/skins/Tango/graphics/vumeter_mini_clipping_over.svg b/res/skins/Tango/graphics/vumeter_mini_clipping_over.svg deleted file mode 100644 index baefa0392b8..00000000000 --- a/res/skins/Tango/graphics/vumeter_mini_clipping_over.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/res/skins/Tango/graphics/vumeter_mini_level.png b/res/skins/Tango/graphics/vumeter_mini_level.png index d8bca475bf1..c02aa50401d 100644 Binary files a/res/skins/Tango/graphics/vumeter_mini_level.png and b/res/skins/Tango/graphics/vumeter_mini_level.png differ diff --git a/res/skins/Tango/graphics/vumeter_mini_level.svg b/res/skins/Tango/graphics/vumeter_mini_level.svg deleted file mode 100644 index a33a4a23de5..00000000000 --- a/res/skins/Tango/graphics/vumeter_mini_level.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/res/skins/Tango/mic_aux_sampler/aux_unit.xml b/res/skins/Tango/mic_aux_sampler/aux_unit.xml index ff149326f8d..97a165506ac 100644 --- a/res/skins/Tango/mic_aux_sampler/aux_unit.xml +++ b/res/skins/Tango/mic_aux_sampler/aux_unit.xml @@ -44,7 +44,7 @@ Variables: 3f,1min 1f,1min diff --git a/res/skins/Tango/mic_aux_sampler/mic_unit.xml b/res/skins/Tango/mic_aux_sampler/mic_unit.xml index 8ac8ae1c76f..08e35ed8d61 100644 --- a/res/skins/Tango/mic_aux_sampler/mic_unit.xml +++ b/res/skins/Tango/mic_aux_sampler/mic_unit.xml @@ -48,7 +48,7 @@ Variables: 1f,1min diff --git a/res/skins/Tango/mic_aux_sampler/sampler.xml b/res/skins/Tango/mic_aux_sampler/sampler.xml index 216e1451b59..2c4889d521d 100644 --- a/res/skins/Tango/mic_aux_sampler/sampler.xml +++ b/res/skins/Tango/mic_aux_sampler/sampler.xml @@ -226,7 +226,7 @@ Variables: 1f,0min diff --git a/res/skins/Tango/mixer/vumeter_mini.xml b/res/skins/Tango/mixer/vumeter_mini.xml index e8a8a22c8dd..789fe8f5390 100644 --- a/res/skins/Tango/mixer/vumeter_mini.xml +++ b/res/skins/Tango/mixer/vumeter_mini.xml @@ -10,10 +10,11 @@ Refer to https://github.com/mixxxdj/mixxx/issues/9201 -->