[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] question regarding \filter -> Function



Hi ppl,

I have a question regarding the \filter slot of a NodeProxy. I would like to do the following:


p = ProxySpace.push(s)

~f = {
    SinOsc.ar([300,1200],0,0.1)
}

~f.play

//access channel 1 of the 2 channel audio stream
~f[1] = \filter -> {
    arg in;
    in[0]
} This doesn't work; what is being played are both SinOsc's. Changing to in[1], plays the higher sinetone only. Could someone explain this behaviour, as I don't really understand what the type 'in' argument is, thus don't know how to access the audio streams independently? Just from a gut-feeling I find it quite intuitive to access the input stream as an array, like with other multichannel audio streams.


the proxy has 2 channels, your filter only one, so it does not override all. Two ways to do it:

//access channel 1 of the 2 channel audio stream
~f[1] = \filter -> {
    arg in;
    Pan2.ar(in[0], -1)
}
//access channel 1 of the 2 channel audio stream
~f[1] = \filter -> {
    arg in;
    [in[0], 0]
}
--





.