Knob turn change of direction stays on old value briefly

Hi,

I’m currently using this code to convert the output of my Softube Console 1 (0 - 127) to 63 on a left turn, and 65 on a right turn of a knob.

// Disable output so you can center encoder
if gb==1 then exit rules, skip Outgoing Action
// Determine Count
qq=pp-ga
// Down
if qq<0 then gc=63
// Up
if qq>0 then gc=65
// Fix counter to positive
if qq<0 then qq=qq*-1

All works perfectly, however if I am turning the knob left, then change direction to the right, the value continues to output 63 for left briefly before correctly returning 65 for the right turn.
It does this with either direction.

is there a way to fix this so that it matches the movement better?
Could it be my controller (Console 1) spitting out increments and decrements of +/-3 when inputting?

thanks.

Hi, well I could not get your code to work at all so I created my own below. The main thing I saw was you were comparing with the global variable ga which was never updated. I also added some logging as a debugging tool.

// Disable output so you can center encoder
if gb==1 then exit rules, skip Outgoing Action
// Input will absolute stored in qq from incoming trigger
// output will be 0x3f or 0x41 stored in ss for outgoing action
// compare with last value stored in ga
rr=qq-ga
Log "Log delta is %rr%"
// We turn of accelleration here
// No need to use global variables for this
if rr<0 then ss=63
if rr>0 then ss=65
if rr==0 then Log "Log skipping output"
if rr==0 then exit rules, skip Outgoing Action
// Update the absolute value in global variable ga
ga=qq
// Don't allow to go out of bounds
if ga<0 then ga=0
if ga>127 then ga=127
Log "Log output is 0x%02x ss%"

Absolute-to-Relative3F-41-2023-11-15.bmtp (2.4 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
1 Like

Amazing! thanks Steve, it works perfectly!

Mitch

1 Like