Hello,
is possible to change the preset of a combobox from csound (the idea is to make presets midi controllable)?
I’ve got something along these lines:
combobox bounds(10, 20, 350, 30), channel("combobox"), populate("*.snaps"), identchannel("pre_set")
filebutton bounds(10, 50, 350, 20), channel("butsave"), text("Save", "Save"), mode("snapshot")
than in csound:
instr 1
kpres init 2
ktrg metro 1
if ktrg == 1 then
kpres = (kpres+1) % 2
event "i", 5, 0, -1, kpres + 1
endif
endin
instr 5
print p4
Svalue sprintf "value(%d) ", p4
chnset Svalue, "pre_set"
turnoff
endin
But obviously don’t work, instr 5 gets triggered but combobox don’t change.
When changing preset via combobox (it works as expected) the output of combobox (read with this)
kcombov chnget "combobox"
printk2 kcombov
gives me 1 for the first preset and 0 for the all others (I was expecting corresponding numbers).
Is this a limitation in “*.snaps” system? Am I missing something?