Quick stereo pan question

Then this line is wrong…

~valtozo = Array.series(5,261,68);

That implies you want to hear the frequencies [261, 329, 397, 465, 533].
If you do this:

SinOsc.ar(~valtozo).postln 
-> [ a SinOsc, a SinOsc, a SinOsc, a SinOsc, a SinOsc ]

You can clearly see all 5 sine waves.
By putting them into Pan2, you get this…

Pan2.ar(SinOsc.ar(~valtozo)).postln
-> [ 
   [ an OutputProxy, an OutputProxy ], 
   [ an OutputProxy, an OutputProxy ], 
   [ an OutputProxy, an OutputProxy ], 
   [ an OutputProxy, an OutputProxy ],
   [ an OutputProxy, an OutputProxy ] 
]

i.e., 5 nested stereo channels.
The fact that supercollider made any sound should be considered a bug - what on earth does it mean to listen to nested array? Supercollider has done some weird mixing of the signals to try and correct your mistake. You can see this more clearly if you do this…

{
	~valtozo = Array.series(5,261,68);
	Pan2.ar(SinOsc.ar(~valtozo,mul:MouseY.kr(0.0,1.0)), pos:(MouseX.kr(-1,1)))* 0.20;
}.scope;

The code @semiquaver has posted mixes all 5 sine waves into a mono sound and then pans them - the most logical given the code. Could you describe in words exactly what you to happen? If you only want 2 sine waves, then just change the array to the frequencies you want.

Was this what you where expecting?

{
	Pan2.ar(SinOsc.ar([261, 329]).sum, MouseX.kr(-1, 1), MouseY.kr(0, 0.2))
}.play
1 Like

Hi Jordan!
Thanks for the detailed explanation, now I understand the logic! :nerd_face: I have solved the problem. Sorry for the amateurish questions, I am just getting familiar with the software. :see_no_evil:

1 Like

Amateur

Borrowed from French amateur , from Latin amātōr (“lover”), from amāre (“to love”).

…welcome to the club!

1 Like