Default Values for Faders, Range and XY-Pads

Hello,
I want to give some Widgets a default value between 0 and 127. With the fader it is very easy. I only write a Number in the default window.
But I do not know the syntax for the range widget. And the same for XY-Pads.

Hi,

In the default property, you need to give it an array of two values since that is what the range/XY-Pads value's are returning. For example for an XY-Pad if the min/max are set between 0 & 1, then your default values could be:

[
  0.4,
  0.3
]

For help in the future, in the scripting onValue property, you can log the value of the widget using console.log(value). That would showcase that the two widgets you asked for are returning an array of 2 values, whereas something like a simple toggle button just returns one value 0 or 1.

Hope this helps. Cheers!
-DMDComposer

Thank you, the first part has helped me. I had put the wrong brackets.
I'm a total beginner in programming, so I don't understand the second part yet. Will definitely remember it later.

1 Like