From 1592e2c800aec472a2ca6f62bb605ea41b238a18 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 10 Dec 2024 14:18:52 +0100 Subject: [PATCH] S4 Mk3: eliminate scratch drift when using engine.scratch.. functions --- res/controllers/Traktor-Kontrol-S4-MK3.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/res/controllers/Traktor-Kontrol-S4-MK3.js b/res/controllers/Traktor-Kontrol-S4-MK3.js index 410c78866004..8bcd4d84fef5 100644 --- a/res/controllers/Traktor-Kontrol-S4-MK3.js +++ b/res/controllers/Traktor-Kontrol-S4-MK3.js @@ -2491,7 +2491,8 @@ class S4Mk3Deck extends Deck { } const currentSpeed = (value - oldValue)/(timestamp - oldTimestamp); - if ((currentSpeed <= 0) === (speed <= 0)) { + if ((currentSpeed < 0) === (speed < 0) || + ((currentSpeed > 0) === (speed > 0))) { speed = (speed + currentSpeed)/2; } else { speed = currentSpeed;