Reply To: Radio button in a modulator group needs a default setting

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

#118960
dnaldoog
Participant
  • Topics: 4
  • Replies: 480
  • Total: 484
  • ★★

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 6 months, 3 weeks ago by dnaldoog. Reason: removed getValue () variable because it always returns 1 so not very useful
Attachments:
You must be logged in to view attached files.
Do NOT follow this link or you will be banned from the site!