# Build Solar Brass in SuperCollider

A stock-unit SuperCollider interpretation of [the Ableton sound](/tutorials/solar-brass/) and its [Csound version](/tutorials/solar-brass/csound/). Each stage changes the source or its effect chain; oscillator, filter, modal and room algorithms differ across platforms.

[Starting settings](STARTING_STATE.md) · [Complete settings](ALL_PARAMETERS.md). The full runnable script ends this guide.

## Step 1 — Build the first oscillator and touch contour

Select `~soundStage = 1` and evaluate the full script at the end of this guide. Wait for the instrument-ready message before playing.

Set `~soundStage = 1` in the full script. Use saw at -8 dB with pulse width 50% when applicable. The contour has 0.035 s attack, 0.85 s exponential decay to 0.8 sustain and 0.35 s release. Multiply by velocity^3; this explicit power curve interprets the source velocity response. Keep the signal centered before adding effects.

| SuperCollider control | Value |
| --- | --- |
| Source | Saw, -8.0 dB; width not used |
| Amplitude A/D/S/R | 0.035 / 0.85 / 0.8 / 0.35 |
| Amplifier / instrument | -6.0 dB / -6.0 dB |
| Velocity power | 3.0 |

<audio controls preload="none" aria-label="SuperCollider Solar Brass after step 1"><source src="audio/steps/step-01.webm" type="audio/webm"></audio>

[Sound after step 1 — WebM/Opus](audio/steps/step-01.webm)

## Step 2 — Add the second oscillator and resonant contour

Set `~soundStage = 2` in the full script. Add rect at -15 dB, tuned by 0 octaves. Use a Low-pass 12dB/oct interpretation with 950 Hz base cutoff, 2 octave envelope depth and 0.6 octave-per-octave pitch tracking. The contour opens then settles quickly while the amplitude remains. Smooth input drive interprets Sym1; the ladder or second-order lowpass is a different circuit. The 0 Hz LFO, where enabled, restarts per note rather than running freely.

| SuperCollider control | Value |
| --- | --- |
| Second source | Rect; -15 dB; width 46 % |
| Filter base / resonance | 950 Hz / 0.2 |
| Filter A/D/S/R | 0.07 / 0.35 / 0.45 / 0.42 |
| Envelope / key / LFO depth | 2 / 0.6 / 0 octaves |
| LFO rate | 0 Hz |
| Filter input shape | tanh(input × 1.4) / 1.4 |

<audio controls preload="none" aria-label="SuperCollider Solar Brass after step 2"><source src="audio/steps/step-02.webm" type="audio/webm"></audio>

[Sound after step 2 — WebM/Opus](audio/steps/step-02.webm)

## Step 3 — Add moving stereo chorus

Set `~soundStage = 3` in the full script. Move two delay taps around 12 ms by ±2.8 ms at 0.4 Hz, with opposite phases and 16% wet mix. Highpass only the wet inputs at 200 Hz to leave the direct low body clear. Scale side information by 1; tap feedback is 0. These explicit tap depths interpret the source Amount and ensemble movement rather than copy the internal algorithm. Sustained notes reveal slow pitch interference.

| SuperCollider control | Value |
| --- | --- |
| Tap center / excursion | 12 / ±2.8 ms |
| Rate / wet | 0.4 Hz / 16% |
| Wet highpass | 200 Hz |
| Width / feedback | 1 / 0 |
| Warmth shaping | 0% smooth-drive interpretation |

<audio controls preload="none" aria-label="SuperCollider Solar Brass after step 3"><source src="audio/steps/step-03.webm" type="audio/webm"></audio>

[Sound after step 3 — WebM/Opus](audio/steps/step-03.webm)

## Step 4 — Surround the tone with a damped room

Set `~soundStage = 4` and evaluate the full block. Feed the preceding signal into `FreeVerb2`, using its fully wet output and the dry/wet routing shown in the script. The room continues after individual note envelopes release. Predelay separates the initial articulation from the diffuse tail; the external wet mix controls how far that tail moves forward.

The SuperCollider room value is 0.420492 and damping is 0.71875. These dimensionless settings are choices for this algorithm, rather than equivalent values for Ableton decay or Csound feedback and damping. More damping darkens the circulating highs. Any input filters and mid/side width changes in this stage retain their own explicit settings in the full script.

| SuperCollider room control | Value |
| --- | --- |
| FreeVerb2 internal mix | 1, wet output only |
| Room | 0.420492 |
| Damping | 0.71875 |
| Predelay | 12 ms |
| External room wet | 14% |

| SuperCollider control | Value |
| --- | --- |
| Room side multiplier | 1 |
| Room input cuts | Off |

<audio controls preload="none" aria-label="SuperCollider Solar Brass after step 4"><source src="audio/steps/step-04.webm" type="audio/webm"></audio>

[Sound after step 4 — WebM/Opus](audio/steps/step-04.webm)

## Step 5 — Set the final width and gain

Set `~soundStage = 5` in the full script. Use 7.95 dB gain after the effects. Scale the side signal by 1, preserving the center. Apply `LeakDC` DC removal with coefficient 0.995. The fixed `~soundOutputScale` gain follows the complete effect chain at every stage. The effects Synth reads the stereo bus after the note group, and continues through note releases.

| SuperCollider control | Value |
| --- | --- |
| Final gain | 7.95 dB |
| Width | 1 × side |
| Bass side cutoff | Off |
| DC removal | LeakDC, coefficient 0.995 |

<audio controls preload="none" aria-label="SuperCollider Solar Brass after step 5"><source src="audio/steps/step-05.webm" type="audio/webm"></audio>

[Sound after step 5 — WebM/Opus](audio/steps/step-05.webm)

## Downloads and settings

[Finished sound — WebM/Opus](audio/solar-brass.webm) · [Complete settings](ALL_PARAMETERS.md) · [Ableton version](/tutorials/solar-brass/) · [Csound version](/tutorials/solar-brass/csound/)

## Full SuperCollider script

The complete Solar Brass instrument uses stock SuperCollider units. Set `~soundStage` from 1 to 5 and evaluate the entire block again to select a cumulative stage. Wait for the ready message; `~soundNote.(60, 0.8, 1)` plays MIDI 60 at velocity 0.8 with a one-second held duration. Held duration controls when release begins, while each source's decay and modulation continue independently. `~soundStop.()` frees the active instrument and its effects. This block replaces the previously installed PlayGrid instrument in the same interpreter.

```supercollider
(
~soundStage = 5;
~soundOutputScale = 1.132726;
~soundRelease = 0.42;
~soundNames = (motion: \pgSolarBrassMotion, voice: \pgSolarBrassVoice, effects: \pgSolarBrassEffects);

~soundDefs = [
    SynthDef(\pgSolarBrassMotion, { |out=0| Out.kr(out, DC.kr(0)) }),
    SynthDef(\pgSolarBrassVoice, { |out=0, midi=60, velocity=0.8, gate=1, startMidi=60|
        var stage = ~soundStage;
    var aAmp = 0, aAmpDecay = 0, aAmpGate = 0, aL = 0, aR = 0, aSecond = 0, aSource = 0, iHz = 0;
    var iVelocity = 0, kCut = 0, kFilter = 0, kFilterDecay = 0, kFilterGate = 0, kLFO = 0;
    iHz = (midi).midicps;
    iVelocity = (velocity).clip(0, 1);
    aSource = (Saw.ar(iHz) * ((0 - 8.0)).dbamp);
    if((stage >= 2)) {
    aSecond = (Pulse.ar((iHz * (2 ** (0 + (3.0 / 1200)))), 0.46) * ((0 - 15.0)).dbamp);
    aSource = (aSource + aSecond);
    kFilterGate = EnvGen.kr(Env([0, 1, 1], [0.07, 1], \lin));
    kFilterDecay = EnvGen.kr(Env([1, 1, 0.45, 0.000001], [0.07, 0.35, 0.42], \exp, releaseNode: 2), gate);
    kFilter = (kFilterGate * kFilterDecay);
    kLFO = (SinOsc.kr(0, 0 * 2pi) * 1);
    kCut = ((950.0 * (2 ** (((2.0 * kFilter) + ((0.6 * (midi - 60)) / 12)) + (0 * kLFO))))).clip(30, 18000);
    aSource = (((aSource * 1.4)).tanh / 1.4);
    aSource = RLPF.ar(aSource, (kCut).clip(20, 18000), (1 / 1.2).clip(0.05, 2));
    };
    aAmpGate = EnvGen.ar(Env([0, 1, 1], [0.035, 1], \lin));
    aAmpDecay = EnvGen.ar(Env([1, 1, 0.8, 0.000001], [0.035, 0.85, 0.35], \exp, releaseNode: 2), gate);
    aAmp = (aAmpGate * aAmpDecay);
    aL = (((aSource * aAmp) * ((0 - 12.0)).dbamp) * (iVelocity ** 3.0));
    aR = aL;
    Out.ar(out, [aL, aR]);
        EnvGen.kr(Env.asr(0.0001, 1, 0.42), gate, doneAction: 2);
    }),
    SynthDef(\pgSolarBrassEffects, { |in=0, out=0|
        var stage = ~soundStage;
        var outputScale = ~soundOutputScale;
        var input = In.ar(in, 2);
    var feedback = LocalIn.ar(2);
    var aChFbL = 0, aChFbR = 0, aChInL = 0, aChInR = 0, aChMid = 0, aChSide = 0, aChTimeL = 0, aChTimeR = 0;
    var aEndMid = 0, aEndSide = 0, aL = 0, aR = 0, aRoomInL = 0, aRoomInR = 0, aRoomL = 0, aRoomMid = 0;
    var aRoomPreL = 0, aRoomPreR = 0, aRoomR = 0, aRoomSide = 0, aTapL = 0, aTapR = 0, kCh = 0, room26 = 0;
    aL = input[0];
    aR = input[1];
    if((stage >= 3)) {
    aChFbL = feedback[0];
    aChFbR = feedback[1];
    aChInL = HPF.ar(aL, (200.0).clip(20, 18000));
    aChInR = HPF.ar(aR, (200.0).clip(20, 18000));
    kCh = (SinOsc.kr(0.4, 0 * 2pi) * 1);
    aChTimeL = K2A.ar((12 + (2.8000000000000003 * kCh)));
    aChTimeR = K2A.ar((12 - (2.8000000000000003 * kCh)));
    aTapL = DelayC.ar((aChInL + (aChFbL * 0)), 80 / 1000, (aChTimeL / 1000).clip(0.00002, 80 / 1000));
    aTapR = DelayC.ar((aChInR + (aChFbR * 0)), 80 / 1000, (aChTimeR / 1000).clip(0.00002, 80 / 1000));
    aChFbL = aTapL;
    aChFbR = aTapR;
    aL = ((aL * 0.84) + (aTapL * 0.16));
    aR = ((aR * 0.84) + (aTapR * 0.16));
    aChMid = ((aL + aR) * 0.5);
    aChSide = (((aL - aR) * 0.5) * 1.0);
    aL = (aChMid + aChSide);
    aR = (aChMid - aChSide);
    };
    if((stage >= 4)) {
    aRoomInL = aL;
    aRoomPreL = DelayN.ar(aRoomInL, 0.012, 0.012);
    aRoomInR = aR;
    aRoomPreR = DelayN.ar(aRoomInR, 0.012, 0.012);
    room26 = FreeVerb2.ar(aRoomPreL, aRoomPreR, 1, 0.420492, 0.71875);
    aRoomL = room26[0];
    aRoomR = room26[1];
    aRoomMid = ((aRoomL + aRoomR) * 0.5);
    aRoomSide = (((aRoomL - aRoomR) * 0.5) * 1);
    aL = ((aL * 0.86) + ((aRoomMid + aRoomSide) * 0.14));
    aR = ((aR * 0.86) + ((aRoomMid - aRoomSide) * 0.14));
    };
    if((stage >= 5)) {
    aEndMid = ((aL + aR) * 0.5);
    aEndSide = (((aL - aR) * 0.5) * 1.0);
    aL = ((aEndMid + aEndSide) * (7.95).dbamp);
    aL = LeakDC.ar(aL, 0.995);
    aR = ((aEndMid - aEndSide) * (7.95).dbamp);
    aR = LeakDC.ar(aR, 0.995);
    };
    LocalOut.ar([aChFbL, aChFbR].collect { |channel| channel + DC.ar(0) });
    Out.ar(out, [((aL * 1) * outputScale), ((aR * 1) * outputScale)]);
    })
];
~soundStop = {
    if(~cirrusGroup.notNil) { ~cirrusGroup.free; ~cirrusGroup = nil };
    if(~cirrusAudio.notNil) { ~cirrusAudio.free; ~cirrusAudio = nil };
    if(~cirrusMotion.notNil) { ~cirrusMotion.free; ~cirrusMotion = nil };
    if(~pgGroup.notNil) { ~pgGroup.free; ~pgGroup = nil };
    if(~pgAudio.notNil) { ~pgAudio.free; ~pgAudio = nil };
    if(~pgMotion.notNil) { ~pgMotion.free; ~pgMotion = nil };
};
~soundInstall = {
    s.waitForBoot {
        ~soundStop.();
        ~soundDefs.do { |definition| definition.add };
        s.sync;
        ~pgAudio = Bus.audio(s, 2);
        ~pgMotion = Bus.control(s, 1);
        ~pgGroup = Group.head(s);
        ~pgLastMidi = 60;
        Synth.head(~pgGroup, ~soundNames.motion, [\out, ~pgMotion]);
        ~pgVoices = Group.tail(~pgGroup);
        Synth.tail(~pgGroup, ~soundNames.effects, [\in, ~pgAudio]);
        "Solar Brass ready".postln;
    };
};
~soundNote = { |midi=60, velocity=0.8, hold=1|
    var note = Synth.head(~pgVoices, ~soundNames.voice, [
        \out, ~pgAudio, \midi, midi, \velocity, velocity.clip(0, 1),
        \startMidi, ~pgLastMidi
    ]);
    ~pgLastMidi = midi;
    SystemClock.sched(hold, { note.set(\gate, 0); nil });
    note;
};
if(~soundOffline != true) { ~soundInstall.() };
)
```

[Read on playgrid.cc](https://playgrid.cc/tutorials/solar-brass/supercollider/)
