playgrid.ccRead tutorial

Tutorial 145 / SuperCollider

Build Sorrel Hollow in SuperCollider

Build Sorrel Hollow in SuperCollider with drifting bass, explicit envelopes and the sound-shaping chain explained in the guide.

4 stepsDrifting BassSuperCollider

Listen to the finished sound

Download WEBM ↓

Follow the synthesis steps in order. Use the audio examples and device settings alongside the instructions.

Step 01 / 4

Shape the drifting bass body

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.0 dB, with ±0.6 cents of slow note-local pitch drift. Set attack 0.0068 s, decay 1.29 s, sustain 0.7 and release 0.203 s. Keep the source centered. This replaces Drift's irregular oscillator instability with a small sine drift; glide and mono note-priority are not implemented.

SuperCollider control Value
Wave / gain Saw / -8.0 dB
Amplitude A/D/S/R 0.0068 / 1.29 / 0.7 / 0.203
Instrument / velocity -6.0 dB / 40 %
Drift ±0.6 cents at 0.19 Hz

Sound after step 1 — WebM/Opus

Next: Add the sub and lowpass movement →

Step 02 / 4

Add the sub and lowpass movement

Set ~soundStage = 2 in the full script. Add an octave-down sine at -7.0 dB. Route both sources through a 244 Hz ladder lowpass with 0.25 resonance, followed by the 25 Hz highpass. The second envelope moves cutoff by 0.9 octaves; keyboard and velocity amounts add their own opening. The filter type and modulation scaling interpret the source rather than copy its Type II circuit.

SuperCollider control Value
Sub Octave down, -7.0 dB
Cutoff / resonance 244 Hz / 0.25
Filter A/D/S/R 0.002 / 0.45 / 0.2 / 0.2
Envelope / key / velocity depth 0.9 / 0.6 / 0.24 octaves

For MoogFF, multiply the stated source resonance amount by four to obtain its 0–4 gain argument (limited to 3.95). The complete script gives this gain expression beside each cutoff.

Sound after step 2 — WebM/Opus

Next: Round the signal with saturation →

Step 03 / 4

Round the signal with saturation

Set ~soundStage = 3 in the full script. Use +2.3 dB drive with 70% shaped signal and -2 dB output trim. The smooth curve is tanh(input × 3 × drive.dbamp) / 3; the other portion stays clean. Louder peaks enter its curved region more strongly, adding harmonics and rounding the envelope. This interprets the source saturation curve rather than implementing its proprietary transfer function.

SuperCollider control Value
Drive / output 2.3 / -2 dB
Shaped mix 70%
Input DC removal LeakDC, coefficient 0.995

Sound after step 3 — WebM/Opus

Next: Set the final width and gain →

Step 04 / 4

Set the final width and gain

Set ~soundStage = 4 in the full script. Use 2.86 dB gain after the effects. Average the channels for identical mono outputs. 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 2.86 dB
Width Mono
Bass side cutoff Off
DC removal LeakDC, coefficient 0.995

Sound after step 4 — WebM/Opus

Audio & settings ↓

Audio & settings

Audio recordings and settings for this tutorial.

Full SuperCollider script

The complete Sorrel Hollow instrument uses stock SuperCollider units. Set ~soundStage from 1 to 4 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.

(
~soundStage = 4;
~soundOutputScale = 1.267126;
~soundRelease = 0.203;
~soundNames = (motion: \pgSorrelHollowMotion, voice: \pgSorrelHollowVoice, effects: \pgSorrelHollowEffects);

~soundDefs = [
    SynthDef(\pgSorrelHollowMotion, { |out=0| Out.kr(out, DC.kr(0)) }),
    SynthDef(\pgSorrelHollowVoice, { |out=0, midi=60, velocity=0.8, gate=1, startMidi=60|
        var stage = ~soundStage;
    var aL = 0, aR = 0, aSource = 0, aSub = 0, iHz = 0, iVelocity = 0, kAmp = 0, kCut = 0;
    var kDrift = 0, kFilter = 0, kHz = 0;
    iHz = (midi).midicps;
    iVelocity = (velocity).clip(0, 1);
    kDrift = (SinOsc.kr(0.19, 0 * 2pi) * 0.6000000000000001);
    kHz = (iHz * (2 ** (kDrift / 1200)));
    aSource = (Saw.ar(kHz) * ((0 - 8.0)).dbamp);
    if((stage >= 2)) {
    aSub = (SinOsc.ar((kHz * 0.5), 0 * 2pi) * ((0 - 7.0)).dbamp);
    aSource = (aSource + aSub);
    kFilter = EnvGen.kr(Env([0, 1, 0.2, 0], [0.002, 0.45, 0.2], \lin, releaseNode: 2), gate);
    kCut = ((244.0 * (2 ** (((0.8999999999999999 * kFilter) + ((0.6 * (midi - 60)) / 12)) + (0.24 * iVelocity))))).clip(30, 18000);
    aSource = MoogFF.ar(aSource, (kCut).clip(20, 18000), (0.25 * 4).clip(0, 3.95));
    aSource = HPF.ar(aSource, (25.0).clip(20, 18000));
    };
    kAmp = EnvGen.kr(Env([0, 1, 0.7, 0], [0.0068, 1.29, 0.203], \lin, releaseNode: 2), gate);
    aL = (((aSource * kAmp) * ((0 - 6.0)).dbamp) * (0.6 + (0.4 * iVelocity)));
    aR = aL;
    Out.ar(out, [aL, aR]);
        EnvGen.kr(Env.asr(0.0001, 1, 0.203), gate, doneAction: 2);
    }),
    SynthDef(\pgSorrelHollowEffects, { |in=0, out=0|
        var stage = ~soundStage;
        var outputScale = ~soundOutputScale;
        var input = In.ar(in, 2);
    var aCleanL = 0, aCleanR = 0, aEndMid = 0, aEndSide = 0, aL = 0, aR = 0, aShapeL = 0, aShapeR = 0;
    aL = input[0];
    aR = input[1];
    if((stage >= 3)) {
    aCleanL = LeakDC.ar(aL, 0.995);
    aShapeL = ((((aCleanL * 3) * (2.3).dbamp)).tanh / 3);
    aL = (((aCleanL * 0.30000000000000004) + (aShapeL * 0.7)) * ((0 - 2.0)).dbamp);
    aCleanR = LeakDC.ar(aR, 0.995);
    aShapeR = ((((aCleanR * 3) * (2.3).dbamp)).tanh / 3);
    aR = (((aCleanR * 0.30000000000000004) + (aShapeR * 0.7)) * ((0 - 2.0)).dbamp);
    };
    if((stage >= 4)) {
    aEndMid = ((aL + aR) * 0.5);
    aEndSide = (((aL - aR) * 0.5) * 0);
    aL = ((aEndMid + aEndSide) * (2.86).dbamp);
    aL = LeakDC.ar(aL, 0.995);
    aR = ((aEndMid - aEndSide) * (2.86).dbamp);
    aR = LeakDC.ar(aR, 0.995);
    };
    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]);
        "Sorrel Hollow 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.() };
)