Cabbage Logo
Back to Cabbage Site

Widgets dont update channels when created with cabbageCreate

cabbageCreateBug.csd (795 Bytes)

cabbageCreateBug_working.csd (796 Bytes)

The only difference between the two files above is the placement of a semicolon. I

n the first version, the slider is created using cabbageCreate in instr 67, and the slider line in the <Cabbage> section of the code is commented out. In the second version it’s the opposite: the cabbageCreate line is commented out, and the slider is created in the <Cabbage> section.

In both versions the widget is created successfully. But in the first one, moving the slider doesn’t update the channel (“PW”). As a result, the synth sound (instr 1) is not modulated. Also, instr 1 prints the value of ipw on every note, showing the same issue: ipw stays at 0.5 no matter what the widget does.

In the second version, everything works like it should. Moving the slider updates the value of the “PW” channel and this is reflected in the sound and in value of ipw that gets printed with every note

Seems like a problem with cabbageCreate?

Certainly related to this issue. For some reason cabbageCreate doesn’t like the \"s any more. I’ll take a look when I get a chance, in the meantime, try:

cabbageCreate "rslider", {{ channel("PW") bounds(25,25,60,80) text("PW") range(.5,.999,.5,.5,.001) }}

Hi @cybilopsin This working fine for me here:

form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1")
keyboard bounds(8, 158, 381, 95)
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5

ksmps = 32
nchnls = 2
0dbfs = 1

instr 65
    ; creates widget but widget does not update channel?
    cabbageCreate "rslider", "channel(\"PW\") bounds(25,25,60,80) text(\"PW\") range(.5,.999,.5,.5,.001)"
    //cabbageCreate "rslider", {{ channel("PW") bounds(25,25,60,80) text("PW") range(.5,.999,.5,.5,.001)}}

instr 1
    kpw, kTrig cabbageGetValue "PW"
    printf "%f\n", kTrig, kpw

i65 0 z
i1 0 z