I actually looked into doing this but it's not that easy. There is an Csound API method that will give us the list of channels, but only if we declare them first in instr 0 space, just before the first
instr definition. This is rather impractical as it means we potentially have to declare every channel we use in the top of our Csound file. I'll keep looking and see if I can find a way. It is a nice idea.