SuperColliderプログラムをファイル(例:wavファイル)にプログラムでレンダリングする最良の方法は何ですか?サウンドをファイルにする最良の方法は何ですか?
ファイルの継続時間(30秒など)を指定できますか?
SuperColliderプログラムをファイル(例:wavファイル)にプログラムでレンダリングする最良の方法は何ですか?サウンドをファイルにする最良の方法は何ですか?
ファイルの継続時間(30秒など)を指定できますか?
Score.recordNRT
でこれを行うことができます。
使用方法に関するチュートリアルがあります。here
Score.recordNRT
(これはもっと便利なものの1つで、私が知らなかったものもあります)に加えてこれを行う方法はたくさんあります。 DiskOut.ar
は、path
とchannelsArray
をargs
とします。 Server
にある.record
インスタンスメソッドを試すこともできます。ここでは、両方の(ヘルプドキュメントからの)例は以下のとおりです。
// start something to record
x = Synth.new("bubbles");
// allocate a disk i/o buffer
b= Buffer.alloc(s, 65536, 2);
// create an output file for this buffer, leave it open
b.write("~/diskouttest.aiff".standardizePath, "aiff", "int16", 0, 0, true);
// create the diskout node; making sure it comes after the source
d = Synth.tail(nil, "help-Diskout", ["bufnum", b]);
// stop recording
d.free;
// stop the bubbles
x.free;
// close the buffer and the soundfile
b.close;
// free the buffer
b.free;
// play it back
(
x = Synth.basicNew("help-Diskin-2chan");
m = { arg buf; x.addToHeadMsg(nil, [\bufnum,buf])};
b = Buffer.cueSoundFile(s,"~/diskouttest.aiff".standardizePath, 0, 2, completionMessage: m);
)
x.free; b.close; b.free; // cleanup
DiskOut.ar
方法はServer.record
方法:
s.boot; // start the server
// something to record
(
SynthDef("bubbles", {
var f, zout;
f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function
zout = CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4); // echoing sine wave
Out.ar(0, zout);
}).add;
SynthDef("tpulse", { arg out=0,freq=700,sawFreq=440.0;
Out.ar(out, SyncSaw.ar(freq, sawFreq,0.1))
}).add;
)
x = Synth.new("bubbles");
s.prepareForRecord; // you have to call this first
s.record;
s.pauseRecording; // pausable
s.record // start again
s.stopRecording; // this closes the file and deallocates the buffer recording node, etc.
x.free; // stop the synths
// look in your recordings folder and you'll find a file named for this date and time
これはトリックを行うようです。ありがとう。 –