SuperCollider routes audio between synths on numbered buses; Out.ar writes, In.ar reads, and Bus.audio allocates free buses
Buses are numbered channels on the server, named after the buses/sends of a mixing desk and serving the same purpose: routing signals between synths. SC has 128 audio buses by default (0–127). The lowest are the hardware outputs: 0–7 map to sound-card outputs (0 = left, 1 = right on stereo); 8–15 are reserved for sound-card inputs; 16–127 are free for internal routing. Out.ar(busNum, signal) writes audio to a bus; In.ar(busNum) reads it. A synth writing to a private bus and another reading it forms a send-return chain (source → effect bus → effect synth → output). Audio sent to a private bus makes no sound until it is rerouted to an output bus. Two things must be right: execution order — writer synths must run before reader synths (managed via Groups) so the effect processes audio after the source writes it; and bus assignment — hard-coding bus numbers causes conflicts in complex patches, so Bus.audio(s, numChannels) allocates a free bus and tracks it automatically.
Examples
~fxBus = Bus.audio(s, 2);
r = {Out.ar(0, FreeVerb.ar(In.ar(~fxBus, 2), mix: 0.5))}.play;
n = {Out.ar(~fxBus, WhiteNoise.ar(0.1))}.play; // effect synth started first, reads after source writes
// SynthDef form, order matters:
SynthDef("osc", {Out.ar(10, Saw.ar(200))}).add;
SynthDef("flt", {Out.ar(0, RLPF.ar(In.ar(10), 800, 0.3))}).add;
Synth("osc"); Synth("flt"); // flt must run after osc
Assessment
Set up a chain where a Saw oscillator feeds a filter/reverb synth via an audio bus, then outputs to the left speaker. Which bus numbers are reserved for outputs and inputs? Explain why audio sent to bus 10 is inaudible while bus 0 is not, and how you would route bus 10 to the speakers. Why use Bus.audio instead of hard-coding a number?