diff --git a/res/controllers/Pioneer-DDJ-SB2-scripts.js b/res/controllers/Pioneer-DDJ-SB2-scripts.js index 5163436cf3d..6e5a95fa44e 100644 --- a/res/controllers/Pioneer-DDJ-SB2-scripts.js +++ b/res/controllers/Pioneer-DDJ-SB2-scripts.js @@ -15,8 +15,8 @@ PioneerDDJSB2.invertVinylSlipButton = false; // the beginning of the track and stops playback. PioneerDDJSB2.reverseRollOnShiftCue = false; -// Sets the jogwheels sensivity. 1 is default, 2 is twice as sensitive, 0.5 is half as sensitive. -PioneerDDJSB2.jogwheelSensivity = 1.0; +// Sets the jogwheels sensitivity. 1 is default, 2 is twice as sensitive, 0.5 is half as sensitive. +PioneerDDJSB2.jogwheelSensitivity = 1.0; // Sets how much more sensitive the jogwheels get when holding shift. // Set to 1 to disable jogwheel sensitivity increase when holding shift. @@ -93,7 +93,7 @@ PioneerDDJSB2.jumpPreviewPosition = 0.5; PioneerDDJSB2.longButtonPress = false; PioneerDDJSB2.speedRateToNormalTimer = new Array(4); -PioneerDDJSB2.init = function(id) { +PioneerDDJSB2.init = function(_id) { PioneerDDJSB2.deck = []; PioneerDDJSB2.deck[1] = new PioneerDDJSB2.Deck(1); PioneerDDJSB2.deck[2] = new PioneerDDJSB2.Deck(2); @@ -105,25 +105,25 @@ PioneerDDJSB2.init = function(id) { PioneerDDJSB2.effectUnit[2] = new PioneerDDJSB2.EffectUnit(2); PioneerDDJSB2.scratchSettings = { - 'alpha': 1.0 / 8, - 'beta': 1.0 / 8 / 32, - 'jogResolution': 720, - 'vinylSpeed': 33 + 1 / 3, - 'safeScratchTimeout': 20 + "alpha": 1.0 / 8, + "beta": 1.0 / 8 / 32, + "jogResolution": 720, + "vinylSpeed": 33 + 1 / 3, + "safeScratchTimeout": 20 }; PioneerDDJSB2.channelGroups = { - '[Channel1]': 0x00, - '[Channel2]': 0x01, - '[Channel3]': 0x02, - '[Channel4]': 0x03 + "[Channel1]": 0x00, + "[Channel2]": 0x01, + "[Channel3]": 0x02, + "[Channel4]": 0x03 }; PioneerDDJSB2.samplerGroups = { - '[Sampler1]': 0x00, - '[Sampler2]': 0x01, - '[Sampler3]': 0x02, - '[Sampler4]': 0x03 + "[Sampler1]": 0x00, + "[Sampler2]": 0x01, + "[Sampler3]": 0x02, + "[Sampler4]": 0x03 }; PioneerDDJSB2.shiftPressed = false; @@ -136,36 +136,36 @@ PioneerDDJSB2.init = function(id) { PioneerDDJSB2.scratchMode = [false, false, false, false]; PioneerDDJSB2.ledGroups = { - 'hotCue': 0x00, - 'autoLoop': 0x10, - 'manualLoop': 0x20, - 'sampler': 0x30 + "hotCue": 0x00, + "autoLoop": 0x10, + "manualLoop": 0x20, + "sampler": 0x30 }; PioneerDDJSB2.nonPadLeds = { - 'headphoneCue': 0x54, - 'shiftHeadphoneCue': 0x68, - 'cue': 0x0C, - 'shiftCue': 0x48, - 'keyLock': 0x1A, - 'shiftKeyLock': 0x60, - 'play': 0x0B, - 'shiftPlay': 0x47, - 'vinyl': 0x17, - 'shiftVinyl': 0x4E, - 'sync': 0x58, - 'shiftSync': 0x5C + "headphoneCue": 0x54, + "shiftHeadphoneCue": 0x68, + "cue": 0x0C, + "shiftCue": 0x48, + "keyLock": 0x1A, + "shiftKeyLock": 0x60, + "play": 0x0B, + "shiftPlay": 0x47, + "vinyl": 0x17, + "shiftVinyl": 0x4E, + "sync": 0x58, + "shiftSync": 0x5C }; PioneerDDJSB2.valueVuMeter = { - '[Channel1]_current': 0, - '[Channel2]_current': 0, - '[Channel3]_current': 0, - '[Channel4]_current': 0, - '[Channel1]_enabled': 1, - '[Channel2]_enabled': 1, - '[Channel3]_enabled': 1, - '[Channel4]_enabled': 1, + "[Channel1]_current": 0, + "[Channel2]_current": 0, + "[Channel3]_current": 0, + "[Channel4]_current": 0, + "[Channel1]_enabled": 1, + "[Channel2]_enabled": 1, + "[Channel3]_enabled": 1, + "[Channel4]_enabled": 1, }; @@ -174,10 +174,10 @@ PioneerDDJSB2.init = function(id) { PioneerDDJSB2.looprollIntervals = [1 / 16, 1 / 8, 1 / 4, 1 / 2, 1, 2, 4, 8]; PioneerDDJSB2.bindNonDeckControlConnections(false); - PioneerDDJSB2.initDeck('[Channel1]'); - PioneerDDJSB2.initDeck('[Channel2]'); - PioneerDDJSB2.initDeck('[Channel3]'); - PioneerDDJSB2.initDeck('[Channel4]'); + PioneerDDJSB2.initDeck("[Channel1]"); + PioneerDDJSB2.initDeck("[Channel2]"); + PioneerDDJSB2.initDeck("[Channel3]"); + PioneerDDJSB2.initDeck("[Channel4]"); if (PioneerDDJSB2.twinkleVumeterAutodjOn) { PioneerDDJSB2.vu_meter_timer = engine.beginTimer(100, "PioneerDDJSB2.vuMeterTwinkle()"); @@ -187,11 +187,11 @@ PioneerDDJSB2.init = function(id) { midi.sendShortMsg(0x9B, 0x09, 0x7f); }; -PioneerDDJSB2.Deck = function (deckNumber) { +PioneerDDJSB2.Deck = function(deckNumber) { var theDeck = this; - this.group = '[Channel' + deckNumber + ']'; + this.group = "[Channel" + deckNumber + "]"; - this.shiftButton = function (channel, control, value, status, group) { + this.shiftButton = function(channel, control, value, _status, _group) { if (value > 0) { theDeck.shift(); PioneerDDJSB2.shiftPressed = true; @@ -230,16 +230,16 @@ PioneerDDJSB2.Deck = function (deckNumber) { } this.gainKnob = new components.Pot({ - unshift: function () { - this.group = '[Channel' + deckNumber + ']'; - this.inKey = 'pregain'; + unshift: function() { + this.group = "[Channel" + deckNumber + "]"; + this.inKey = "pregain"; this.disconnect(); this.connect(); }, - shift: function () { - var focusedEffect = engine.getValue('[EffectRack1_EffectUnit' + effectUnitNumber + ']', 'focused_effect'); - this.group = '[EffectRack1_EffectUnit' + effectUnitNumber + '_Effect' + focusedEffect + ']'; - this.inKey = 'parameter1'; + shift: function() { + var focusedEffect = engine.getValue("[EffectRack1_EffectUnit" + effectUnitNumber + "]", "focused_effect"); + this.group = "[EffectRack1_EffectUnit" + effectUnitNumber + "_Effect" + focusedEffect + "]"; + this.inKey = "parameter1"; this.disconnect(); this.connect(); }, @@ -249,16 +249,16 @@ PioneerDDJSB2.Deck = function (deckNumber) { for (var k = 1; k <= 3; k++) { this.eqKnob[k] = new components.Pot({ number: k, - unshift: function () { - this.group = '[EqualizerRack1_[Channel' + deckNumber + ']_Effect1]'; - this.inKey = 'parameter' + this.number; + unshift: function() { + this.group = "[EqualizerRack1_[Channel" + deckNumber + "]_Effect1]"; + this.inKey = "parameter" + this.number; this.disconnect(); this.connect(); }, - shift: function () { - var focusedEffect = engine.getValue('[EffectRack1_EffectUnit' + effectUnitNumber + ']', 'focused_effect'); - this.group = '[EffectRack1_EffectUnit' + effectUnitNumber + '_Effect' + focusedEffect + ']'; - this.inKey = 'parameter' + (5 - this.number); + shift: function() { + var focusedEffect = engine.getValue("[EffectRack1_EffectUnit" + effectUnitNumber + "]", "focused_effect"); + this.group = "[EffectRack1_EffectUnit" + effectUnitNumber + "_Effect" + focusedEffect + "]"; + this.inKey = "parameter" + (5 - this.number); this.disconnect(); this.connect(); }, @@ -266,24 +266,24 @@ PioneerDDJSB2.Deck = function (deckNumber) { } this.quickEffectKnob = new components.Pot({ - unshift: function () { - this.group = '[QuickEffectRack1_[Channel' + deckNumber + ']]'; - this.inKey = 'super1'; + unshift: function() { + this.group = "[QuickEffectRack1_[Channel" + deckNumber + "]]"; + this.inKey = "super1"; this.disconnect(); this.connect(); }, - shift: function () { - var focusedEffect = engine.getValue('[EffectRack1_EffectUnit' + effectUnitNumber + ']', 'focused_effect'); - this.group = '[EffectRack1_EffectUnit' + effectUnitNumber + '_Effect' + focusedEffect + ']'; - this.inKey = 'parameter5'; + shift: function() { + var focusedEffect = engine.getValue("[EffectRack1_EffectUnit" + effectUnitNumber + "]", "focused_effect"); + this.group = "[EffectRack1_EffectUnit" + effectUnitNumber + "_Effect" + focusedEffect + "]"; + this.inKey = "parameter5"; this.disconnect(); this.connect(); }, }); this.tempoFader = new components.Pot({ - inKey: 'rate', -// relative: true, + inKey: "rate", + // relative: true, invert: true, }); @@ -291,16 +291,16 @@ PioneerDDJSB2.Deck = function (deckNumber) { this.topPadRow.autoLoopLayer = new components.ComponentContainer(); this.topPadRow.autoLoopLayer.beatloopButton = new components.Button({ midi: [0x96 + deckNumber, 0x10], - unshift: function () { - this.inKey = 'beatloop_activate'; - this.outKey = 'beatloop_activate'; + unshift: function() { + this.inKey = "beatloop_activate"; + this.outKey = "beatloop_activate"; this.disconnect(); this.connect(); this.trigger(); }, - shift: function () { - this.inKey = 'beatlooproll_activate'; - this.outKey = 'beatlooproll_activate'; + shift: function() { + this.inKey = "beatlooproll_activate"; + this.outKey = "beatlooproll_activate"; this.disconnect(); this.connect(); this.trigger(); @@ -309,16 +309,16 @@ PioneerDDJSB2.Deck = function (deckNumber) { this.topPadRow.autoLoopLayer.beatloopHalveButton = new components.Button({ midi: [0x96 + deckNumber, 0x11], - unshift: function () { - this.inKey = 'loop_halve'; - this.outKey = 'loop_halve'; + unshift: function() { + this.inKey = "loop_halve"; + this.outKey = "loop_halve"; this.disconnect(); this.connect(); this.trigger(); }, - shift: function () { - this.inKey = 'beatjump_backward'; - this.outKey = 'beatjump_backward'; + shift: function() { + this.inKey = "beatjump_backward"; + this.outKey = "beatjump_backward"; this.disconnect(); this.connect(); this.trigger(); @@ -327,16 +327,16 @@ PioneerDDJSB2.Deck = function (deckNumber) { this.topPadRow.autoLoopLayer.beatloopDoubleButton = new components.Button({ midi: [0x96 + deckNumber, 0x12], - unshift: function () { - this.inKey = 'loop_double'; - this.outKey = 'loop_double'; + unshift: function() { + this.inKey = "loop_double"; + this.outKey = "loop_double"; this.disconnect(); this.connect(); this.trigger(); }, - shift: function () { - this.inKey = 'beatjump_forward'; - this.outKey = 'beatjump_forward'; + shift: function() { + this.inKey = "beatjump_forward"; + this.outKey = "beatjump_forward"; this.disconnect(); this.connect(); this.trigger(); @@ -345,22 +345,22 @@ PioneerDDJSB2.Deck = function (deckNumber) { this.topPadRow.autoLoopLayer.reloopButton = new components.Button({ midi: [0x96 + deckNumber, 0x13], - outKey: 'loop_enabled', - unshift: function () { - this.inKey = 'reloop_toggle'; + outKey: "loop_enabled", + unshift: function() { + this.inKey = "reloop_toggle"; }, - shift: function () { - this.inKey = 'reloop_andstop'; + shift: function() { + this.inKey = "reloop_andstop"; }, }); - this.topPadRow.forEachComponent(function (button) { + this.topPadRow.forEachComponent(function(button) { button.sendShifted = true; button.shiftControl = true; button.shiftOffset = 8; }); - this.forEachComponent(function (c) { + this.forEachComponent(function(c) { if (c.group === undefined) { c.group = theDeck.group; c.connect(); @@ -400,18 +400,18 @@ PioneerDDJSB2.longButtonPressWait = function() { }; PioneerDDJSB2.speedRateToNormal = function(group, deck) { - var speed = engine.getValue(group, 'rate'); + var speed = engine.getValue(group, "rate"); if (speed > 0) { - engine.setValue(group, 'rate_perm_down_small', true); - if (engine.getValue(group, 'rate') <= 0) { + engine.setValue(group, "rate_perm_up_small", true); + if (engine.getValue(group, "rate") <= 0) { engine.stopTimer(PioneerDDJSB2.speedRateToNormalTimer[deck]); - engine.setValue(group, 'rate', 0); + engine.setValue(group, "rate", 0); } } else if (speed < 0) { - engine.setValue(group, 'rate_perm_up_small', true); - if (engine.getValue(group, 'rate') >= 0) { + engine.setValue(group, "rate_perm_down_small", true); + if (engine.getValue(group, "rate") >= 0) { engine.stopTimer(PioneerDDJSB2.speedRateToNormalTimer[deck]); - engine.setValue(group, 'rate', 0); + engine.setValue(group, "rate", 0); } } }; @@ -430,34 +430,34 @@ PioneerDDJSB2.vuMeterTwinkle = function() { PioneerDDJSB2.blinkAutodjState = 0; } if (PioneerDDJSB2.blinkAutodjState === 0) { - PioneerDDJSB2.valueVuMeter['[Channel1]_enabled'] = 0; - PioneerDDJSB2.valueVuMeter['[Channel3]_enabled'] = 0; - PioneerDDJSB2.valueVuMeter['[Channel2]_enabled'] = 0; - PioneerDDJSB2.valueVuMeter['[Channel4]_enabled'] = 0; + PioneerDDJSB2.valueVuMeter["[Channel1]_enabled"] = 0; + PioneerDDJSB2.valueVuMeter["[Channel3]_enabled"] = 0; + PioneerDDJSB2.valueVuMeter["[Channel2]_enabled"] = 0; + PioneerDDJSB2.valueVuMeter["[Channel4]_enabled"] = 0; } if (PioneerDDJSB2.blinkAutodjState === 1) { - PioneerDDJSB2.valueVuMeter['[Channel1]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel3]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel2]_enabled'] = 0; - PioneerDDJSB2.valueVuMeter['[Channel4]_enabled'] = 0; + PioneerDDJSB2.valueVuMeter["[Channel1]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel3]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel2]_enabled"] = 0; + PioneerDDJSB2.valueVuMeter["[Channel4]_enabled"] = 0; } if (PioneerDDJSB2.blinkAutodjState === 2) { - PioneerDDJSB2.valueVuMeter['[Channel1]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel3]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel2]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel4]_enabled'] = 1; + PioneerDDJSB2.valueVuMeter["[Channel1]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel3]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel2]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel4]_enabled"] = 1; } if (PioneerDDJSB2.blinkAutodjState === 3) { - PioneerDDJSB2.valueVuMeter['[Channel1]_enabled'] = 0; - PioneerDDJSB2.valueVuMeter['[Channel3]_enabled'] = 0; - PioneerDDJSB2.valueVuMeter['[Channel2]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel4]_enabled'] = 1; + PioneerDDJSB2.valueVuMeter["[Channel1]_enabled"] = 0; + PioneerDDJSB2.valueVuMeter["[Channel3]_enabled"] = 0; + PioneerDDJSB2.valueVuMeter["[Channel2]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel4]_enabled"] = 1; } } else { - PioneerDDJSB2.valueVuMeter['[Channel1]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel3]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel2]_enabled'] = 1; - PioneerDDJSB2.valueVuMeter['[Channel4]_enabled'] = 1; + PioneerDDJSB2.valueVuMeter["[Channel1]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel3]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel2]_enabled"] = 1; + PioneerDDJSB2.valueVuMeter["[Channel4]_enabled"] = 1; } }; @@ -466,7 +466,7 @@ PioneerDDJSB2.vuMeterTwinkle = function() { // AutoDJ // /////////////////////////////////////////////////////////////// -PioneerDDJSB2.autodjSkipNext = function(channel, control, value, status, group) { +PioneerDDJSB2.autodjSkipNext = function(channel, control, value, _status, _group) { if (value === 0) { return; } @@ -475,7 +475,7 @@ PioneerDDJSB2.autodjSkipNext = function(channel, control, value, status, group) } }; -PioneerDDJSB2.autodjToggle = function(channel, control, value, status, group) { +PioneerDDJSB2.autodjToggle = function(channel, control, value, _status, _group) { if (value === 0) { return; } @@ -492,34 +492,34 @@ PioneerDDJSB2.autodjToggle = function(channel, control, value, status, group) { /////////////////////////////////////////////////////////////// PioneerDDJSB2.bindSamplerControlConnections = function(samplerGroup, isUnbinding) { - engine.connectControl(samplerGroup, 'duration', 'PioneerDDJSB2.samplerLeds', isUnbinding); + engine.connectControl(samplerGroup, "duration", "PioneerDDJSB2.samplerLeds", isUnbinding); }; PioneerDDJSB2.bindDeckControlConnections = function(channelGroup, isUnbinding) { var i, index, controlsToFunctions = { - 'pfl': 'PioneerDDJSB2.headphoneCueLed', - 'keylock': 'PioneerDDJSB2.keyLockLed', - 'loop_in': 'PioneerDDJSB2.loopInLed', - 'loop_out': 'PioneerDDJSB2.loopOutLed', - 'filterLowKill': 'PioneerDDJSB2.lowKillLed', - 'filterMidKill': 'PioneerDDJSB2.midKillLed', - 'filterHighKill': 'PioneerDDJSB2.highKillLed', - 'mute': 'PioneerDDJSB2.muteLed', - 'loop_enabled': 'PioneerDDJSB2.loopExitLed', + "pfl": "PioneerDDJSB2.headphoneCueLed", + "keylock": "PioneerDDJSB2.keyLockLed", + "loop_in": "PioneerDDJSB2.loopInLed", + "loop_out": "PioneerDDJSB2.loopOutLed", + "filterLowKill": "PioneerDDJSB2.lowKillLed", + "filterMidKill": "PioneerDDJSB2.midKillLed", + "filterHighKill": "PioneerDDJSB2.highKillLed", + "mute": "PioneerDDJSB2.muteLed", + "loop_enabled": "PioneerDDJSB2.loopExitLed", }; if (PioneerDDJSB2.invertVinylSlipButton) { - controlsToFunctions.slip_enabled = 'PioneerDDJSB2.slipLed'; + controlsToFunctions.slip_enabled = "PioneerDDJSB2.slipLed"; } for (i = 1; i <= 8; i++) { - controlsToFunctions['hotcue_' + i + '_enabled'] = 'PioneerDDJSB2.hotCueLeds'; + controlsToFunctions["hotcue_" + i + "_enabled"] = "PioneerDDJSB2.hotCueLeds"; } for (index in PioneerDDJSB2.looprollIntervals) { - controlsToFunctions['beatlooproll_' + PioneerDDJSB2.looprollIntervals[index] + '_activate'] = 'PioneerDDJSB2.beatlooprollLeds'; + controlsToFunctions["beatlooproll_" + PioneerDDJSB2.looprollIntervals[index] + "_activate"] = "PioneerDDJSB2.beatlooprollLeds"; } script.bindConnections(channelGroup, controlsToFunctions, isUnbinding); @@ -529,17 +529,17 @@ PioneerDDJSB2.bindNonDeckControlConnections = function(isUnbinding) { var samplerIndex; for (samplerIndex = 1; samplerIndex <= 4; samplerIndex++) { - PioneerDDJSB2.bindSamplerControlConnections('[Sampler' + samplerIndex + ']', isUnbinding); + PioneerDDJSB2.bindSamplerControlConnections("[Sampler" + samplerIndex + "]", isUnbinding); } if (PioneerDDJSB2.showVumeterMaster) { - engine.connectControl('[Master]', 'VuMeterL', 'PioneerDDJSB2.VuMeterLeds', isUnbinding); - engine.connectControl('[Master]', 'VuMeterR', 'PioneerDDJSB2.VuMeterLeds', isUnbinding); + engine.connectControl("[Master]", "VuMeterL", "PioneerDDJSB2.VuMeterLeds", isUnbinding); + engine.connectControl("[Master]", "VuMeterR", "PioneerDDJSB2.VuMeterLeds", isUnbinding); } else { - engine.connectControl('[Channel1]', 'VuMeter', 'PioneerDDJSB2.VuMeterLeds', isUnbinding); - engine.connectControl('[Channel2]', 'VuMeter', 'PioneerDDJSB2.VuMeterLeds', isUnbinding); - engine.connectControl('[Channel3]', 'VuMeter', 'PioneerDDJSB2.VuMeterLeds', isUnbinding); - engine.connectControl('[Channel4]', 'VuMeter', 'PioneerDDJSB2.VuMeterLeds', isUnbinding); + engine.connectControl("[Channel1]", "VuMeter", "PioneerDDJSB2.VuMeterLeds", isUnbinding); + engine.connectControl("[Channel2]", "VuMeter", "PioneerDDJSB2.VuMeterLeds", isUnbinding); + engine.connectControl("[Channel3]", "VuMeter", "PioneerDDJSB2.VuMeterLeds", isUnbinding); + engine.connectControl("[Channel4]", "VuMeter", "PioneerDDJSB2.VuMeterLeds", isUnbinding); } }; @@ -548,11 +548,11 @@ PioneerDDJSB2.bindAllControlConnections = function(isUnbinding) { channelIndex; for (samplerIndex = 1; samplerIndex <= 4; samplerIndex++) { - PioneerDDJSB2.bindSamplerControlConnections('[Sampler' + samplerIndex + ']', isUnbinding); + PioneerDDJSB2.bindSamplerControlConnections("[Sampler" + samplerIndex + "]", isUnbinding); } for (channelIndex = 1; channelIndex <= 2; channelIndex++) { - PioneerDDJSB2.bindDeckControlConnections('[Channel' + channelIndex + ']', isUnbinding); + PioneerDDJSB2.bindDeckControlConnections("[Channel" + channelIndex + "]", isUnbinding); } }; @@ -561,18 +561,18 @@ PioneerDDJSB2.bindAllControlConnections = function(isUnbinding) { /////////////////////////////////////////////////////////////// PioneerDDJSB2.deckSwitchTable = { - '[Channel1]': '[Channel1]', - '[Channel2]': '[Channel2]', - '[Channel3]': '[Channel3]', - '[Channel4]': '[Channel4]' + "[Channel1]": "[Channel1]", + "[Channel2]": "[Channel2]", + "[Channel3]": "[Channel3]", + "[Channel4]": "[Channel4]" }; PioneerDDJSB2.deckShiftSwitchTable = { - '[Channel1]': '[Channel3]', - '[Channel2]': '[Channel4]', - '[Channel3]': '[Channel1]', - '[Channel4]': '[Channel2]' + "[Channel1]": "[Channel3]", + "[Channel2]": "[Channel4]", + "[Channel3]": "[Channel1]", + "[Channel4]": "[Channel2]" }; PioneerDDJSB2.initDeck = function(group) { @@ -587,10 +587,10 @@ PioneerDDJSB2.initDeck = function(group) { /////////////////////////////////////////////////////////////// PioneerDDJSB2.highResMSB = { - '[Channel1]': {}, - '[Channel2]': {}, - '[Channel3]': {}, - '[Channel4]': {} + "[Channel1]": {}, + "[Channel2]": {}, + "[Channel3]": {}, + "[Channel4]": {} }; PioneerDDJSB2.deckFaderMSB = function(channel, control, value, status, group) { @@ -601,33 +601,33 @@ PioneerDDJSB2.deckFaderLSB = function(channel, control, value, status, group) { var fullValue = (PioneerDDJSB2.highResMSB[group].deckFader << 7) + value; if (PioneerDDJSB2.shiftPressed && - engine.getValue(group, 'volume') === 0 && + engine.getValue(group, "volume") === 0 && fullValue !== 0 && - engine.getValue(group, 'play') === 0 + engine.getValue(group, "play") === 0 ) { - PioneerDDJSB2.chFaderStart[channel] = engine.getValue(group, 'playposition'); - engine.setValue(group, 'play', 1); + PioneerDDJSB2.chFaderStart[channel] = engine.getValue(group, "playposition"); + engine.setValue(group, "play", 1); } else if ( PioneerDDJSB2.shiftPressed && - engine.getValue(group, 'volume') !== 0 && + engine.getValue(group, "volume") !== 0 && fullValue === 0 && - engine.getValue(group, 'play') === 1 && + engine.getValue(group, "play") === 1 && PioneerDDJSB2.chFaderStart[channel] !== null ) { - engine.setValue(group, 'play', 0); - engine.setValue(group, 'playposition', PioneerDDJSB2.chFaderStart[channel]); + engine.setValue(group, "play", 0); + engine.setValue(group, "playposition", PioneerDDJSB2.chFaderStart[channel]); PioneerDDJSB2.chFaderStart[channel] = null; } - engine.setValue(group, 'volume', fullValue / 0x3FFF); + engine.setValue(group, "volume", fullValue / 0x3FFF); }; /////////////////////////////////////////////////////////////// // SINGLE MESSAGE MIDI INPUT HANDLERS // /////////////////////////////////////////////////////////////// -PioneerDDJSB2.shiftButton = function(channel, control, value, status, group) { +PioneerDDJSB2.shiftButton = function(channel, control, value, _status, _group) { var index = 0; - PioneerDDJSB2.shiftPressed = (value == 0x7F); + PioneerDDJSB2.shiftPressed = (value === 0x7F); for (index in PioneerDDJSB2.chFaderStart) { PioneerDDJSB2.chFaderStart[index] = null; } @@ -635,50 +635,50 @@ PioneerDDJSB2.shiftButton = function(channel, control, value, status, group) { PioneerDDJSB2.playButton = function(channel, control, value, status, group) { if (value) { - script.toggleControl(PioneerDDJSB2.deckSwitchTable[group], 'play'); + script.toggleControl(PioneerDDJSB2.deckSwitchTable[group], "play"); } }; PioneerDDJSB2.headphoneCueButton = function(channel, control, value, status, group) { if (value) { - script.toggleControl(group, 'pfl'); + script.toggleControl(group, "pfl"); } }; PioneerDDJSB2.headphoneShiftCueButton = function(channel, control, value, status, group) { if (value) { - script.toggleControl(PioneerDDJSB2.deckShiftSwitchTable[group], 'pfl'); + script.toggleControl(PioneerDDJSB2.deckShiftSwitchTable[group], "pfl"); } }; PioneerDDJSB2.hotCueButtons = function(channel, control, value, status, group) { var hotCueIndex = (control >= 0x40 ? control - 0x40 + 5 : control + 1); - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'hotcue_' + hotCueIndex + '_activate', value); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "hotcue_" + hotCueIndex + "_activate", value); }; PioneerDDJSB2.clearHotCueButtons = function(channel, control, value, status, group) { var hotCueIndex = (control >= 0x48 ? control - 0x48 + 5 : control - 7); if (value) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'hotcue_' + hotCueIndex + '_clear', 1); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "hotcue_" + hotCueIndex + "_clear", 1); } }; PioneerDDJSB2.cueButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'cue_default', value); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "cue_default", value); }; PioneerDDJSB2.beatloopRollButtons = function(channel, control, value, status, group) { var index = (control <= 0x53 ? control - 0x50 : control - 0x54); engine.setValue( PioneerDDJSB2.deckSwitchTable[group], - 'beatlooproll_' + PioneerDDJSB2.looprollIntervals[index] + '_activate', + "beatlooproll_" + PioneerDDJSB2.looprollIntervals[index] + "_activate", value ); }; PioneerDDJSB2.vinylButton = function(channel, control, value, status, group) { if (PioneerDDJSB2.invertVinylSlipButton) { - engine.setValue(group, 'slip_enabled', value / 127); + engine.setValue(group, "slip_enabled", value / 127); } else { PioneerDDJSB2.toggleScratch(channel, control, value, status, group); } @@ -688,13 +688,13 @@ PioneerDDJSB2.slipButton = function(channel, control, value, status, group) { if (PioneerDDJSB2.invertVinylSlipButton) { PioneerDDJSB2.toggleScratch(channel, control, value, status, group); } else { - engine.setValue(group, 'slip_enabled', value / 127); + engine.setValue(group, "slip_enabled", value / 127); } }; PioneerDDJSB2.keyLockButton = function(channel, control, value, status, group) { if (value) { - script.toggleControl(group, 'keylock'); + script.toggleControl(group, "keylock"); } }; @@ -707,67 +707,67 @@ PioneerDDJSB2.shiftKeyLockButton = function(channel, control, value, status, gro }; PioneerDDJSB2.loopInButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'loop_in', value ? 1 : 0); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "loop_in", value ? 1 : 0); }; PioneerDDJSB2.loopOutButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'loop_out', value ? 1 : 0); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "loop_out", value ? 1 : 0); }; PioneerDDJSB2.loopExitButton = function(channel, control, value, status, group) { if (value) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'reloop_exit', 1); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "reloop_exit", 1); } }; PioneerDDJSB2.loopHalveButton = function(channel, control, value, status, group) { if (value) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'loop_scale', 0.5); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "loop_scale", 0.5); } }; PioneerDDJSB2.loopDoubleButton = function(channel, control, value, status, group) { if (value) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'loop_scale', 2.0); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "loop_scale", 2.0); } }; PioneerDDJSB2.loopMoveBackButton = function(channel, control, value, status, group) { if (value) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'loop_move', -1); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "loop_move", -1); } }; PioneerDDJSB2.loopMoveForwardButton = function(channel, control, value, status, group) { if (value) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'loop_move', 1); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "loop_move", 1); } }; PioneerDDJSB2.loadButton = function(channel, control, value, status, group) { if (value) { - engine.setValue(group, 'LoadSelectedTrack', 1); + engine.setValue(group, "LoadSelectedTrack", 1); } }; PioneerDDJSB2.reverseRollButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'reverseroll', value); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "reverseroll", value); }; PioneerDDJSB2.lowKillButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'filterLowKill', value ? 1 : 0); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "filterLowKill", value ? 1 : 0); }; PioneerDDJSB2.midKillButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'filterMidKill', value ? 1 : 0); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "filterMidKill", value ? 1 : 0); }; PioneerDDJSB2.highKillButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'filterHighKill', value ? 1 : 0); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "filterHighKill", value ? 1 : 0); }; PioneerDDJSB2.muteButton = function(channel, control, value, status, group) { - engine.setValue(PioneerDDJSB2.deckSwitchTable[group], 'mute', value); + engine.setValue(PioneerDDJSB2.deckSwitchTable[group], "mute", value); }; @@ -821,58 +821,58 @@ PioneerDDJSB2.nonPadLedControl = function(deck, ledNumber, active) { // LEDS // /////////////////////////////////////////////////////////////// -PioneerDDJSB2.headphoneCueLed = function(value, group, control) { +PioneerDDJSB2.headphoneCueLed = function(value, group, _control) { PioneerDDJSB2.nonPadLedControl(group, PioneerDDJSB2.nonPadLeds.headphoneCue, value); PioneerDDJSB2.nonPadLedControl(group, PioneerDDJSB2.nonPadLeds.shiftHeadphoneCue, value); }; -PioneerDDJSB2.keyLockLed = function(value, group, control) { +PioneerDDJSB2.keyLockLed = function(value, group, _control) { PioneerDDJSB2.nonPadLedControl(group, PioneerDDJSB2.nonPadLeds.keyLock, value); PioneerDDJSB2.nonPadLedControl(group, PioneerDDJSB2.nonPadLeds.shiftKeyLock, value); }; -PioneerDDJSB2.slipLed = function(value, group, control) { +PioneerDDJSB2.slipLed = function(value, group, _control) { PioneerDDJSB2.nonPadLedControl(group, PioneerDDJSB2.nonPadLeds.vinyl, value); PioneerDDJSB2.nonPadLedControl(group, PioneerDDJSB2.nonPadLeds.shiftVinyl, value); }; -PioneerDDJSB2.loopInLed = function(value, group, control) { +PioneerDDJSB2.loopInLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, false, 0, false, value); }; -PioneerDDJSB2.loopOutLed = function(value, group, control) { +PioneerDDJSB2.loopOutLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, false, 1, false, value); }; -PioneerDDJSB2.loopExitLed = function(value, group, control) { +PioneerDDJSB2.loopExitLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, false, 2, false, value); }; -PioneerDDJSB2.loopHalveLed = function(value, group, control) { +PioneerDDJSB2.loopHalveLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, false, 3, false, value); }; -PioneerDDJSB2.loopDoubleLed = function(value, group, control) { +PioneerDDJSB2.loopDoubleLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, false, 3, true, value); }; -PioneerDDJSB2.lowKillLed = function(value, group, control) { +PioneerDDJSB2.lowKillLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, true, 0, false, value); }; -PioneerDDJSB2.midKillLed = function(value, group, control) { +PioneerDDJSB2.midKillLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, true, 1, false, value); }; -PioneerDDJSB2.highKillLed = function(value, group, control) { +PioneerDDJSB2.highKillLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, true, 2, false, value); }; -PioneerDDJSB2.muteLed = function(value, group, control) { +PioneerDDJSB2.muteLed = function(value, group, _control) { PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.manualLoop, true, 3, false, value); }; -PioneerDDJSB2.samplerLeds = function(value, group, control) { +PioneerDDJSB2.samplerLeds = function(value, group, _control) { var sampler = PioneerDDJSB2.samplerGroups[group], channel; @@ -890,7 +890,7 @@ PioneerDDJSB2.beatlooprollLeds = function(value, group, control) { shifted; for (index in PioneerDDJSB2.looprollIntervals) { - if (control === 'beatlooproll_' + PioneerDDJSB2.looprollIntervals[index] + '_activate') { + if (control === "beatlooproll_" + PioneerDDJSB2.looprollIntervals[index] + "_activate") { padNum = index % 4; shifted = (index >= 4); PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.autoLoop, true, padNum, shifted, value); @@ -904,7 +904,7 @@ PioneerDDJSB2.hotCueLeds = function(value, group, control) { hotCueNum; for (hotCueNum = 1; hotCueNum <= 8; hotCueNum++) { - if (control === 'hotcue_' + hotCueNum + '_enabled') { + if (control === "hotcue_" + hotCueNum + "_enabled") { padNum = (hotCueNum - 1) % 4; shiftedGroup = (hotCueNum > 4); PioneerDDJSB2.padLedControl(group, PioneerDDJSB2.ledGroups.hotCue, shiftedGroup, padNum, false, value); @@ -916,7 +916,7 @@ PioneerDDJSB2.hotCueLeds = function(value, group, control) { PioneerDDJSB2.VuMeterLeds = function(value, group, control) { // The red LED lights up with MIDI values 119 (0x77) and above. That should only light up when // the track is clipping. - if (engine.getValue(group, 'PeakIndicator') === 1) { + if (engine.getValue(group, "PeakIndicator") === 1) { value = 119; } else { // 117 was determined experimentally so the yellow LED only lights @@ -927,9 +927,9 @@ PioneerDDJSB2.VuMeterLeds = function(value, group, control) { if (!(PioneerDDJSB2.twinkleVumeterAutodjOn && engine.getValue("[AutoDJ]", "enabled"))) { var midiChannel; if (PioneerDDJSB2.showVumeterMaster) { - if (control === 'VuMeterL') { + if (control === "VuMeterL") { midiChannel = 0; - } else if (control === 'VuMeterR') { + } else if (control === "VuMeterR") { midiChannel = 1; } // Send for deck 1 or 2 @@ -941,24 +941,24 @@ PioneerDDJSB2.VuMeterLeds = function(value, group, control) { midi.sendShortMsg(0xB0 + midiChannel, 2, value); } } else { - if (group == "[Master]") { - if (control == "VuMeterL") { - PioneerDDJSB2.valueVuMeter['[Channel1]_current'] = value; - PioneerDDJSB2.valueVuMeter['[Channel3]_current'] = value; + if (group === "[Master]") { + if (control === "VuMeterL") { + PioneerDDJSB2.valueVuMeter["[Channel1]_current"] = value; + PioneerDDJSB2.valueVuMeter["[Channel3]_current"] = value; } else { - PioneerDDJSB2.valueVuMeter['[Channel2]_current'] = value; - PioneerDDJSB2.valueVuMeter['[Channel4]_current'] = value; + PioneerDDJSB2.valueVuMeter["[Channel2]_current"] = value; + PioneerDDJSB2.valueVuMeter["[Channel4]_current"] = value; } } else { - PioneerDDJSB2.valueVuMeter[group + '_current'] = value; + PioneerDDJSB2.valueVuMeter[group + "_current"] = value; } for (var channel = 0; channel < 4; channel++) { - var midiOut = PioneerDDJSB2.valueVuMeter['[Channel' + (channel + 1) + ']_current']; - if (PioneerDDJSB2.valueVuMeter['[Channel' + (channel + 1) + ']_enabled']) { + var midiOut = PioneerDDJSB2.valueVuMeter["[Channel" + (channel + 1) + "]_current"]; + if (PioneerDDJSB2.valueVuMeter["[Channel" + (channel + 1) + "]_enabled"]) { midiOut = 0; } - if (midiOut < 5 && PioneerDDJSB2.valueVuMeter['[Channel' + (channel + 1) + ']_enabled'] === 0) { + if (midiOut < 5 && PioneerDDJSB2.valueVuMeter["[Channel" + (channel + 1) + "]_enabled"] === 0) { midiOut = 5; } @@ -1047,9 +1047,9 @@ PioneerDDJSB2.toggleScratch = function(channel, control, value, status, group) { }; PioneerDDJSB2.pitchBendFromJog = function(channel, movement) { - var group = (typeof channel === "string" ? channel : '[Channel' + channel + 1 + ']'); + var group = (typeof channel === "string" ? channel : "[Channel" + channel + 1 + "]"); - engine.setValue(group, 'jog', movement / 5 * PioneerDDJSB2.jogwheelSensivity); + engine.setValue(group, "jog", movement / 5 * PioneerDDJSB2.jogwheelSensitivity); }; @@ -1069,42 +1069,42 @@ PioneerDDJSB2.getRotaryDelta = function(value) { return delta; }; -PioneerDDJSB2.rotarySelector = function(channel, control, value, status) { +PioneerDDJSB2.rotarySelector = function(channel, control, value, _status) { var delta = PioneerDDJSB2.getRotaryDelta(value); - engine.setValue('[Playlist]', 'SelectTrackKnob', delta); + engine.setValue("[Playlist]", "SelectTrackKnob", delta); PioneerDDJSB2.rotarySelectorChanged = true; }; -PioneerDDJSB2.shiftedRotarySelector = function(channel, control, value, status) { +PioneerDDJSB2.shiftedRotarySelector = function(channel, control, value, _status) { var delta = PioneerDDJSB2.getRotaryDelta(value), - f = (delta > 0 ? 'SelectNextPlaylist' : 'SelectPrevPlaylist'); + f = (delta > 0 ? "SelectNextPlaylist" : "SelectPrevPlaylist"); - engine.setValue('[Playlist]', f, Math.abs(delta)); + engine.setValue("[Playlist]", f, Math.abs(delta)); }; -PioneerDDJSB2.rotarySelectorClick = function(channel, control, value, status) { +PioneerDDJSB2.rotarySelectorClick = function(channel, control, value, _status) { if (PioneerDDJSB2.rotarySelectorChanged === true) { if (value) { - engine.setValue('[PreviewDeck1]', 'LoadSelectedTrackAndPlay', true); + engine.setValue("[PreviewDeck1]", "LoadSelectedTrackAndPlay", true); } else { if (PioneerDDJSB2.jumpPreviewEnabled) { - engine.setValue('[PreviewDeck1]', 'playposition', PioneerDDJSB2.jumpPreviewPosition); + engine.setValue("[PreviewDeck1]", "playposition", PioneerDDJSB2.jumpPreviewPosition); } PioneerDDJSB2.rotarySelectorChanged = false; } } else { if (value) { - engine.setValue('[PreviewDeck1]', 'stop', 1); + engine.setValue("[PreviewDeck1]", "stop", 1); } else { PioneerDDJSB2.rotarySelectorChanged = true; } } }; -PioneerDDJSB2.rotarySelectorShiftedClick = function(channel, control, value, status) { +PioneerDDJSB2.rotarySelectorShiftedClick = function(channel, control, value, _status) { if (value) { - engine.setValue('[Playlist]', 'ToggleSelectedSidebarItem', 1); + engine.setValue("[Playlist]", "ToggleSelectedSidebarItem", 1); } }; @@ -1113,12 +1113,12 @@ PioneerDDJSB2.rotarySelectorShiftedClick = function(channel, control, value, sta // FX // /////////////////////////////////////////////////////////////// -PioneerDDJSB2.EffectUnit = function (unitNumber) { +PioneerDDJSB2.EffectUnit = function(unitNumber) { var eu = this; - this.group = '[EffectRack1_EffectUnit' + unitNumber + ']'; - engine.setValue(this.group, 'show_focus', 1); + this.group = "[EffectRack1_EffectUnit" + unitNumber + "]"; + engine.setValue(this.group, "show_focus", 1); - this.EffectButton = function (buttonNumber) { + this.EffectButton = function(buttonNumber) { this.buttonNumber = buttonNumber; this.group = eu.group; @@ -1127,29 +1127,29 @@ PioneerDDJSB2.EffectUnit = function (unitNumber) { components.Button.call(this); }; this.EffectButton.prototype = new components.Button({ - input: function (channel, control, value, status) { + input: function(channel, control, value, status) { if (this.isPress(channel, control, value, status)) { this.isLongPressed = false; - this.longPressTimer = engine.beginTimer(this.longPressTimeout, function () { - var effectGroup = '[EffectRack1_EffectUnit' + unitNumber + '_Effect' + this.buttonNumber + ']'; - script.toggleControl(effectGroup, 'enabled'); + this.longPressTimer = engine.beginTimer(this.longPressTimeout, function() { + var effectGroup = "[EffectRack1_EffectUnit" + unitNumber + "_Effect" + this.buttonNumber + "]"; + script.toggleControl(effectGroup, "enabled"); this.isLongPressed = true; }, true); } else { if (!this.isLongPressed) { - var focusedEffect = engine.getValue(eu.group, 'focused_effect'); + var focusedEffect = engine.getValue(eu.group, "focused_effect"); if (focusedEffect === this.buttonNumber) { - engine.setValue(eu.group, 'focused_effect', 0); + engine.setValue(eu.group, "focused_effect", 0); } else { - engine.setValue(eu.group, 'focused_effect', this.buttonNumber); + engine.setValue(eu.group, "focused_effect", this.buttonNumber); } } this.isLongPressed = false; engine.stopTimer(this.longPressTimer); } }, - outKey: 'focused_effect', - output: function (value, group, control) { + outKey: "focused_effect", + output: function(value, _group, _control) { this.send((value === this.buttonNumber) ? this.on : this.off); }, sendShifted: true, @@ -1161,33 +1161,33 @@ PioneerDDJSB2.EffectUnit = function (unitNumber) { for (var i = 1; i <= 3; i++) { this.button[i] = new this.EffectButton(i); - var effectGroup = '[EffectRack1_EffectUnit' + unitNumber + '_Effect' + i + ']'; - engine.softTakeover(effectGroup, 'meta', true); - engine.softTakeover(eu.group, 'mix', true); + var effectGroup = "[EffectRack1_EffectUnit" + unitNumber + "_Effect" + i + "]"; + engine.softTakeover(effectGroup, "meta", true); + engine.softTakeover(eu.group, "mix", true); } this.knob = new components.Pot({ - unshift: function () { - this.input = function (channel, control, value, status) { + unshift: function() { + this.input = function(channel, control, value, _status) { value = (this.MSB << 7) + value; - var focusedEffect = engine.getValue(eu.group, 'focused_effect'); + var focusedEffect = engine.getValue(eu.group, "focused_effect"); if (focusedEffect === 0) { - engine.setParameter(eu.group, 'mix', value / this.max); + engine.setParameter(eu.group, "mix", value / this.max); } else { - var effectGroup = '[EffectRack1_EffectUnit' + unitNumber + '_Effect' + focusedEffect + ']'; - engine.setParameter(effectGroup, 'meta', value / this.max); + var effectGroup = "[EffectRack1_EffectUnit" + unitNumber + "_Effect" + focusedEffect + "]"; + engine.setParameter(effectGroup, "meta", value / this.max); } }; }, }); - this.knobSoftTakeoverHandler = engine.makeConnection(eu.group, 'focused_effect', function (value, group, control) { + this.knobSoftTakeoverHandler = engine.makeConnection(eu.group, "focused_effect", function(value, _group, _control) { if (value === 0) { - engine.softTakeoverIgnoreNextValue(eu.group, 'mix'); + engine.softTakeoverIgnoreNextValue(eu.group, "mix"); } else { - var effectGroup = '[EffectRack1_EffectUnit' + unitNumber + '_Effect' + value + ']'; - engine.softTakeoverIgnoreNextValue(effectGroup, 'meta'); + var effectGroup = "[EffectRack1_EffectUnit" + unitNumber + "_Effect" + value + "]"; + engine.softTakeoverIgnoreNextValue(effectGroup, "meta"); } }); };