I successfully managed to get the code rendered in NRT mode ( latest SC 3.10.2), but all I got from rendered file is silence.
▼ Wavetable.
~wt_sig = 10.collect({
arg i;
var numSegs = i.linexp(0,9,4,40).round;
Env(
[0]++({1.0.rand}.dup(numSegs-1) * [1,-1]).scramble++[0],
{exprand(1,i.linexp(0,9,1,50))}.dup(numSegs),
{[\sine,0,exprand(1,20) * [1,-1].choose].wchoose([9-i,3,i].normalizeSum)}.dup(numSegs)
).asSignal(1024);
});
~wt_buf = Buffer.allocConsecutive(10, s, 2048, 1, {
arg buf, index;
buf.setnMsg(0, ~wt_sig[index].asWavetable);
});
▼ SynthDef ( thanks Eli Fieldsteel)
SynthDef(\osc, {
arg buf=0, freq=200, detune=0.2,
amp=0.2, pan=0, out=0, rout=0, rsend=(-20),
atk=0.01, sus=1, rel=0.01, c0=1, c1=(-1);
var sig, env, detuneCtrl;
env = EnvGen.ar(
Env([0,1,1,0],[atk,sus,rel],[c0,0,c1]),
doneAction:2
);
detuneCtrl = LFNoise1.kr(0.1!8).bipolar(detune).midiratio;
sig = Osc.ar(buf, freq * detuneCtrl, {Rand(0,2pi)}!8);
sig = Splay.ar(sig);
sig = LeakDC.ar(sig);
sig = Balance2.ar(sig[0], sig[1], pan, amp);
sig = sig * env;
Out.ar(out, sig);
Out.ar(rout, sig * rsend.dbamp);
}).add;
▼ NRT.
var pat1;
pat1 = Score([
[0.1,
[\s_new, \osc, 1001, 0, 0, \freq, 45.midicps, \atk, 4,\rel, 8,\buf, ~wt_buf[1],\amp, 0.2,\out, 0],
[\s_new, \osc, 1002, 0, 0, \freq, 59.midicps, \atk, 4,\rel, 8,\buf, ~wt_buf[1],\amp, 0.2,\out, 0],
[\s_new, \osc, 1003, 0, 0, \freq, 61.midicps, \atk, 4,\rel, 8,\buf, ~wt_buf[1],\amp, 0.2,\out, 0],
],
[4, [\c_set, 0, 0]] // finish
]);
pat1.postcs;
pat1.recordNRT(
outputFilePath: "~/Desktop/NRT00.wav".standardizePath,
sampleRate: 44100,
headerFormat: "wav",
sampleFormat: "int16",
options: ServerOptions.new.numOutputBusChannels_(2),
duration: 4,
action: { "done".postln };
);
the SynthDef have been tested and working just fine.
anyone know how to solve this, is this a bug or did I do something wrong?