Best way to use variables

My naive implementation makes me realise that for this to work we need to be able to able to control widget visibility through other means. One possible solution would be to have a reserved channel that holds a list of widgets that are to be polled. This wouldn’t break any existing code, and could easily be added to earlier instruments. We just have to come up with a possible syntax. Maybe something like:

chnget "widget_channel1:widget_channel2: ...", "REMOVE_WIDGET_POLLING"
chnget "widget_channel1:widget_channel2: ...", "ADD_WIDGET_POLLING"

Or a way to enable or disable in single go:

chnget "widget_channel1:1 widget_channel2:0 ...", "WIDGET_POLLING"

where widget_channel is the channel given to a particular widget. 0 or 1 will enable/disable the widget. Note it would only apply to widgets that use channels as they are the only ones queried on each k-cycle. It should be relatively simple to maintain a list of widgets in Csound and update accordingly. Let me know what you think. The performance gains might not be that much as we will still need to check the polling channel on each k-cycle. But it might be worth a shot.