-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hello! Are there plans to implement NRT in lang.interpret? I try to do something like this:
const sc = require("supercolliderjs");
sc.lang.boot({debug: true, echo: true, stdin: true, stdout: true}).then(async function (lang) {
try {
const res = await lang.interpret(`
SynthDef(\\pad, {
arg freq = 440, dur = 1, amp = 1, feedback = 1, out = 0;
var sig, local, env;
sig = SinOsc.ar(freq);
env = EnvGen.kr(
Env.new([0, 1, 1, 0], [0, dur / 2, dur + 5], 'sin'),
doneAction: 2
);
sig = sig * env;
Out.ar(out, Pan2.ar(sig, SinOsc.kr([1, 2, 0.2, 0.5].choose, 0, [1, 0.5, 0.7].choose)));
}).store;
a = Scale.minorPentatonic;
p = Pbind(
\\instrument, \\bass,
\\ctranspose, 0,
\\dur, Prand([1,2,4,8], inf),
\\sustain, 1,
\\degree, Pxrand(a.degrees, inf),
\\out, 0
).asScore(duration: 8);
p.recordNRT(
outputFilePath: "~/Desktop/111/test.wav".asAbsolutePath,
headerFormat: "WAV",
duration: 8
);
`);
console.log(res)
} catch (e) {
console.log(e)
}
await lang.quit();
});But i get test.wav with 44 bytes length. :(
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels