SuperCollider+multi-channel+example+code

There are different strategies for using SuperCollider in multichannel but what people around the Cybernetic Orchestra have been doing so far typically involves making sure your SynthDefs have an "out" argument, and then setting that out argument in your patterns. // 1. make sure each mono SynthDef has an "out" argument which specifies which channel the Synth's output should go to // I just write all my synthdef's with an "out" argument - it's useful for many other things as well ( SynthDef(\sineSwell, { arg freq=440,amp=0.1,out=0; // *** notice the "out" argument, with a default of 0 (the 1st channel) var audio = [|SinOsc.ar](freq:freq,mul:amp); // a sine wave at the freq and amplitude specified by those arguments audio = audio * [|EnvGen.ar](Env.linen(1,2,2),doneAction:2); // multiply by a 5 second envelope [|Out.ar](out,audio); // *** route the signal in "audio" to the output indicated by the argument "out" (i.e. a number from 0-7) } ).add; )

// 2. when you write patterns with your synth, address the out parameter, i.e. Pbindef(\x,\instrument,\sineSwell); Pbindef(\x,\db,-25); Pbindef(\x,\midinote,Pseq([60,62,64],inf)); Pbindef(\x,\dur,8); // 8 beats between notes Pbindef(\x,\legato,1.5); // notes overlap by 50% more of their duration Pbindef(\x).play(quant:4); // start the pattern on the next 4-beat downbeat

// now let's control the speaker to which each note is directed... some options: Pbindef(\x,\out,0); // send everything to first channel (0) (the default) Pbindef(\x,\out,1); // send everything to second channel (1) Pbindef(\x,\out,7); // send everything to eighth channel (7);

// or with sequences... Pbindef(\x,\out,Pseq([0,1],inf)); // send to 0 then 1 then 0 then 1 etc Pbindef(\x,\out,Pseq([0,1,2,3,4,5,6,7],inf)); // send to 0 then 1... up to 7, then again

// or randomly... Pbindef(\x,\out,Prand([0,1,2,3,4,5,6,7],inf)); // randomly pick speakers between 0 and 7 Pbindef(\x,\out,Pxrand([0,1,2,3,4,5,6,7],inf)); // randomly pick speakers between 0 and 7, no repetition

// or from a variable, wrapping the variable in a Pfunc "pattern from a function" Pbindef(\x,\out,Pfunc({ ~outVariable })); ~outVariable = 3; ~outVariable = 7; // etc

// or from a pattern proxy Pbindef(\x,\out,Pdefn(\outputPattern)); // Pdefn(\outputPattern) is a pattern defined elsewhere, can be referenced within other patterns Pdefn(\outputPattern, Pseq([3,4,5],inf)); // define the pattern proxy as a sequence going 3,4,5,3,4,5 etc // the pattern proxy can be used in multiple event patterns and when you change it they will all express the change

As you can see, so long as you have an "out" argument in your SynthDef, you'll be able to easily go back and forth between configurations of different numbers of speakers. I think both straight forward sequences and random patterns are perfectly viable strategies, i.e:

Pbindef(\x,\out,Pseq([0,1],inf)); // for stereo Pbindef(\x,\out,Pseq([0,1,2,3,4,5,6,7],inf)); // for 8-channel

Pbindef(\x,\out,Pxrand([0,1],inf)); // for stereo Pbindef(\x,\out,Pxrand([0,1,2,3,4,5,6,7],inf)); // for 8-channel

There's a short cut for making arrays that are just counting up numbers in SuperCollider like follows: 0..1 // becomes [0,1] 0..7 // becomes [0,7]

So: Pbindef(\x,\out,Pseq(0..7,inf)); // now just change the 7 for different numbers of speakers // you can practice in stereo, change one character and you're working in 8-channel