I didn’t use radio buttons but used classical uiImageButtons (2 images – On and Off states) that are all in the same RadioGroup property number (+ Component is member of a group).
Name your buttons as for example Bank1 to Bank16.
When you will toggle one ON, the others are toggled OFF immediately.
This is when you are acting on the panel.
Then in Lua, if you need to set one of them ON (for example after recieving and reading a patch dump), I set first all of them to OFF then the desired one to ON by using (I have 2 radiogroups, one for Banks and one for Presets – Moog Sub37):
-- Illuminate corresponding Bank and Preset buttons
for i=0,16 do
btnBank = panel:getModulatorByName("btnBank"..i)
btnBank:setValue(0,false)
btnPreset = panel:getModulatorByName("btnPreset"..i)
btnPreset:setValue(0,false)
end
btnBank = panel:getModulatorByName("btnBank"..PresetBank)
btnBank:setValue(1,false)
btnPreset = panel:getModulatorByName("btnPreset"..PresetNumber)
btnPreset:setValue(1,false)
To read them, you can have one unique OnChange method for all. The same method will be called but has the changed modulator as argument “mod”. You set a Lua variable iSelectedBank by using
if value == 1 then
sName= L(mod:getName())
iSelectedBank = tonumber(string.sub(sName,1,2))
end
As 2 modulators will change their value (one going to 1, the other to 0), you need to test for the one going to 1).
Please try and let us know… 🙂