What's the secret to always play all sound in stereo rather than just left side?

I’m reading A Gentle Introduction to SuperCollider and some examples work but just sound in the left side, like this one:

{ SinOsc.ar(MouseX.kr(40, 10000, 1), 0, 0.1) }.play;
{ SinOsc.ar(MouseX.kr(500, 10000, 1).poll, 0, 0.1) }.play;

I already tried with another example:

{ SinOsc.ar([440, 800]) }.play;

I just want that all sound sounds in stereo.

It is up to you to pan your sound… the quick and easy is to wrap in Pan2, or even just call .dup on your signal:

{ Pan2.ar(SinOsc.ar(MouseX.kr(40, 10000, 1), 0, 0.1)) }.play
{ SinOsc.ar(MouseX.kr(40, 10000, 1), 0, 0.1).dup }.play

I HIGHLY suggest you go the pan route. .dup doubles the number of UGens being used and is less efficieint even if it is less to type.

SuperCollider makes no assumptions about WHERE in a speaker array a sound should be. I use a 16 channel set up, so people use 2, some 4 … and when you get to more sophisticated signal processing and routing, you’ll hit many less limitations with your mono source being placed where you want it to be. Defaulting to stereo would cause a larger number of problems in the end.

1 Like
{ SinOsc.ar([440, 800]) }.play;

should produce 2 channels of audio (440 cycles in the left and 800 in the right)

{ SinOsc.ar(MouseX.kr(40, 10000, 1), 0, 0.1) }.play;

will produce only 1 channel - if you want 2 identical channels, you can call .dup on the SinOscs

{ SinOsc.ar(MouseX.kr(40, 10000, 1), 0, 0.1).dup }.play;

that will sound in the center.

if you want to pan from left to right you can wrap your SinOscs a Pan2 UGen:

{ Pan2.ar(SinOsc.ar(MouseX.kr(40, 10000, 1), 0, 0.1), pos: SinOsc.kr(0.4))}.play;

Finally the Splay UGen is useful for spreading an arbitrary number of channels across the stereo (or multi-channel) field.

1 Like

Ok perfect. Knowing that SC doesn’t actually configure the panning now makes me understand more things. Thanks!