Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denon MC7000 improvements #4021

Merged
merged 16 commits into from
Sep 25, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 28 additions & 20 deletions res/controllers/Denon-MC7000-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,48 @@ var MC7000 = {};
// 1) Beat LED in Slicer mode (counts every 8 beats AFTER the CUE point)
// only works for CONSTANT TEMPO tracks
// needs beat grid and CUE point set
MC7000.experimental = false; // default: false
MC7000.experimental = false;

// Wanna have Needle Search active while playing a track ?
// In any case Needle Search is available holding "SHIFT" down.
// can be true or false (recommended: false)
MC7000.needleSearchPlay = false; // default: false
// can be true or false
MC7000.needleSearchPlay = false;

// select if the previous sampler shall stop before a new sampler starts
// true: a running sampler will stop before the new sampler starts
// false: all triggered samplers will play simultaneously
MC7000.prevSamplerStop = true; // default: true
MC7000.prevSamplerStop = true;

// Set Vinyl Mode on ("true") or off ("false") when MIXXX starts.
// This sets the Jog Wheel touch detection / Vinyl Mode
// and the Jog LEDs ("VINYL" on = spinny, "VINYL" off = track position).
MC7000.VinylModeOn = true; // default: true
MC7000.VinylModeOn = true;

// Possible pitchfader rate ranges given in percent.
// can be cycled through by the RANGE buttons.
// All default values are the same as selectable in Mixxx Preferences
MC7000.rateRanges = [
4/100, // default: 4/100
6/100, // default: 6/100
8/100, // default: 8/100
10/100, // default: 10/100
16/100, // default: 16/100
24/100, // default: 24/100
50/100, // default: 50/100
90/100, // default: 90/100
4/100,
6/100,
8/100,
10/100,
16/100,
24/100,
50/100,
90/100,
];

// Platter Ring LED mode
// Mode 0 = Single "off" LED chase (all others "on")
// Mode 1 = Single "on" LED chase (all others "off")
// use "SHIFT" + "DECK #" to toggle between both modes
MC7000.modeSingleLED = 1; // default: 1
MC7000.modeSingleLED = 1;

// Scratch algorithm parameters
MC7000.scratchParams = {
recordSpeed: 33 + 1/3, // default: 33 + 1/3
alpha: (1.0/10), // default: (1.0/10)
beta: (1.0/10)/32 // default: (1.0/10)/32
recordSpeed: 33 + 1/3,
alpha: (1.0/10),
beta: (1.0/10)/32
};

// Sensitivity factor of the jog wheel (also depends on audio latency)
Expand Down Expand Up @@ -653,19 +653,22 @@ MC7000.loadButton = function(channel, control, value, status, group) {
MC7000.wheelTouch = function(channel, control, value, status, group) {
var deckNumber = script.deckFromGroup(group);
var deckOffset = deckNumber - 1;
if (MC7000.isVinylMode[deckOffset]) {
var maxLibrary = engine.getValue("[Master]", "maximize_library");
if (MC7000.isVinylMode[deckOffset] && maxLibrary === 0) {
toszlanyi marked this conversation as resolved.
Show resolved Hide resolved
if (value === 0x7F) {
engine.scratchEnable(deckNumber, MC7000.jogWheelTicksPerRevolution,
MC7000.scratchParams.recordSpeed,
MC7000.scratchParams.alpha,
MC7000.scratchParams.beta);
} else {
engine.scratchDisable(deckNumber);
if (engine.getValue(group, "slip_enabled")) {
engine.scratchDisable(deckNumber, false); // stops scratching immediately
engine.setValue(group, "slip_enabled", false);
engine.beginTimer(50, function() {
engine.setValue(group, "slip_enabled", true);
}, true);
} else {
engine.scratchDisable(deckNumber); // continues scratching e.g. for backspin
}
}
}
Expand All @@ -681,7 +684,12 @@ MC7000.wheelTurn = function(channel, control, value, status, group) {
var adjustedSpeed = numTicks * MC7000.jogSensitivity / 10;
var deckNumber = script.deckFromGroup(group);
var deckOffset = deckNumber - 1;
if (engine.isScratching(deckNumber)) {
var maxLibrary = engine.getValue("[Master]", "maximize_library");
if (maxLibrary === 1 && numTicks > 0) {
engine.setValue("[Library]", "MoveDown", 1);
} else if (maxLibrary === 1 && numTicks < 0) {
engine.setValue("[Library]", "MoveUp", 1);
} else if (engine.isScratching(deckNumber)) {
// Scratch!
engine.scratchTick(deckNumber, numTicks * MC7000.jogSensitivity);
} else {
Expand Down