@Samo, I’ve added an optional argument to the cabbageChanged opcode. If added, a trigger will only be output each time the channel hits this target value. In the example below, the triggers only fire when a button is turned on, as opposed to firing whenever it changes between on and off,
<Cabbage>
form caption("Radio") size(400, 300), guiMode("queue") pluginId("def1")
button bounds(10, 10, 80, 30), latched(1) channel("button1"), radioGroup(10)
button bounds(100, 10, 80, 30), latched(1) channel("button2"), radioGroup(10)
button bounds(200, 10, 80, 30), latched(1) channel("button3"), radioGroup(10)
button bounds(300, 10, 80, 30), latched(1) channel("button4"), radioGroup(10)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
SChans[] cabbageGetWidgetChannels "radioGroup(10)"
SChannel, kTrig cabbageChanged SChans, 1
printf SChannel, kTrig
endin
</CsInstruments>
<CsScore>
i1 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>

