Round value at center position && input saved with templates

Hi,

first question :
let's say that I have a midi knob is value goes to 0.10 to 2.00, the center position (64) is 1.01 instead of 1.
Is the only solution is a script that divide the knob value by 2 and set each part ?
like this :

var result = val < 64 ? // if val < 64
(val / 64 * 0.9 + 0.1) :
((val - 64) / 63 * + 1)/

Second question is : I set dynamically the midi channel, using a input widget, and wish to keep it saved with the templates. is it possible like using variables ?
Thanks

2.)
Maybe take a look at local storage ? https://openstagecontrol.ammd.net/docs/widgets/scripting/#storage

1 Like

1 it’s probably not the only mathematical way to do it but it looks good enough
2. you can save it in the browser’s cache with localStorage, but not in the session file. You can save/load anything to/from a json file with a custom module, I’d do that.

1 Like