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

Re: [sc-users] |i|



If you want the Mix.fill to return a stereo signal for instance, each iteration of function needs to return an array of two items. If you need a four channel output, each iteration has to return an array of four items.
+Eirik


On Mon, Dec 30, 2013 at 7:42 PM, Josh Parmenter <josh@xxxxxxxxxxxxxxxxx> wrote:
That's what Mix.fill does. It sums the results of the Function.

Josh

On Dec 30, 2013, at 10:41 AM, Alexandre de Faria Oliveira <alextiberiuskirk@xxxxxxxxxxx> wrote:

Thanks for responding,

but why  SinOsc.ar(arrayfreq[i]);  sum the array in one channel and without it becomes a multichannel?

Alexandre





From: josh@xxxxxxxxxxxxxxxxx
Subject: Re: [sc-users] |i|
Date: Mon, 30 Dec 2013 10:30:49 -0800
To: sc-users@xxxxxxxxxxxxxxxx

|i| is a shorthand for arg i;

Mix.fill passes an incrementer into its function, here you are giving that argument the name i... it will start at zero, and increate to arrayfreq.size-1

Best,
Josh

On Dec 30, 2013, at 9:47 AM, Alexandre de Faria Oliveira <alextiberiuskirk@xxxxxxxxxxx> wrote:

Hello List!

What does |i| means in this context?

Mix.fill(arrayfreq.size, {|i| SinOsc.ar(arrayfreq[i], arrayphase[i])});

I undestand that it´s a Argument, and empirically I found that without it becomes multichannel (generally I would solve it with a ".sum")

But I havent found in the help a explanation why or what is it.


******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/