Selecting CHOP channels using their index

Hey I was wondering if it is possible to select several channels, using their channel index instead of their name?

Say for example I have a noise CHOP outputting nine channels named chan_[asdfghjkl]
I would like to connect something like a Select CHOP, and be able to select only the first channel (chan_a), or select the first and last (chan_a and chan_l), or a group of channels, regardless of their name, just by looking at their index.

I was able to select one channel using this expression in the channel name parameter of a Select CHOP:
me.inputs[0][int(op('null_with_index')[0])].name
where ‘null_with index’ is a null CHOP, connected to a constant CHOP with one value.

I was wondering if it is possible to select several channels? say index 0 to 3, index 4 to 9, or index 2,4,6,8 for example. In some way similarly to the Select DAT.
I would like to keep it in CHOP land, without going via DATs as I will be dealing with a lot of channels with changing values.

Any hint to send me in the right direction?

PS: file attached to show where I got to so far
Select by channel index.toe (3.7 KB)

If you aren’t married to naming your channels chan[asdfjkl], you can do this really easily by giving them number suffixes instead that reflect their index. Then you can use an expression like chan_[2-5] to select a range of channels. Or chan_[2,4,6,8] to select a group of individual channels.

Hope this helps!

Try the Delete Chop, deleting by channel range.

hey Chris @riebschlager,
thank you so much for the suggestion, but for the type of application I need this time around, selecting using pattern matching unfortunately it’s not going to work.

Evan Pierre @evanpierre, the Delete CHOP indeed has the feature that I was looking for, thank you for pointing me in that direction.
The only problem is that the Delete Chop does the exact opposite of what I am trying to achieve!
However with a little workaround it just worked perfectly for what I needed to do. Thank you for the suggestion !!!

Fausto

Glad that helped.

The Delete Chop can be used to select by choosing whether to delete scoped or non-scoped channels.

yes, pretty neat hey!
they should call it Delete/Select CHOP !