Why am i getting a stereo output?

Can anyone explain me why im getting a stereo output from this:

{FreeVerb.ar
(MoogFF.ar
(SinOsc.ar(LFNoise0.kr((0.1..2).rand).exprange(220, 440)) *

Saw.ar(LFNoise0.kr(0.01).exprange(110, 220)) * Saw.ar(LFNoise0.kr(0.1).exprange (55, 110)),

SinOsc.kr(0.01).range(0, 4000), 2),
0.6, 0.6, 0,5)

}.play

If i do instead (0.1…1).rand i get (as it should be) a mono output.

It’s because (0.1..2) generates an array with two elements (which results in a two-channels signal):

(0.1..2) // -> [0.1, 1.1]
(0.1..1) // -> [0.1]

the (a..b) notation is a shorthand for Array.series. (0.1..2) it’s a series that starts from 0.1, ends at 2, and has a step of 1 (that’s the default). To specify a different step, there is the (start, step .. end) syntax

(0.1, 0.2 .. 1) // -> [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]

More info here:
https://doc.sccode.org/Reference/Syntax-Shortcuts.html#creating%20arithmetic%20series

If you wanted to specify a range for your random number, you could write it like this:

rand(0.1, 2) // a random number between 0.1 and 2
1 Like

see:

https://doc.sccode.org/Guides/Multichannel-Expansion.html

1 Like