Hello! For now I’m still using Cabbage 2; when I have time, I’ll go back to trying Cabbage 3.
I’d like to ask something about cabbageSet and chnset. I did some tests based on examples to visualize a table in gentable being modified in real-time (something I plan to use with an envelope).
With cabbageSet I saw that it can be done, but it becomes unstable (based on the “Gentable Example”) and always ends up crashing. I found Iain McCurdy’s “GEN07” example where chnset is used. I did a test with chnset and it didn’t crash, but then I discovered that combining it with tablecopy works smoothly without crashes.Is there any way to do the same with cabbageSet and achieve the same stability?
It seems that the problem is the high update rate. At one point I tried to reduce it with a metro:
if (kChanged == 1 && kMetro == 1) then…
…but it became very slow and missed some updates.
I’m asking if it’s possible to do something similar in a correct way with cabbageSet, because using chnset implies not using guiMode(“queue”), which means cabbageSet and cabbageGet cannot coexist with chnset, and I have several useful things that I do with them.
Here’s the small test code — everything runs smoothly here with chnset:
form caption("Untitled") size(400, 500), colour (0,0,0) gentable bounds( 15, 30, 225, 120), tableNumber(1), tableColour("blue"), tableBackgroundColour("black"), tableGridColour(230,230,230,50), identChannel("table"), ampRange(0,1,1), zoom(-1), active(1) keyboard bounds(10, 334, 381, 95) rslider bounds(42, 226, 60, 60) identChannel("value") range(1, 1024, 1024, 1, 1) valueTextBox(1) channel("rslider6") -n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5 -m0d ; Initialize the global variables. ksmps = 32 nchnls = 2 0dbfs = 1gkValue init 1024
instr 1
kEnv madsr .1, .2, .6, .4
aOut oscili p5, p4, 1
outs aOut0.5kEnv, aOut0.5kEnv
endin
instr Update
gkValue chnget “rslider6”
kChanged changed gkValue
if (kChanged ==1) then
tablecopy 1, 2
chnset "tableNumber(1)", "table" ; update table display
reinit UPDATE
endif
UPDATE:
i2 ftgen 2, 0, 1024, 7, 0, i(gkValue), 1
rireturn
endin
;------------------------------------

