Cabbage Logo
Back to Cabbage Site

Listening to / transmitting widget changes

Hey there folks,

I’ve been wondering, is there a way to listen to changes in widget values, without actually triggering an instrument?

I have a fairly common requirement. I have 3 checkbox widgets with the same radio group channel. So they act as 3 radio buttons, one pre-selected. When a different radio button is pressed, a chnset opcode is used to make another widget inactive as shown in the attached code. This works fine, only when the instrument is triggered, since the code for setting the channel is housed inside one of the instrs. But is there a way for me to change the widget values outside of the instr, such that the inactivity of one of the widgets appear as soon as I click on a radio button, instead of me having to wait till I hit a key for the changes to appear?

Thanks!

DemoSynth.csd (4.5 KB)

k-rate operations have to be within an instrument block but you can just create a separate, always-on, instrument to run the chnset code. If you need to share variables between instruments just use global variables (preceded by a ‘g’).

1 Like

This answers the question, thanks Iain!