Changing fader value

Hi everyone,

I have the following script working on an XY widget:

let x = value[1]
x = Math.round(x * 127)
send("midi:my_device", "/control", 1, 33, x)

How can I achieve the same for a fader? (Not looking to link it to the XY widget )
So in the end, when the range of the fader would go up the value x would also go up and vice versa when going down.

Simply write value instead of value[1], the fader's value is uni-dimensional so it's not an array but a plain number.

Thank you @jean-emmanuel that was smooth!