Hi
I try to generate a sound file via NRT. The instruments uses literal arrays as input arguments. And I have a text file with commands that I run. It works in realtime SuperCollider via OSC but in NRT it just silently stops rendering. Any ideas what could be wrong?
This is the instrument.
SynthDef(\bankOfOsc, {
arg dur = 1, freqs = #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
amps = #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
phases = #[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], out = 0;
var sig;
Line.kr(dur:dur, doneAction:2);
sig = Klang.ar(`[freqs, amps, phases ]);
Out.ar(out, sig);
}).add.store('global', synthsDir );
This is the one example call.
[0.0, [\s_new, \bankOfOsc, -1, 0, 1004, \out, 74, \dur, 5.185676258002328, \freqs, [184.997, 523.251, 861.505, 1199.759, 1538.013, 1876.267, 2214.521, 2552.775, 2891.029, 3229.283, 3567.537, 3905.791, 4244.045, 4582.299, 4920.553], \amps, [0.318, 0.000, 0.106, 0.080, 0.000, 0.000, 0.045, 0.000, 0.000, 0.032, 0.029, 0.000, 0.024, 0.000, 0.021], \phases, [0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000]]]
This is how I render it.
(
var server, score;
server = Server(\nrt,
options: ServerOptions.new
.sampleRate_(96000)
.numOutputBusChannels_(14)
.maxNodes_(4096)
.numInputBusChannels_(2));
score = Score.newFromFile("/path/to/testfile.txt");
score.recordNRT(
outputFilePath: "/path/to/sound/file.caf".standardizePath,
headerFormat: "CAF",
sampleFormat: "float",
options: server.options,
duration: 210,
action: { "done".postln }
);
server.remove;
)
I use SuperCollider 3.12.0 and mac OS 13.1
Thanks in advance.