Hello!
I would like to use different patterns to create some scores and then be able to combine them into one so I can render them into one file. I want to be able to program when each score starts and ends.
for example score1 (made from patterns) will start at x time and end x+10, then score2 will start at x+5 and end at x+20 etc…
How can i render the different scores as one with .recordNRT
I upload some code (that doesn’t work as wanted) to illustrate the issue.
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],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);
q = PmonoArtic(
\buf1,
\bufnum, Pseq([1],inf),
\rate, Pseq([5,8,3],inf)*1,
\start, 0,
\time, 0.1,
\dur, Pkey(\rate).reciprocal,
\legato, 1,
).asScore(duration: 10, timeOffset: 10);
// 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.sort;
q.add([10.0, [\d_recv, def.asBytes]]);
q.add([10.0, Buffer.new(server,2048,1,bufnum:1).allocReadMsg(Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff")]);
q.sort;
//how can i combine x and q so then render them as one with recordNRT??
~outFile =(("~/Desktop/test.aiff").standardizePath);
x.recordNRT(
outputFilePath: ~outFile.standardizePath,
sampleRate: 44100,
headerFormat: "AIFF",
sampleFormat: "int16",
options: server.options,
duration: 20
);
server.remove;
)