// title: How to Record Multichannel Output in SuperCollider // author: Bruno Ruviaro // description: // This example shows how to record 4 output channels *as separate mono files*. // Also shows how to pick a custom path and file name for the files. File type chosen is "wav" (instead of default "aiff"). // code: // ========================================== // How to Record Multichannel Output in SuperCollider // ========================================== // Example - recording 4 output channels *as separate mono files*. // Code below also picks a custom path and file name to save them (adjust accordingly to your machine) // This code sets your SuperCollider Server to 4-channel output s.options.numOutputBusChannels = 4; s.reboot; // You can see the 4 channels here: s.meter; // Create 4 recorders (needs to be done just once in a session): ~recs = Recorder.new(s).dup(4) // START ALL MONO RECORDERS (chans 0, 1, 2, 3) ( var basicPath = "/home/ruviaro/Desktop/"; // customize this ~recs.do({ arg thisRecorder, index; var fileName = "test" ++ index ++ ".wav"; thisRecorder.record( path: basicPath ++ fileName, bus: index, numChannels: 1 // mono ); }) ) // Start making some sound (below, 4 channels of sound) ( { var snd; snd = LFTri.ar( freq: [100, 204, 310, 405], mul: LFPulse.ar([1, 2, 3, 4]) ); // snd = Splay.ar(snd); Out.ar(0, snd * 0.2); }.play; ) // Stop all recorders ~recs.do({ arg thisRecorder; thisRecorder.stopRecording }) s.freeAll; // ===================== // NOTE: if you don't care about recording each channel as a separate mono file, then the code is way simpler. // Start recording (a single 4-channel file will be saved in the default recordings directory): s.record(numChannels: 4); // Stop recording s.stopRecording;