Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.5' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Aug 29, 2024
2 parents 1dc2119 + ed79ceb commit 2a59f9d
Show file tree
Hide file tree
Showing 57 changed files with 731 additions and 425 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ jobs:
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://weu.codesigning.azure.net/
code-signing-account-name: mixxx
trusted-signing-account-name: mixxx
certificate-profile-name: mixxx
files-folder: build
files-folder-filter: exe
Expand Down Expand Up @@ -377,7 +377,7 @@ jobs:
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://weu.codesigning.azure.net/
code-signing-account-name: mixxx
trusted-signing-account-name: mixxx
certificate-profile-name: mixxx
files-folder: build
files-folder-filter: msi
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,7 @@ add_executable(mixxx-test
src/test/trackdao_test.cpp
src/test/trackexport_test.cpp
src/test/trackmetadata_test.cpp
src/test/trackmetadataexport_test.cpp
src/test/tracknumberstest.cpp
src/test/trackreftest.cpp
src/test/trackupdate_test.cpp
Expand Down
44 changes: 32 additions & 12 deletions res/controllers/Denon-MC7000-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,26 @@ MC7000.scratchParams = {
beta: (1.0/10)/32
};

// Sensitivity factor of the jog wheel (also depends on audio latency)
// 0.5 for half, 2 for double sensitivity - Recommendation:
// set to 0.5 with audio buffer set to 50ms
// set to 1 with audio buffer set to 25ms
// set to 3 with audio buffer set to 5ms
MC7000.jogSensitivity = 1;

// Jog wheel parameters
MC7000.jogParams = {
// Sensitivity factor of the jog wheel (also depends on audio latency)
// 0.5 for half, 2 for double sensitivity - Recommendation:
// set to 0.5 with audio buffer set to 50ms
// set to 1 with audio buffer set to 25ms
// set to 3 with audio buffer set to 5ms
sensitivity: engine.getSetting("jogSensitivity") || 1,
// Acceleration settings for the jog wheel in vinyl mode
// If enabled, the track speed will accelerate faster than the physical jogwheel movement. Be aware that the absolute track position will drift relative to the jogwheel position in this mode!
// (exponent: 0 and coefficient: 1 = no acceleration)
acceleration: {
// Toggles acceleration entirely.
enabled: engine.getSetting("jogAccelerationEnabled") || false,
// Acceleration function exponent
exponent: engine.getSetting("jogAccelerationExponent") || 0.8,
// Acceleration function scaling factor
coefficient: engine.getSetting("jogAccelerationCoefficient") || 1
}
};

/*/////////////////////////////////
// USER VARIABLES END //
Expand Down Expand Up @@ -705,7 +718,8 @@ MC7000.wheelTurn = function(channel, control, value, status, group) {

// A: For a control that centers on 0:
const numTicks = (value < 0x64) ? value : (value - 128);
const adjustedSpeed = numTicks * MC7000.jogSensitivity / 10;
const baseSpeed = numTicks * MC7000.jogParams.sensitivity;
const adjustedSpeed = baseSpeed / 10;
const deckNumber = script.deckFromGroup(group);
const deckIndex = deckNumber - 1;
const libraryMaximized = engine.getValue("[Skin]", "show_maximized_library");
Expand All @@ -714,8 +728,14 @@ MC7000.wheelTurn = function(channel, control, value, status, group) {
} else if (libraryMaximized === 1 && numTicks < 0) {
engine.setValue("[Library]", "MoveUp", 1);
} else if (engine.isScratching(deckNumber)) {
// Scratch!
engine.scratchTick(deckNumber, numTicks * MC7000.jogSensitivity);
// Scratch!
let scratchSpeed = baseSpeed;
const acceleration = MC7000.jogParams.acceleration;
if (acceleration && acceleration.enabled) {
const accelerationFactor = Math.pow(Math.abs(baseSpeed), acceleration.exponent) * acceleration.coefficient;
scratchSpeed *= accelerationFactor;
}
engine.scratchTick(deckNumber, scratchSpeed);
} else {
if (MC7000.shift[deckIndex]) {
// While Shift Button pressed -> Search through track
Expand Down Expand Up @@ -936,7 +956,7 @@ MC7000.censor = function(channel, control, value, status, group) {
MC7000.StarsDown = function(channel, control, value, status, group) {
const deckNumber = script.deckFromGroup(group);
const deckIndex = deckNumber - 1;
if (value >= 0x00) {
if (value > 0x00) {
if (MC7000.PADMode[deckIndex] === "Pitch") {
for (let padIdx = 0; padIdx < 8; padIdx++) {
MC7000.halftoneToPadMap[deckIndex][padIdx] = MC7000.halftoneToPadMap[deckIndex][padIdx] - 8; // pitch down
Expand All @@ -950,7 +970,7 @@ MC7000.StarsDown = function(channel, control, value, status, group) {
MC7000.StarsUp = function(channel, control, value, status, group) {
const deckNumber = script.deckFromGroup(group);
const deckIndex = deckNumber - 1;
if (value >= 0x00) {
if (value > 0x00) {
if (MC7000.PADMode[deckIndex] === "Pitch") {
for (let padIdx = 0; padIdx < 8; padIdx++) {
MC7000.halftoneToPadMap[deckIndex][padIdx] = MC7000.halftoneToPadMap[deckIndex][padIdx] + 8; // pitch up
Expand Down
57 changes: 57 additions & 0 deletions res/controllers/Denon-MC7000.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,63 @@
<wiki>https://github.com/mixxxdj/mixxx/wiki/Denon-MC7000</wiki>
<manual>denon_mc7000</manual>
</info>
<settings>
<group label="Jogwheels">
<group label="General">
<option
variable="jogSensitivity"
type="real"
min="0.05"
max="10.0"
default="1.0"
label="Jogwheel sensitivity">
<description>
Sensitivity factor of the jog wheel (also depends on audio latency)
0.5 for half, 2 for double sensitivity - Recommendation:
set to 0.5 with audio buffer set to 50ms
set to 1 with audio buffer set to 25ms
set to 3 with audio buffer set to 5ms
</description>
</option>
</group>
<group label="Acceleration">
<option
variable="jogAccelerationEnabled"
type="boolean"
default="false"
label="Enable jogwheel acceleration">
<description>
If enabled, the track speed will accelerate faster than the physical jogwheel movement. Be aware that the absolute track position will drift relative to the jogwheel position in this mode!
(exponent: 0 and coefficient: 1 = no acceleration)
</description>
</option>
<option
variable="jogAccelerationExponent"
type="real"
min="0"
max="20.0"
default="0.8"
step="0.1"
label="Acceleration exponent">
<description>
The exponent of the acceleration curve
</description>
</option>
<option
variable="jogAccelerationCoefficient"
type="real"
min="0.05"
max="20.0"
step="0.1"
default="1.0"
label="Acceleration coefficient">
<description>
The scaling factor of the acceleration curve
</description>
</option>
</group>
</group>
</settings>
<controller id="DENON MC7000">
<scriptfiles>
<file filename="Denon-MC7000-scripts.js" functionprefix="MC7000"/>
Expand Down
Loading

0 comments on commit 2a59f9d

Please sign in to comment.