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

Re: [sc-users] trying to understand multichannel expansion



Jonatan Liljedahl wrote:
> First, it seems that an array inside a toplevel array does not expand
> but is mixed instead, but I can't find any note about this in the docs
> about multichannel expansion. example:
> 
> {SinOsc.ar([[100,120],[105,125]],0,0.2)}.play
> 
> The left channel is the sum of two sines with 100 and 120 hz, the right
> 105 and 125...
> 
> But, I have a question regarding this:
> 
> f={({SinOsc.ar({rrand(30.0,800)}!20,0,LFNoise1.ar(0.1,20,21)).tanh}!2)*0.05}
> 
> SynthDef(\test,f).dumpUGens
> 
> why is the *0.05 duplicated for each of the 40 oscillators? I was
> expecting one for each of the two output channels.
> 

I think this has to do with the way multiplication by a nested array is interpreted.

[[0, 1, 2, 3], [4, 5, 6]] * 0.5;
=> [ [ 0, 0.5, 1, 1.5 ], [ 2, 2.5, 3 ] ]

A workaround is f = {({
var sig = SinOsc.ar({rrand(30.0,800)}!20,0,LFNoise1.ar(0.1,20,21)).tanh}!2);
sig*0.05}

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/