Alright, I got two widgets locked together, and for the life of me I can’t understand why this isn’t an infinite loop, where one widget changes, causing the other widget to change, which in turn causes the other widget…
<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1")
rslider bounds(20, 20, 50, 50) range(0, 10, 1, 1, 0.1) channel("mySlider")
nslider bounds(100, 20, 100, 24) range(0, 10, 1, 1, 0.1) channel("myBox")
keyboard bounds(8, 158, 381, 95)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
kEnv madsr .1, .2, .6, .4
aOut vco2 p5, p4
outs aOut*kEnv, aOut*kEnv
endin
instr 2
    kMySlider, kMySliderTrig cabbageGetValue "mySlider"
    kMyBox, kMyBoxTrig cabbageGetValue "myBox"
    
    if kMySliderTrig == 1 then
        cabbageSetValue "myBox", kMySlider
        printsk "slider %f\n", kMySlider
    endif
    if kMyBoxTrig == 1 then
        cabbageSetValue "mySlider", kMyBox
        printsk "box %f\n", kMySlider
    endif
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
i 2 0 -1
f0 z
</CsScore>
</CsoundSynthesizer>
Does this have something to do with the value not actually changing once it is set in the other widget?


