Hi there, everyone.
I’m trying to get a handle on NRT Synthesis, since it’s been coming up on the mailing list a bit lately. At the moment, I’m confused about something, though - how to load multiple SynthDefs. The following code seems to fail:
(
x = Pbind(
\instrument, Pseq([\one, \two, \three], inf),
\freq, Pwhite(100, 1000, inf),
\dur, Pseq([1/8, 1/8, Pwhite(0.005, 0.1, 1)], inf),
\amp, 1
).asScore(duration: 3*60, timeOffset:0.001);
x.add([0.0, [\d_recv,
SynthDef("one",
{|freq|
var sig = SinOsc.ar(freq)*EnvGen.ar(Env.perc(0.01, 0.1), doneAction:2);
Out.ar(0, sig)
}).asBytes;
SynthDef("two",
{|freq|
var sig = LFTri.ar(freq)*EnvGen.ar(Env.perc(0.01, 0.1), doneAction:2);
Out.ar(0, sig)
}).asBytes;
SynthDef("three",
{|freq|
var sig = LFSaw.ar(freq)*EnvGen.ar(Env.perc(0.01, 0.1), doneAction:2);
Out.ar(0, sig)
}).asBytes;
]]);
x.recordNRT(outputFilePath: “/Users/of/Desktop/longddso.aif”,
options: ServerOptions.new.numOutputBusChannels_(2), duration: 3*60,
action: { “finished”.postln });
)