Sending Continous Fader Data

Cheers, me again.
Been spending the Weekend with osc.
I tried to implement a continous update stream from a fader with spring.
grafik
So its basicly an encoder, which sends + and - data.
And as long its held in a position, it shall send data.
The script property from the fader:

setInterval("intensitytouch",function(){
if(get("fader_1")!=0) {
send("/eos/active/wheel/1",parseFloat(get("fader_1")));
} else {
clearInterval("intensitytouch");
}

},100);

This didnt work too well, OSC stopped sending data at some point. Probably performance issues anyhow.
But the content works.

But a better way would be, having it natively update not only via "fader position change" basis, but also on a timebase, at best via a property for enabled and interval.

The problem is, that i need to go from an unknown state, to either 100 or -100 relatively, without setting absolute values. Probably overlooked an easier solution.

You’re creating a new interval callback at each fader update, it would be much more efficient to avoid that:

if (value == 0) {
  clearInterval()
  locals.timerRunning = false
} else if (!locals.timerRunning) {
  locals.timerRunning = true
  setInterval(()=>{
    send('/eos/active/wheel/1', get('this'))
  }, 100)
}

will try in a few,

must have misread documentation because i understood using the id would prevent creating other intervals for the same widget.

but yes, checking local variables are sure something i didnt consider.

must have misread documentation because i understood using the id would prevent creating other intervals for the same widget.

You read correct, but when omitted the id has a default value ("undefined") that's good enough in many cases.

Amazing stuff, love whats happening here. Still bit wonky.
When using mouse wheel on the fader, it doesnt snap back.
Not sure if you consider this a bug, probably not really an issue besides during development.

Cheers.

I'm not sure either, what behavior would feel appropriate in this case ?

Yeah well i dont know,
maybe just have it snap back after 100ms of no change or dont even enable mousewheel if possible.