NRT using large arrays and Demand UGens: ERROR: SynthDef test not found

Hello all,

trying to work with larger arrays in Demand UGens within NRT context and encountering the following error message when running this slimmed down example below. This seems to happen depending on the array size being passed to the synth:

nextOSCPacket 0
nextOSCPacket 0
nextOSCPacket 0
nextOSCPacket 0
nextOSCPacket 20
*** ERROR: SynthDef test not found
FAILURE IN SERVER /s_new SynthDef not found
nextOSCPacket 20
nextOSCPacket 20
(
fork{1.do({ |index|
	var options =  ServerOptions.new.memSize_(2**20).maxNodes_(8192).numAudioBusChannels_(800).numBuffers_(800).numWireBufs_(800);
	var server = Server(\nrt, NetAddr.localAddr, options);

	var dur=20;
	var n=1;
	var sr=48000;
	var array=Array.rand(1400,1,100.0), //increasing array size produces error in SynthDef. using integer arrays larger size possible

	def = ((
		(
			SynthDef(\test, {|amp|

				var demand=Duty.ar(1/10,0,Dseq(array,inf));

			}
			).store;
		);

		p= (Pspawner({|sp|
			sp.par(Pproto(
				{	~sbuf=(1.collect{ |index| ( ( type: \allocRead, path: Platform.resourceDir +/+ "sounds/a11wlk01.wav").yield)});
				},Pbind(
					\instrument, \test,
					\dur,dur,
					\bufA,  Pfunc { |ev| ev[\sbuf]},
					\addAction, \addToTail,
				);
			))
		}).asScore(dur));


		(n.do({|i| p.add([0.0, [\b_alloc, (2*8)+(i),4*sr,1]]);}););
		(n.do({|i| p.add([0.0, [\b_alloc, (3*8)+(i),4*sr,1]]);}););
		(n.do({|i| p.add([0.0, [\b_alloc, (4*8)+(i),4*sr,1]]);}););
		(n.do({|i| p.add([0.0, [\b_alloc, (5*8)+(i),8*sr,1]]);}););

		p.sort;

		p.recordNRT(
			outputFilePath:"/Users/jan/Sound/test.wav".standardizePath,
			sampleRate: sr,
			headerFormat: "WAV",
			sampleFormat: "int24",
			options: o,
			duration: dur
		);

));})}
)

Any idea why or is there a resource that can be allocated/changed to avoid this?
I didn’t get this error message on a previous computer with the same parameters…

Thanks,
Jan

I don’t know why it would be different on different machines, but… SynthDefs are really not designed to store large data sets in the SynthDef itself. Past a couple hundred points, I would load the data into a Buffer and use Dbufrd. You’re at 1400 which is very well large enough to make a Buffer more practical.

hjh

thanks, i was just surprised that it showed up while in the past it didn’t…
I’ll most probably have to go with dbufrd, just in my use case I was relying on using language operations on the arrays, but I’m sure I’ll be able to work around that with buffers!