Cabbage Logo
Back to Cabbage Site

Chnset values not working

Hi! I am feeling truly baffled by a problem I’m having…

ChnsetProblem.csd (2.1 KB)

I’ve wittled it down to the basics… but basically what I’m trying to do is use checkboxes as selectors, so only 1 should ever be lit at one time. For the purposes of testing, I have started with 2 of the checkboxes on, but if all was working properly, the first checkbox should instantly be turned off.

I have done alot of testing using prints in various places, and the only problem I can see is that chnset doesn’t seem to be setting my values. I have no idea what I’m doing wrong, and the program compiles properly, so if anyone can spot what I’m doing wrong (or even if they might know a better way of achieving what I’m doing with the checkboxes?) that would be fantastic!

ps. Bonus points for anyone who can tell me why my instrument is only being called once despite a schedule call at the end of the instrument that should call it again… I also just tried adding another instance in the score which also didn’t work… I’m very confused! :S

Can you not do what you want just by setting all the checkboxes to the same radiogroup? Before Rory introduced the radiogroup feature I was doing similarly complicated stuff to achieve this, I think he took pity on me.

In your schedule statement you have misspelt the instrument name, is this the problem?

schedule "StepSelelct", 0.1, 0.1

1 Like

I hadn’t seen radiogroup() before, it’s not in the documentation for checkbox at least, but I just looked through some recipes after I read your response and found it being used in monobomb. That has fixed at least part of my code, though I still can’t understand why the chnsend wasn’t working.

As for the schedule statement, changing that hasn’t helped. I also have tried just manually adding extra instances to the score, but it still only activates the first one… but… I just noticed that I’m not getting sound today. If the audio output wasn’t working, would it run the first initialisation and k-cycle and then freeze? that might explain that issue

Yeah… it’s because I opened jackd after cabbage. Classic school boy error! I’d be willing to bet the chnsend works now aswell. Sorry about that! Lol. But at least I now know about radiogroup() :grin:

Sorry guys about the missing info in the docs. We updated some things and I think the most recent docs are not the most up to date. Sorry about this. I’ll look into it.

If you’re setting a valuator widget to a specific value you can just send it that value on its normal communication channel, you don’t need to use the identchannel. So:

chnset "value(0)", "sel1"

can just be:

chnset k(0), "Sel1"

1 Like

No worries man! Can’t keep on top of everything all the time. Btw, while on the subject of the docs, I noticed a broken link:

Cabage Widgets -> Sliders -> Range description:

the “Endless Encoders” link goes to:

http://cabbageaudio.com/docs/sliders/encoder.md

and I’m guessing it’s meant to go to:

http://cabbageaudio.com/docs/encoder/

:wink:

Ah, nice one! That will simplify things

Hey guys, this seems related. Can anyone tell me why this checkbox isn’t turning blue for me? It’s taking it’s new position ok, and changes blue if I initially define the colour. The same code works fine for an image widget.

Edit: Ok so chnset "colour:0(0,0,255)" works ok, but I get nothing from chnset "colour:1(0,0,255)"
Easily worked around by reversing states, but still puzzling.

I’ll file this as a bug. Good spot. It’s on the list of things to fix!