By now you must be growing tired of the left-side-only sounds being produced by the examples.
The easiest way to output multichannel audio in SuperCollider is to use a kind of "Collection" (defined later) called an "Array." SuperCollider will theoretically handle any number of audio output channels, but by default is usually only configured for two-channel stereo audio. Since humans have only two ears, this is sufficient for most tasks! A multichannel array is notated like this: [ LeftChannel.ar( x ), RightChannel.ar( y ) ]
Here is our simple sine oscillator expanded to produce stereo audio:
{ [ SinOsc.ar( 440, 0, 0.2 ), SinOsc.ar( 440, 0, 0.2 ) ]; }.play;
Not much has changed, except that the audio we hear is now being emitted from both the left and right channels. Change the frequency of one of the sine oscillators to
450
and the difference will become much more apparent.
Multichannel arrays can also be combined with each other, like this:
{
var one = [ x, y, z ];
var two = [ a, b, c ];
[ one, two ];
}
If
a
,
b
,
c
,
x
,
y
, and
z
were all audio-rate UGens, this function could be
play
'ed. It would produce stereo audio, and each channel would have three independent UGens.