Cabbage Logo
Back to Cabbage Site

Alpha(), rotate() identifiers broken in <Cabbage>

The alpha() and rotate() identifiers (maybe others?) seems not to work when used in the section. When sent from the orchestra using a cabbageSet they do work so perhaps its an initialisation oversight.

Another little thing that I have noticed in the recent build is that the keyboard shortcut for Find (CMD+F) seems to have gone.

Thanks Iain. I think I know when I broke them. :see_no_evil:

Seems to work fine for me Iain, although I did have a bit of a head scratch before I remembered to add guiMode("queue") :see_no_evil:

<Cabbage>
form size(360, 360), caption("Simple synth"), pluginId("1Syn"), colour(100), guiMode("queue")
image bounds(122, 170, 100, 100), channel("image1") alpha(0.55)
hslider  bounds(  0,  20, 220, 30), channel("radians"), range(0, 6.283, 0,1,0.001),  colour(SlateGrey), text("Radians")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
;sr is set by the host
ksmps = 64
nchnls = 2
0dbfs=1

instr 1
    kradians		chnget	"radians"
    kpivotx		chnget	"pivotx"
    kpivoty		chnget	"pivoty"
    cabbageSet changed:k(kradians,kpivotx,kpivoty), "image1", "rotate", kradians, 0, 0
endin

instr 2
    k1 phasor 0.1
    cabbageSet metro(20), "image1", "alpha", k1
endin
</CsInstruments>  
<CsScore>
f1 0 1024 10 1
i1 0 z
i2 0 z
</CsScore>

Hi Rory,

For me it seems to be when setting alpha() in the < Cabbage > header section that it is ignored. For example in the code below, setting alpha in line 3 has no effect. Using CabbageSet from the orchestra works fine.

<Cabbage>
form size(360, 360), caption("Simple synth"), pluginId("1Syn"), colour(100), guiMode("queue")
image bounds(122, 170, 100, 100), channel("image1") alpha(0.1)
</Cabbage>

<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
;sr is set by the host
ksmps = 64
nchnls = 2
0dbfs=1

instr 1
endin

</CsInstruments>  
<CsScore>
i1 0 z
</CsScore>

Thanks Iain, I’ll take a look later when I get a chance :slight_smile:

This should be fixed now. Let me know if you find any other identifiers that are not being read from the Cabbage section. It would be great to build some tests to check for these things each time I make a commit.

1 Like

alpha() and rotate() seem okay now.

corners() is misbehaving in the opposite way: it can be initialised in < Cabbage > but cannot be changed using cabbageSet.

<Cabbage>
form size(300,300), caption("."), guiMode("queue"), colour(50,50,50)
image bounds(10,10,200,100), corners(50), channel("imgChn")
hslider bounds(10,150,250,20), channel("corVal"), range(0,100,0,1,1), valueTextBox(1), text("corners")
</Cabbage>

<CsoundSynthesizer>

<CsOptions>   
-dm0 -n -+rtmidi=NULL -M0
</CsOptions>

<CsInstruments>

ksmps = 16
nchnls = 2
0dbfs = 1

instr 1
kcorVal,kT cabbageGetValue "corVal"
           cabbageSet      kT,"imgChn","corners",kcorVal
endin

</CsInstruments>

<CsScore>
i 1 0 [3600*24*7]                
</CsScore>

</CsoundSynthesizer>

Thanks Iain. Fixed now. :+1: