In this example I have a 2 seg Env. The score renders when Env.newClear(5) but 6 or more results in a 0 length wave output.
How can I insert larger segments? Should I Zero pad them?
I also considered having Line.ar(argA, argB, time), and drive the envelope segment by segment from the score, but I couldn’t figure out how to get Line.ar to retrigger. Does that make more sense?
(
var server = Server(\nrt,
options: ServerOptions.new
.numOutputBusChannels_(2)
.numInputBusChannels_(2)
);
var ss = SynthDef(\NRTsine, { arg out, amp=0.2, trig=1;
var env = Env.newClear(6); // <<--- changing this to > 5 causes 0 length wave file
var env_ctl = \env.ar(env.asArray);
var freq = EnvGen.ar(env_ctl, trig, doneAction: 14).midicps;
Out.ar(out, SinOsc.ar(freq, 0, amp).dup)
}).asBytes;
a = Score([
[0.0, ['/d_recv', ss]],
[0.0, (Synth.basicNew(\NRTsine, server, 1000)).newMsg(args: [out: 0, env: Env([60,70,60], [1.0,1.0], [0,-0.5]), amp: 0.5, trig: 1], addAction: 'addToTail')],
]);
a.recordNRT(
outputFilePath: "~/nrt-help.wav".standardizePath,
headerFormat: "wav",
sampleFormat: "float32",
options: server.options,
duration: 4,
action: { "done".postln }
);
server.remove;
0.exit
)