Hello!
I am trying to render a pattern score in NRT mode. I can load an existing file from my computer and play it with Playbuf, but when I want to create my own sample from lets say Signal, for some reason it seems that the sample is not loaded to the buffer.
I posted an example code,
Buffer 1 is the existing sample from my computer, and 2 is made from Signal.
The gaps you hear in the audio is when Playbuf plays from buffer 2 , so there is no audio.
To test it please put your own render location.
Why is this happening? Any help would be really appreciated…
thank you!
(
var server = Server(\nrt,
options: ServerOptions.new
.numOutputBusChannels_(2)
.numInputBusChannels_(2)
),
def = SynthDef(\buf1, { |out, bufnum, rate = 1, time = 0.1, start = 0, amp = 0.1,dur|
var release= Line.kr(0,1,(rate.reciprocal),doneAction: 0);
var sig = PlayBuf.ar(1, bufnum, rate*(2048 / Server.default.sampleRate),Impulse.kr(rate), startPos: start);
Out.ar(out, (sig*0.5 ).dup);
});
def.add; // the pattern needs the def in the SynthDescLib
x = PmonoArtic(
\buf1,
\bufnum, Pseq([1,2],inf),
\rate, Pseq([5,8,3],inf)*1,
\start, 0,
\time, 0.1,
\dur, Pkey(\rate).reciprocal,
\legato, 1,
).asScore(duration: 10, timeOffset: 0.001);
// the score also needs the def and buffer
x.add([0.0, [\d_recv, def.asBytes]]);
x.add([0.0, Buffer.new(server,2048,1,bufnum:1).allocReadMsg(Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff")]);
x.add([0.0, Buffer.new(server,2048,1,bufnum:2).loadCollection(Signal.sineFill(2048, 1.0/[1, 2]))]);
x.sort;
~outFile ="/Desktop/nrttiming3.aiff";
x.recordNRT(
outputFilePath: ~outFile.standardizePath,
sampleRate: 44100,
headerFormat: "AIFF",
sampleFormat: "int16",
options: server.options,
duration: 10
);
server.remove;
)