# CabbageSet vs chnset

**URL:** <https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952>\
**Category:** Cabbage Stew\
**Created:** [12 December 2025 15:34 UTC](https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952 "2025-12-12T15:34:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejo](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/alejo/32/4646_2.png) [@Alejo](https://forum.cabbageaudio.com/u/Alejo)\
**Post date:** [12 December 2025 15:34 UTC](https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952/1 "2025-12-12T15:34:24Z")

</div>

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 = 1

gkValue init 1024

instr 1

kEnv madsr .1, .2, .6, .4

aOut oscili p5, p4, 1

outs aOut_0.5_kEnv, aOut_0.5_kEnv  
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  
;------------------------------------

f 1 0 1024 7 0 1024 1 i "Update" 0 z f0 z

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [13 December 2025 19:42 UTC](https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952/2 "2025-12-13T19:42:02Z")

</div>

Hi @Alejo, are you using the latest beta package? This instrument works fine for me here. What version number are you on?

---

<div class="post-metadata">

**Author:** ![Alejo](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/alejo/32/4646_2.png) [@Alejo](https://forum.cabbageaudio.com/u/Alejo)\
**Post date:** [16 December 2025 20:28 UTC](https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952/3 "2025-12-16T20:28:58Z")

</div>

I’m testing with version 2.20.7. There may have been some confusion, since the attached code actually works fine.  
More specifically, now I added two code snippets to draw a madsr envelope using a gentable. The version that uses chnset works correctly (I’m happy with the result, and it doesn’t seem to consume many resources).  
The cabbageSet, does not work. That said, could it be that chnset is somehow better suited—or perhaps faster—for this kind of task that requires constant updates?

[gentable envelope cabbageSet (MADSR).csd](https://forum.cabbageaudio.com/uploads/short-url/v8eN7FZnYBD3TeK1kenbdqcQvOD.csd) (3.1 KB) [gentable envelope chnset (MADSR ok).csd](https://forum.cabbageaudio.com/uploads/short-url/yUP4jDFHgnXzHT3FvVIPxHMF78U.csd) (3.0 KB)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [18 December 2025 09:00 UTC](https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952/4 "2025-12-18T09:00:33Z")

</div>

Interesting. The older chnset system will work well so long as you didn’t have a lot of widgets. If it works well this way I’d stick with it.

---

<div class="post-metadata">

**Author:** ![Alejo](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/alejo/32/4646_2.png) [@Alejo](https://forum.cabbageaudio.com/u/Alejo)\
**Post date:** [18 December 2025 13:22 UTC](https://forum.cabbageaudio.com/t/cabbageset-vs-chnset/4952/5 "2025-12-18T13:22:28Z")

</div>

Yes. I saw that everything I was doing with `cabbageSet` I can do with `chnset` maybe with a little more work but possible. Things like alpha knobs at 0.5 when not in use, hiding knobs, loading audio files, etc. And I think in that case it’s better to use `identChannel` only on the widgets where it’s necessary
