Toggle slider value state from buttons.
-
Hello. Sorry, i still new for best practices, still looking for correct answers.
So i have 3 sets of buttons, by 10 in each group.
Can i trigger a value of a slider by button? Button 1 will trigger value 0, button 2 - value 1... button 12 - value 2 and so on.
I just need small example how to simply connect button to a slider. Thank you!
God bless you! -
@ForeverLive a small example with 2 different approaches
The buttons are in a radio group.
If you want the knb value to be the index number of the btn
get the index of the button:
local idx = Btns.indexOf(component);
and set it to the knob
ControlledKnb.setValue(idx);Else if you have other values that you want to set the knob to, make an array with those values and use the button index
to get the right value for the knobHiseSnippet 1229.3ocsX0taaaCEkJIJc1cqaEnO.DA6G1EdI1INeghg4EmjBitj3M2ETfhrNZI5H1HSZPQkDugAzGk8Ht2fsKojijSrRszf8OLLu7dtmCIu7RR2UJbnAABIxpzaGOhhr9R6di4Ju1dDFG04Pj0yrOgDnnRbjoCFOhDDPcQVVK+ZsAqRqfLe9me3.hOg6PSLgPmKXNzehMjoRr1s0aX99GSboukMLk2Ma0wQvaK7EgfdV1tNZDw4JxkzSIZ2VxFYs5QtLkP1SQTz.vmCDti64ItgG4+4r.VeeptQCTOHPQlQs8X9tcmLVCPHqU5lLxWNZj+B6SXtr6rmLC7MlNvIHROGXsziIoF4PRVojzJQR5418bjrQpjdz54o1c3vBx.BLUmVJQ9hVBYa2V.dvUqOjbE8XIz3NDU1od8ZX3qpupbYX5NPgul.KtfORguO08M793uGOI.WRUsECGI3PiJqMkWqoiPpPbfhG.He+rgB81Xsp0JievmL8eyb5+V4z+l4z+syo+6jS+2Mm9uWN8e+b5ei5qU8BXMlw8YbJdPH2QwDbrfqWpiyEp3LASMHKvOjVs7eVtzFaTpy.7XQH9FBWgUdT7UPdkwArRf6SM1XbW5sXd3v9P8Ew.is9Jd4R9BGhOl4dKjPoIacimmMHgMH4qzToiqGPUmqieE.ltWiJNxO.nIRJdjqoXAvgLRHA.eDUJUJvPLLvhDrnOXqFVuIBS3XhTRFiugo7.fBHtwQgvcwgAQin9gJELEYjaTjDXXh0zmjcomJ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