SplayZ crashing the server?

Hi!

I am trying to spread the band of a vocoder like Splay, but over a loudspeaker ring, then I am passing the bands through SplayZ. However it is crashing the server everytime I run it…

Server ‘localhost’ exited with exit code -1073741819.
server ‘localhost’ disconnected shared memory interface

Any idea on how to solve this?

(
var bands;
bands = 11;//29 or 11;
s.waitForBoot({

	var synth, n=bands;
	w = Window.new(bounds: Rect(300,300,bands*13+30,390)).front;
	m = MultiSliderView(w,Rect(10,10,bands*13+12,370)); //default thumbWidth is 13
	// m.value=Array.fill(n, {|v| v*(1/bands)}); // size is set automatically when you set the value
	m.value=Array.fill(n, {|v| 0.75}); // size is set automatically when you set the value

	SynthDef(\vocoder,{
		var car, mod, dry, sig, wet, bpfmod, num = 30, q = \q.kr(16),
/*		bpfhz = \bpfreq.kr([25,31,40,50,63,80,100,125,160,200,250,315,400,500,630,800,1000,1250,1600,2000,2500,3150,4000,5000,6300,8000,10000,12500,16000], 0.1); */
		bpfhz = \bpfreq.kr((-5,-4..5).collect({|i|1000*(2**(i/3))}), 0.1);
		var track, bpfcar, mix = \mix.kr(0.5);
		mod = PlayBuf.ar(1, b, BufRateScale.ir(b), loop: 1);
		car = CombL.ar(WhiteNoise.ar(), 1/20, 1/\freq.kr(50), 3);
		//car = PinkNoise.ar(6);
		//car = LFSaw.ar(100);
		bpfmod = BPF.ar(mod, bpfhz, 1/q, \amp.kr(1.0!bands, 0.1));
		track = Amplitude.kr(bpfmod).lag(0.001) * 2;
		bpfcar = BPF.ar(car*3, bpfhz, 1/4, sqrt(q)) * track;
		dry = mod;
		wet = SplayZ.ar(8, bpfcar.scramble, \spread.kr(1.0), \level.kr(1.0), \width.kr(0.0), \center.kr(0.0))*5;
		sig = dry.blend(wet, \mix.kr(0.5));
		Out.ar(0, sig);
	}).add;

	s.sync;
	x = Synth(\vocoder);

	//x.set(\freq, (-13,-12..12).collect({|i|1000*(2**(i/3))}));

	m.action = { arg q;
		//q.value[0].postln;
		q.value.postln;
		x.set(\amp, q.value);
	};

});
)

x.set(\mix, 0.6);

Hm, no crash here.

Which OS/version? Which SC version? (These are usually relevant for crashing issues.)

Also note that SplayZ lives in a file called “deprecated-3.10.sc,” meaning that this class should not be used. In fact, after adding a Buffer to your example, it posts:

WARNING: Called from SynthDef:buildUgenGraph, method Meta_SplayZ:ar is deprecated and will be removed. Use Meta_SplayAz:ar instead.

SplayAz adds the “orientation” parameter.

Also, it’s silent when you have \width.kr(0.0) and started making sound for me with \width.kr(1.0).

hjh

I am running SC 3.14.0 on Windows 11 / 24H2.

Is there a way to replicate the behavior of SplaZ on the language side?

Both SplayZ and SplayAz are based on one PanAz per input channel, with slightly different formulae for the pan parameters, and mixing them all down.

So you could read the SplayZ formula and, worst case, recreate it manually – though the help files for SplayZ and SplayAz point out the ways that the SplayZ formula is incorrect.

I have half a suspicion that width = 0 may be the issue…? “Shouldn’t” cause a crash but, as PanAz help notes, “Values less than 1 will leave silent gaps between speakers” suggesting that width = 0 means an infinite gap, whose usefulness escapes me. Perhaps the math when width = 0 ends up doing something naughty in the Windows build that doesn’t happen on other platforms.

hjh

Thanks! Indeed \width.kr(0.0) was crashing the server…

I’ve also noticed that SplayAz is implemented, so I guess it will work properly