Single channels from multichannel node-proxy

currently I have a node proxy that outputs 4 channels:

~b4 = {
    var a, b, c, d;
    #a, b, c, d = Limiter.ar(BandSplitter4.ar(~b4in, ~b4f1, ~b4f2, ~b4f3, 2), 0.9);
};

I would like to be able to grab single channels and route them places (i.e. sending only the third band to modulate something), but doing something like this does not work:

~b4in = ~dust; //route Dust Ugen to input
~out = {~b4[2]!2}; //route only 3rd band to output, then dup for stereo output
~out.play;

(yields error: “basic At not understood” as ~b4 isn’t a collection)

Is there any way to easily accomplish similar functionality?

One way to do this is with the .ar method of NodeProxy:

~b4 = NodeProxy.audio(s, 4);
~b4.source = {SinOsc.ar([1,2,3,4] * 220) * 0.2};
~b5 = NodeProxy.audio(s, 2);
~b5.play;

// route 1 random channel to ~b5:
~b5.source = {~b4.ar(1, 4.rand) ! 2}; // method 1
~b5.source = {~b4.ar[4.rand] ! 2}; // method 2

There are probably lots of other ways to do it, but I hope that one works for you!

1 Like