Hey!
here is an simplified version so I can illustrate the issue…
Although the overall length of the audio should be around 25 sec, I changed the length to 6s so you wont need to wait too long since the problem in this instance starts around 4s.
First I generate some random envs so it can run.
28131 is the number of envs from the external data.
(
~size={rrand(2,5)}!28131;
~time=Array.new;
~time4Env=Array.new;
(~size.size).do({|i,index|
~time=~time.add( rrand(1,20.0));
~time4Env=~time4Env.add( rrand(0.0001,20))});
~time4Env.sort;
)
(
var server = Server(\nrt2,
options: ServerOptions.new
.numOutputBusChannels_(2)
.numInputBusChannels_(2)
.memSize_(819200)
.maxNodes_(1700000)
.maxSynthDefs_(1700000)
.blockSize_(32/8)
.numAudioBusChannels_(1700000)
),
defaultGroup = Group.basicNew(server);
var pnotes, group,playsin;
var score, now;
score = CtkScore.new;
pnotes = CtkProtoNotes(
SynthDef(\sin, {arg buffer, freq= 1, amp,pan,outbus,duration;
var envperc=EnvGen.kr(Env.sine(duration, 1),doneAction: 2);
OffsetOut.ar(0,
Pan2.ar(
SinOsc.ar(freq,mul: amp)envperc0.2,pan));
}).load(server)
);
playsin= {arg starttime, duration, freqenv,ampenv, panenv,buss;
var note, now, ratio, rate;
pnotes[\sin].note(starttime,duration)
.freq_(CtkControl.env(freqenv))
.amp_(CtkControl.env(ampenv))
.pan_(CtkControl.env(panenv))
.outbus_(buss)
.duration_(duration)
.addTo(score);
};
score.add([0.0, defaultGroup.newMsg]);
~size.do({|i,index|
var size=i;
var time=({rrand(0.1,1.0)}!(size-1));
var timesum= (time.sum );
var start=(~time4Env[index]);
playsin.value(start, timesum,
Env(((({rrand(0,10000.0)}!(size)))),time,\lin),
Env(((({rrand(0,1.0)}!(size))/10)),time,\sin),
Env((({rrand(-1,1)}!(size))),time,\sin),
) ;
});
score.write(“/SuperColliderRecordings/nrt_test.aiff”.standardizePath,6,sampleRate:44100,sampleFormat:“float”, options: server.options/.numOutputBusChannels_(2)/);
server.remove;
)
thanx again!