Cabbage Logo
Back to Cabbage Site

cabbageGetWidgetChannels and filters

I am checking out using filters with cabbageGetWidgetChannels, and I found something curious. The first screen capture is from the run without a filter, and the second is a run that filters for “_info(1)”.
Screen Shot 2021-07-09 at 1.45.24 AM
Screen Shot 2021-07-09 at 1.43.10 AM

In the first, you will notice the two channels ‘pitmodwave’ and ‘pitmodfreq’. In the second, those channels are now ‘pitmodwav’ and ‘pitmodfre’.

Let me know if you want me to send my files.

I think this is already fixed in the latest beta. I came across it myself a few days ago :wink:

OK, I’ll have to find a time to get the latest. The last few times that I accessed Azure, it was crawling! It literally couldn’t load your main page after 5 minutes. I just gave up. Not sure if it is my connection or their website…

OK, the channel names issue is gone, but now my overlay images have lost their transparency.

I think this should be Ok in the latest build. I screw up images in a recent push. :roll_eyes:

I think I got the latest build. 2.7.7 right? I was able to download the latest azure build this morning with my phone.

Anyway, this has been a productive couple of days. I just wish the CSound docs for ‘opcode’ were more complete. Had I known that you could pass and return arrays, I might have done a few things different.

So, now to finish with my presets… Then release!

1 Like

Can the filters be an array or multiple identifiers?

Could be, but aren’t right now. I can add support for them tomorrow.

This is possible now. Just triggered a new build :+1:

1 Like

Thanks for this! But is it possible to have an array of identifiers (eg. “rslider”, “nslider”…) rather than by channel name? That way if I add controls/features I don’t have to worry about adding it to the array.

Thing is I have a bunch of widgets and would rather save them all and then use the ignore filter later to parse out the ones I don’t want to reload.

Your can use type("rslider") if you want to get rsliders?

But why not just give them a unique identifier, would this not be easier?

Ah - we can add our own generic identifiers? I’ve just been using “popupPostfix” for anything I wanted to track…

Use an underscore to define custom identifiers. Check the example I linked in a few posts up.

Btw, you can also use cabbageGet to get the value of any custom identifiers.

So, I’ve got this working now, except it seems that ‘presetIgnore’ is itself ignored. What are we supposed to do if we don’t want a widgets state to be stored in a preset? Specifically, I have an oscillator that has the option to mute it’s output, but it isn’t part of the patch, as it is intended to be used for testing a working patch.

Don’t confuse these channel state save/recall opcodes with Cabbage’s own native presets. presetIgnore() will not work here. Instead, you should simply ignore whatever channels you want when recalling the channel data. There is an SIgnoreChannels[] argument that you can pass to cabbageChannelStateRecall.

I do this in the example .csd. If I didn’t the instrument would go into a recursive loop of sorts.