So let's say your button is a Pad object (or a Custom Button set to Pad behavior). Create a script on your pad or button. Set the script's execution to "On Expression", and in the field to the right, put "x". This means that any time the button's "x" value changes, the script will execute.
In that script, put this:
Code: Select all
if (x) {
MultiSlider.x = range(sizeof(MultiSlider.x), 1, 1);
}
That checks to make sure "x" is true. For Pads and Custom Buttons in Pad mode, this means that it will only perform the instructions inside the "if" when you first touch the pad. In that case, it sets all of the MultiSlider's "x" values to 1. In detail: "sizeof(MultiSlider.x)" basically means "the length of the MultiSlider's X", which will always be the same as the number of sliders you gave it. "range(n, low, high)" creates an array of size n, with values starting at low, and evenly spaced until the last one at high. So for example, "range(3, 1, 3)" will give you {1, 2, 3}. Putting those two together, it creates an array with a "1" for every slider in your MultiSlider, then assigns it to the MultiSlider's "x".
If you have named your MultiSlider something other than "MultiSlider", you'll need to change "MultiSlider" to whatever name you gave the object.