Skip to content

Commit

Permalink
Merge remote-tracking branch 'mixxx/2.3' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Apr 5, 2023
2 parents d6e7553 + c0f31df commit 425ad1e
Show file tree
Hide file tree
Showing 36 changed files with 404 additions and 219 deletions.
8 changes: 4 additions & 4 deletions res/controllers/Hercules P32 DJ.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
</control>
<control>
<group>[Channel1]</group>
<key>P32.leftDeck.effectUnit.dryWetKnob.input</key>
<key>P32.leftDeck.dryWetKnobOrPregain.input</key>
<status>0xB1</status>
<midino>0x09</midino>
<options>
Expand All @@ -521,7 +521,7 @@
</control>
<control>
<group>[Channel1]</group>
<key>P32.leftDeck.effectUnit.dryWetKnob.input</key>
<key>P32.leftDeck.dryWetKnobOrPregain.input</key>
<status>0xB4</status>
<midino>0x09</midino>
<options>
Expand Down Expand Up @@ -1548,7 +1548,7 @@
</control>
<control>
<group>[Channel1]</group>
<key>P32.rightDeck.effectUnit.dryWetKnob.input</key>
<key>P32.rightDeck.dryWetKnobOrPregain.input</key>
<status>0xB2</status>
<midino>0x09</midino>
<options>
Expand All @@ -1557,7 +1557,7 @@
</control>
<control>
<group>[Channel1]</group>
<key>P32.rightDeck.effectUnit.dryWetKnob.input</key>
<key>P32.rightDeck.dryWetKnobOrPregain.input</key>
<status>0xB5</status>
<midino>0x09</midino>
<options>
Expand Down
13 changes: 12 additions & 1 deletion res/controllers/Hercules-P32-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down
33 changes: 19 additions & 14 deletions res/controllers/common-controller-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
};
Expand All @@ -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)
+ ":"
Expand Down Expand Up @@ -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)
Expand All @@ -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);
Expand Down Expand Up @@ -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<bpm.tap.length; i++) {
sum += bpm.tap[i];
Expand Down
Binary file removed res/skins/Tango/graphics/vumeter_clipping.png
Binary file not shown.
1 change: 0 additions & 1 deletion res/skins/Tango/graphics/vumeter_clipping.svg

This file was deleted.

Binary file removed res/skins/Tango/graphics/vumeter_clipping_over.png
Binary file not shown.
1 change: 0 additions & 1 deletion res/skins/Tango/graphics/vumeter_clipping_over.svg

This file was deleted.

Binary file modified res/skins/Tango/graphics/vumeter_level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 57 additions & 1 deletion res/skins/Tango/graphics/vumeter_level.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/skins/Tango/graphics/vumeter_level_over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 62 additions & 1 deletion res/skins/Tango/graphics/vumeter_level_over.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed res/skins/Tango/graphics/vumeter_mini_clipping.png
Binary file not shown.
2 changes: 0 additions & 2 deletions res/skins/Tango/graphics/vumeter_mini_clipping.svg

This file was deleted.

Binary file modified res/skins/Tango/graphics/vumeter_mini_clipping_over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 425ad1e

Please sign in to comment.