Skip to content

Commit

Permalink
Add a jog wheel multiplier constant for the S3
Browse files Browse the repository at this point in the history
  • Loading branch information
robbert-vdh committed Jan 30, 2023
1 parent 1203cd0 commit ee52ffe
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions res/controllers/Traktor-Kontrol-S3-hid-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ TraktorS3.ChannelColors = {
TraktorS3.LEDDimValue = 0x00;
TraktorS3.LEDBrightValue = 0x02;

// Parameters for the scratch smoothing
// By default the jog wheel's behavior when rotating it matches 33 1/3 rpm
// vinyl. Changing this value to 2.0 causes a single rotation of the platter to
// result in twice as much movement, and a value of 0.5 causes the amount of
// movement to be halved.
TraktorS3.JogSpeedMultiplier = 1.0;

// Parameters for the jog wheel smoothing while scratching
TraktorS3.Alpha = 1.0 / 8;
TraktorS3.Beta = TraktorS3.Alpha / 32;

Expand Down Expand Up @@ -1263,7 +1269,13 @@ TraktorS3.Deck = class {
}

if (field.value !== 0) {
engine.scratchEnable(this.activeChannelNumber, 768, 33.33334, TraktorS3.Alpha, TraktorS3.Beta);
engine.scratchEnable(
this.activeChannelNumber,
768,
33.33334 / TraktorS3.JogSpeedMultiplier,
TraktorS3.Alpha,
TraktorS3.Beta
);
} else {
engine.scratchDisable(this.activeChannelNumber);

Expand Down Expand Up @@ -1302,7 +1314,7 @@ TraktorS3.Deck = class {
// get the rate ratio.
const velocity = (tickDelta / timeDelta) / thirtyThree;

engine.setValue(this.activeChannel, "jog", velocity);
engine.setValue(this.activeChannel, "jog", velocity * TraktorS3.JogSpeedMultiplier);
}
}

Expand Down

0 comments on commit ee52ffe

Please sign in to comment.