home/ atoms/ sc-server-record-performance

SuperCollider records the server's live audio output to a sound file with record and stopRecording

SuperCollider can capture whatever the audio server is playing straight to disk, so a live-coded or improvised performance is saved exactly as heard — every real-time parameter change included, with no re-render. The basic procedure: call s.record to start writing the server’s output buses to an audio file, make sound, then s.stopRecording to close it; the Post window prints the saved file path (a WAV/AIFF in the default recordings folder). s.makeWindow opens a GUI with record/mute/volume buttons for the same purpose. For finer control, s.prepareForRecord opens the output file ahead of time and must run before recording starts, then s.record begins, s.pauseRecording/s.record pause and resume, and s.stopRecording finishes. Because the server records its own output bus, any synth playing while recording is active is captured. Wrapping the sound-starting code and s.record together in s.bind (a synchronised bundle) keeps the start of the sound and the start of recording sample-aligned.

Examples

s.record;
{Saw.ar(LFNoise0.kr([2,3]).range(100,2000), LFPulse.kr([4,5])*0.1)}.play;
s.stopRecording; // Post window prints the saved file path

// sample-aligned start:
s.prepareForRecord;   // must run first
s.bind({
  x = { SinOsc.ar(440, 0, 0.2) }.play;
  s.record;
});
s.stopRecording;

Assessment

Record a 20-second live-coded loop to a sound file, pause and resume mid-loop, then stop, and locate the file from the printed path. Explain why prepareForRecord must precede record and why s.bind is used to start the sound and the recording together.

“Soon you will want to start recording the sound output of your SuperCollider patches. Here’s a quick way:”
corpus · a-gentle-introduction-to-supercollider-ruviaro-archive-org-c · chunk 3
“s.prepareForRecord; // prepare the server to record (you must do this first)”
corpus · the-supercollider-book-official-code-examples-scbookcode-gpl · chunk 136