I’m sorry to return to this with a fresh new issue. The last fixes gave birth to a “fantastic” new little Cabbage destroyer! It has to do with checkbox
and trighold
that I use to blink a “light indicator”.
The code below used to work before. Now it is (1) blinking kind of randomly and it seems to mess with the form
, because (2) it doesn’t stop blinking after I turn the instrument off, and (3) it also causes rslider
to jump around (you get that when you move the slider to some sweet spots).
Please try running this simple example:
<Cabbage>
form caption("Test") size(350, 200), colour(0,0,0), guiMode("queue"), pluginId("sfi1")
rslider bounds(10, 10, 140, 110) range(0, 100, 0, 0.5, 0.0001) channel("slider1") colour(200, 200, 200, 255) trackerColour(200, 255, 200, 255) markerColour(0, 0, 0, 255) popupText("0")
checkbox bounds(150, 24, 20, 20), colour:0(255, 255, 0, 150), colour:1(255, 255, 0, 255) channel("blinkCheckBox"), value(0), shape("ellipse"), active(0) automatable(0)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d ;--midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
ksmps = 32
instr 1
kMetro = metro:k(cabbageGetValue:k("slider1"))
cabbageSetValue "blinkCheckBox", trighold:k(kMetro,1/ksmps) ; blink
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
i1 0 z
</CsScore>
</CsoundSynthesizer>
[edit] I actually had to go back to 2.7.5 to get rid of it, haven’t tried 2.7.6.
For now I can solve this by using cabbageSet
on an image
within a special devoted triggered instrument, but it seems a less elegant solution to blinking lights. I’d also be interested in any comments/suggestions on this.