Pan only works within waitForBoot on my SCNvim setup

Hi

I am using the SCNvim environment to write music, but for a while I have had this weird bug.

When running a simple Synth that should have stereo out, it only sounds in the left channel, even tho i set the output bus to [1]. It is only when I wrap everything in a waitForBoot that the routing works properly.

SynthDef.new(\test, {
  var sig;
  sig = PinkNoise.ar(0.2);
  sig = PanAmbi3O.ar(sig, MouseX.kr(-pi, pi));
  Out.ar(0, sig);
}).add;

I’ve tried it with a regular Pan2.ar() as well, with the same issue.

I am trying to do an Ambisonics project, so this could be a big problem. Any thought on why this could happen?

It also seems that if I remove the waitForBoot, and try to add a new SynthDef with the old name, it will use the new one, but the old one, even when evaluating SynthDef and Synth separately where no race-condition should appear.

Huh… yeah, weird. I can’t speak to PanAmbi3O because it’s an extension from… somewhere. I don’t have it installed and it’s not stated where to get it, so I can’t try it here.

But if Pan2 reproduces it, then a “minimal working example” would use Pan2 (minimal reproducer should prefer core UGens).

The first thing I would check, just to be sure, is:

SynthDef.new(\test, {
	var sig;
	sig = PinkNoise.ar(0.2);
	sig = Pan2.ar(sig, 0);
	Out.ar(0, sig);
}).add;

a = Synth(\test);

s.meter;  // here!

a.free;

This is to confirm that both channels are being written to the L and R output busses. This should be the case, but, when you’re seeing weird behavior, it’s good to eliminate all possible variables.

If you see only one channel in the vu meter, then something is very weird (= this should be impossible).

If you see both, but hear only one, then the problem must be in the connection between scsynth and the audio output. This is much more likely.

Which OS are you running? Because the connection mechanism is different per OS.

If SCNvim, I might assume Linux. If so, what do you get from the following?

// useful in Linux; not useful in Win or Mac

"echo $SC_JACK_DEFAULT_OUTPUTS".unixCmd;

I get system meaning that scsynth out_1 → system:playback_1 and so on, in sequence.

Are you changing anything in ServerOptions before booting the server?

hjh

It seems to have solved itself, which of course is not the case… But I had tried both minimal working examples of Pan2, as above and with the desired Ambi-Pan, but no change. Until it just worked as usual the next day.

I know this has been an issue for me before, but I cannot pinpoint where I might have written a line wrong for it not to work. To my memory, I didn’t change a thing. Anyway…