Home › Forums › General › Programming › Radio button in a modulator group needs a default setting › Reply To: Radio button in a modulator group needs a default setting
June 29, 2020 at 12:10 pm
#118960
Hi Damien,
I did something similar in my JD-990 panel, but all in lua:
ctrlr.org/roland-jd990-super-editor/
I use similar code for the Tone Switch buttons.
--
-- Called when a mouse is down on this component
--
myRadio = function(--[[ CtrlrComponent --]] comp, --[[ MouseEvent --]] event)
local modName=L(comp:getOwner():getName())
local t={"ButtonA","ButtonB","ButtonC"}
for _,v in ipairs(t)do
panel:getModulatorByName(v):getComponent():setValue(0,false)--set all other modulators to false
if v==modName then
-- do something
panel:getLabel("debug"):setText(v)
end
end
end --f
Not sure if this is what you are after?
You might have to initialise one of the buttons on startup to make sure one is engaged perhaps.
Regards,
- This reply was modified 3 years, 9 months ago by dnaldoog. Reason: removed getValue () variable because it always returns 1 so not very useful