Cabbage Logo
Back to Cabbage Site

Combobox not outputting values?

Hi, I’m sorry this is probably a stupid question. I’m trying to use a combobox in an instrument of mine but for some reason I can’t seem to get any values out of it. I’ve tried putting comboboxes in example instruments and have gotten values printed as they should but I can’t get the widget to work properly in things I make. Here is a simple test I made (it’s just a combobox) and it demonstrates the struggle I’m having:

<Cabbage>
form caption("Combobox Test") size(400, 300), colour(220, 220, 220), pluginid("def1")
combobox bounds(54, 34, 80, 20) channel("Test") text("one", "two", "three", "four")
</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

ktest chnget "Test"
printk2 ktest

endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...

f0 z
</CsScore>
</CsoundSynthesizer>

Any help would be appreciated!

instr 1 is never started, when nothing is ever prints. If you add i1 0 z to the score you’ll see the output when you change the combobox. To save yourself some hassle with this in the future, just make sure to choose the correct template when creating a new plugin. Plugin synths don’t enable any instruments by default. And without a keyboard you’ll need to manually activate them from the score. When you create a plugin effect, instr 1 is enabled and always on.

Of course you can override any of these things, but it’s worth keeping them in mind :wink:

1 Like

rory, thank you so much for your advice :slight_smile: I totally overlooked the fact that I need to start the instr itself as well. Whenever I’d play a Cabbage instrument with a midi keyboard connected it’d sound just fine because of the command line tags and I forgot about needing to actually start the instr.

thanks again!

1 Like