Excuse my poor English… How can I do a JS-function while a button on the controller is pressed? I want the scratching with a fixed speed for a button on the Hercules P32 DJ. The following is not working:
[code]
unshift: function () {
var isPressed = false;
this.input = function (channel, control, value, status, group) {
if (value === 127) { // do something when this button is pressed
var alpha = 1.0/8;
var beta = alpha/32;
engine.scratchEnable(channel, 128, 33+1/3, alpha, beta);
isPressed = true;
}
if (value === 0) {
engine.scratchDisable(channel);
isPressed = false;
}
if (isPressed) {
engine.scratchTick(channel, -20); // scratch back
}
};
},[/code]