Skip to content

Commit

Permalink
Fixes auto tempo going to infinity bug.
Browse files Browse the repository at this point in the history
When auto tempo adjustment is turned on it cannot be turned off.
That is because the code only disables it when `rate` is equal to 0.
But it only executes the check when variable `speed`(== `rate`)
is DIFFERENT than 0.
  • Loading branch information
mab122 committed Mar 17, 2020
1 parent 7ece3ef commit d2e2edf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions res/controllers/Pioneer-DDJ-SB2-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,13 @@ PioneerDDJSB2.longButtonPressWait = function() {
PioneerDDJSB2.speedRateToNormal = function(group, deck) {
var speed = engine.getValue(group, 'rate');
if (speed > 0) {
engine.setValue(group, 'rate_perm_down_small', true);
engine.setValue(group, 'rate_perm_up_small', true);
if (engine.getValue(group, 'rate') <= 0) {
engine.stopTimer(PioneerDDJSB2.speedRateToNormalTimer[deck]);
engine.setValue(group, 'rate', 0);
}
} else if (speed < 0) {
engine.setValue(group, 'rate_perm_up_small', true);
engine.setValue(group, 'rate_perm_down_small', true);
if (engine.getValue(group, 'rate') >= 0) {
engine.stopTimer(PioneerDDJSB2.speedRateToNormalTimer[deck]);
engine.setValue(group, 'rate', 0);
Expand Down

0 comments on commit d2e2edf

Please sign in to comment.