Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions res/controllers/Hercules-DJControl-Inpulse-300-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ DJCi300.kScratchActionBend = 3;

DJCi300.vuMeterUpdateMaster = function(value, group, control) {
value = (value * 122) + 5;
midi.sendShortMsg(0xB0, control, value);
midi.sendShortMsg(0xB0, 0x40, value);
midi.sendShortMsg(0xB0, 0x41, value);
};

DJCi300.vuMeterUpdateDeck = function(value, group, _control, _status) {
Expand Down Expand Up @@ -81,7 +82,7 @@ DJCi300.init = function() {
engine.softTakeover("[Channel2]", "rate", true);
engine.softTakeoverIgnoreNextValue("[Channel1]", "rate");
engine.softTakeoverIgnoreNextValue("[Channel2]", "rate");

// Connect the VUMeters
engine.connectControl("[Channel1]", "VuMeter", "DJCi300.vuMeterUpdateDeck");
engine.getValue("[Channel1]", "VuMeter", "DJCi300.vuMeterUpdateDeck");
Expand Down Expand Up @@ -156,7 +157,20 @@ DJCi300.wheelTouchShift = function(channel, control, value, _status, _group) {
};

// Scratching on the jog wheel (rotating it while pressing the top surface)
DJCi300._scratchWheelImpl = function(deck, value) {
DJCi300.scratchWheel = function(channel, control, value, status, _group) {
var deck;
switch (status) {
case 0xB1:
case 0xB4:
deck = 1;
break;
case 0xB2:
case 0xB5:
deck = 2;
break;
default:
return;
}
var interval = DJCi300._convertWheelRotation(value);
var scratchAction = DJCi300.scratchAction[deck];
if (scratchAction === DJCi300.kScratchActionScratch) {
Expand All @@ -166,32 +180,16 @@ DJCi300._scratchWheelImpl = function(deck, value) {
interval * DJCi300.scratchScale *
DJCi300.scratchShiftMultiplier);
} else {
DJCi300._bendWheelImpl(deck, value);
engine.setValue(
"[Channel" + deck + "]", "jog", interval * DJCi300.bendScale);
}
};

// Scratching on the jog wheel (rotating it while pressing the top surface)
DJCi300.scratchWheel = function(channel, control, value, _status, _group) {
var deck = channel;
DJCi300._scratchWheelImpl(deck, value);
};

// Seeking on the jog wheel (rotating it while pressing the top surface and holding Shift)
DJCi300.scratchWheelShift = function(channel, control, value, _status, _group) {
var deck = channel - 3;
DJCi300._scratchWheelImpl(deck, value);
};

DJCi300._bendWheelImpl = function(deck, value) {
var interval = DJCi300._convertWheelRotation(value);
engine.setValue("[Channel" + deck + "]", "jog",
interval * DJCi300.bendScale);
};

// Bending on the jog wheel (rotating using the edge)
DJCi300.bendWheel = function(channel, control, value, _status, _group) {
var deck = channel;
DJCi300._bendWheelImpl(deck, value);
var interval = DJCi300._convertWheelRotation(value);
engine.setValue(
"[Channel" + channel + "]", "jog", interval * DJCi300.bendScale);
};

DJCi300.shutdown = function() {
Expand Down
Loading