Thank you - but just to clarify here:
You mean that they are “supernova processes”, right? I think I’m still confused here.
If I understand correctly:
sclang parses some messages to “kick off” the NRT in the form of a score, those messages usually activate synths stored on sclang - but supernova could be used in place of sclang without too many major differences.
The big difference is that the processes must be “parallel” - so all signals that modulate or control each other must be kept within a single ParGroup, where it will operate on a single core.
So, if I wanted to create 5 simultaneous renderings of sine wave tones, outputting 5 .wav files - I could write something to execute 5 NRT scores at the same time, but give each instance its own ParGroup. supernova would manage distributing these instances over the available cores and I would not have much say in the matter…
Is this all correct?
So, something like the following code should be using the benefits of parallel processing…although, I’m getting an error when running it:
*** ERROR: in main(): boost::interprocess::bad_alloc
SynthDef("sine",
{|freq, out, gate=1|
Out.ar(out, SinOsc.ar(freq, mul: 0.1)*Linen.kr(gate, doneAction:2));
}).store;
Server.supernova;
Score.program = Server.program;
Task({
4.do{|i|
var server, chans = 2, duration = 100, pattern1, pattern2, nrtScore;
Date.getDate.postln;
pattern1 = Pbind(
\instrument, \sine,
\freq, Pwhite(0, 10000, inf),
\stretch, 1,
\dur, Prand([0.1, 0.05, 1], inf));
nrtScore = PparGroup(pattern1, inf).asScore(duration: duration, timeOffset:0.11);
nrtScore.recordNRT(outputFilePath: "/Users/bd/Desktop/"++i++".flac",
headerFormat: 'flac', //this allows longer files..?
sampleFormat: 'int16',
oscFilePath: "/Users/bd/Desktop/"++i++".txt",
duration:duration,
action: {
(Date.getDate).postln;
"NRT done".postln;
});
};
}).play;