Probably, Pan2
documentation should include the way of dealing with multichannel input signals. For the non-programmers or musicians, detailed information similar to the following examples might be helpful.
// ex. 1:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], 0.5).scope * 0.02 }.play
// wrong.
// ex. 2:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], SinOsc.kr(0.1, [0, 1/3, 2/3]*2pi)).scope * 0.02 }.play
// wrong.
// the reason for wrongness: Pan2 distributes mono input channel to two output channels.
// Remember that output channel three is available only when the server is booted with an appropriate server option like the following example:
// s.options.numOutputchannel = 3;
// The following five examples show how the individual channels react with Pan2.ar.
// ex. 3-1. the first channel of a three channel input:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], [ SinOsc.kr(0.1), 0.5, 0.5]).scope * 0.02}.play
// ex. 3-2. the second channel of a three channel input:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], [0.5, SinOsc.kr(0.1), 0.5]).scope * 0.02 }.play
// ex. 3-3. the third channel of a three channel input:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], [0.5, 0.5, SinOsc.kr(0.1)]).scope * 0.02 }.play
// ex. 3-4. the first channel of a two channel input:
{ Pan2.ar(SinOsc.ar([220, 880]), [-1, 1], [ SinOsc.kr(0.1), 0.5]).scope * 0.02}.play
// ex. 3-5. the second channel of a two channel input:
{ Pan2.ar(SinOsc.ar([220, 880]), [-1, 1], [0.5, SinOsc.kr(0.1)]).scope * 0.02 }.play
// However, adding ".sum" to the output of Pan2.ar can fix this.
// ex. 4:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], 0.5 ).sum.scope * 0.02 }.play
// works!
// ex. 5:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], SinOsc.kr(0.1, [0, 1/3, 2/3]*2pi)).sum.scope * 0.02 }.play
// works!
// ex. 6-1. automated example to inspect the output of input channel 1:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], [1, 0, 0] * SinOsc.kr(0.1, [0, 1/3, 2/3]*2pi)).sum.scope * 0.02}.play
// ex. 6-2. automated example to inspect the output of input channel 2:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], [0, 1, 0] * SinOsc.kr(0.1, [0, 1/3, 2/3]*2pi)).sum.scope * 0.02 }.play
// ex. 6-3. automated example to inspect the output of input channel 3:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), [-1, 0, 1], [0, 0, 1] * SinOsc.kr(0.1, [0, 1/3, 2/3]*2pi)).sum.scope * 0.02 }.play
// ex. 7. mouse control example for a 3-channel input signal:
{ Pan2.ar(SinOsc.ar([220, 880, 3520]), MouseX.kr([-1, -0.3, 1], [1, 0.3, -1])).sum.scope * 0.02 }.play
// ex. 8. mouse control example for a 2-channel input signal:
{ Pan2.ar(SinOsc.ar([880, 5500])* 0.01, MouseX.kr([-1, 1], [1, -1])).sum }.play
// Please consider to use Balance2.ar for 2-channel inputs and Splay.ar for multichannel inputs.