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