playgrid.ccRead tutorial

Tutorial 157 / SuperCollider

Build Umber Grove in SuperCollider

Build Umber Grove in SuperCollider with modal plucked string, explicit envelopes and the sound-shaping chain explained in the guide.

5 stepsModal Plucked StringSuperCollider

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 / 5

Excite a decaying string mode bank

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. Feed a 1.5 ms shaped pulse with a quiet noise component into sixteen string modes. The strike position is 0.13 of string length and the pickup position 0.22. Each mode is weighted by the sine of both positions, so moving the strike changes which harmonics are suppressed. A small stiffness term bends upper partials away from perfect harmonic ratios. The fundamental T60 is 2.6 s and upper modes decay faster. This modal bank interprets Tension rather than implementing its plectrum and string solver.

SuperCollider control Value
Strike / pickup 0.13 / 0.22 of length
Mode frequencies f × n × sqrt(1 + 0.00008 × n²), below 11000 Hz
Decay T60 / (1 + 0.08 × (n−1)^1.3)
Fundamental T60 2.6 s
Exciter lowpass 4780 Hz
String scaling / instrument 0.02 × (0.4 + 0.6 × velocity) / −10 dB

Sound after step 1 — WebM/Opus

Next: Blend body modes and soften the string →

Step 02 / 5

Blend body modes and soften the string

Set ~soundStage = 2 in the full script. Use broad body resonances at 97, 193 and 450 Hz with Q values 8, 12 and 18. Blend 28% of their weighted sum with the string and lowpass at 3900 Hz. The body colors the lower spectrum rather than supplying a sustained oscillator. Natural mode tails continue after the short excitation; the script holds their state for twice the fundamental T60. Body size, damping and pickup geometry are represented by these explicit choices, not a numerical conversion of all Tension macros.

SuperCollider control Value
Body modes 97/193/450 Hz; Q 8/12/18
Body weights / scale 0.4/0.2/0.1 × 0.04
Body mix 28%
Lowpass 3900 Hz

The Q values describe the design targets: Ringz receives decay seconds computed as Q × ln(1000) / (π × frequency), not Q itself.

Sound after step 2 — WebM/Opus

Next: Round the signal with saturation →

Step 03 / 5

Round the signal with saturation

Set ~soundStage = 3 in the full script. Use +0.5 dB drive with 30% shaped signal and -1 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 0.5 / -1 dB
Shaped mix 30%
Input DC removal LeakDC, coefficient 0.995

Sound after step 3 — WebM/Opus

Next: Surround the tone with a damped room →

Step 04 / 5

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.262459 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.262459
Damping 0.71875
Predelay 12 ms
External room wet 12%
SuperCollider control Value
Room side multiplier 1
Room input cuts Off

Sound after step 4 — WebM/Opus

Next: Set the final width and gain →

Step 05 / 5

Set the final width and gain

Set ~soundStage = 5 in the full script. Use 17.4 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 17.4 dB
Width 1 × side
Bass side cutoff Off
DC removal LeakDC, coefficient 0.995

Sound after step 5 — WebM/Opus

Audio & settings ↓

Audio & settings

Audio recordings and settings for this tutorial.

Full SuperCollider script

The complete Umber Grove 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.

(
~soundStage = 5;
~soundOutputScale = 0.2648187;
~soundRelease = 5.2;
~soundNames = (motion: \pgUmberGroveMotion, voice: \pgUmberGroveVoice, effects: \pgUmberGroveEffects);
~pgString = { |excitation, hz, t60, position|
    Mix(Array.fill(16, { |i|
        var n = i + 1;
        var freq = hz * n * (1 + (0.00008 * n.squared)).sqrt;
        var decay = t60 / (1 + (0.08 * ((n - 1) ** 1.3)));
        var weight = sin(pi * n * position) * sin(pi * n * 0.22) / n;
        Ringz.ar(excitation, freq.clip(20, 11000), decay) * weight * (freq < 11000)
    }));
};
~soundDefs = [
    SynthDef(\pgUmberGroveMotion, { |out=0| Out.kr(out, DC.kr(0)) }),
    SynthDef(\pgUmberGroveVoice, { |out=0, midi=60, velocity=0.8, gate=1, startMidi=60|
        var stage = ~soundStage;
    var aBody = 0, aBody1 = 0, aBody2 = 0, aBody3 = 0, aExc = 0, aGate = 0, aL = 0, aNoise = 0;
    var aR = 0, aString = 0, iHz = 0, iVelocity = 0;
    iHz = (midi).midicps;
    iVelocity = (velocity).clip(0, 1);
    aGate = EnvGen.ar(Env([0, 1, 0, 0], [0.0003, 0.0012, 1], \lin));
    aNoise = WhiteNoise.ar(1);
    aExc = OnePole.ar((aGate * (0.8 + (0.2 * aNoise))), (-2pi * (4780.0).clip(20, 18000) / SampleRate.ir).exp);
    aString = ~pgString.(aExc, iHz, 2.6, 0.13);
    aString = (((aString * 0.02) * (0.4 + (0.6 * iVelocity))) * ((0 - 10)).dbamp);
    aL = aString;
    aR = aString;
    if((stage >= 2)) {
    aBody1 = Ringz.ar(aString, (97).clip(20, 11000), ((8 * 1000.log) / (pi * 97)).clip(0.0001, 60));
    aBody2 = Ringz.ar(aString, (193).clip(20, 11000), ((12 * 1000.log) / (pi * 193)).clip(0.0001, 60));
    aBody3 = Ringz.ar(aString, (450).clip(20, 11000), ((18 * 1000.log) / (pi * 450)).clip(0.0001, 60));
    aBody = ((((aBody1 * 0.4) + (aBody2 * 0.2)) + (aBody3 * 0.1)) * 0.04);
    aL = ((aString * 0.72) + (aBody * 0.28));
    aL = LPF.ar(aL, (3900.0).clip(20, 18000));
    aR = aL;
    };
    Out.ar(out, [aL, aR]);
        EnvGen.kr(Env.asr(0.0001, 1, 5.2), gate, doneAction: 2);
    }),
    SynthDef(\pgUmberGroveEffects, { |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, aRoomInL = 0, aRoomInR = 0;
    var aRoomL = 0, aRoomMid = 0, aRoomPreL = 0, aRoomPreR = 0, aRoomR = 0, aRoomSide = 0, aShapeL = 0, aShapeR = 0;
    var room15 = 0;
    aL = input[0];
    aR = input[1];
    if((stage >= 3)) {
    aCleanL = LeakDC.ar(aL, 0.995);
    aShapeL = ((((aCleanL * 3) * (0.5).dbamp)).tanh / 3);
    aL = (((aCleanL * 0.7) + (aShapeL * 0.3)) * ((0 - 1.0)).dbamp);
    aCleanR = LeakDC.ar(aR, 0.995);
    aShapeR = ((((aCleanR * 3) * (0.5).dbamp)).tanh / 3);
    aR = (((aCleanR * 0.7) + (aShapeR * 0.3)) * ((0 - 1.0)).dbamp);
    };
    if((stage >= 4)) {
    aRoomInL = aL;
    aRoomPreL = DelayN.ar(aRoomInL, 0.012, 0.012);
    aRoomInR = aR;
    aRoomPreR = DelayN.ar(aRoomInR, 0.012, 0.012);
    room15 = FreeVerb2.ar(aRoomPreL, aRoomPreR, 1, 0.262459, 0.71875);
    aRoomL = room15[0];
    aRoomR = room15[1];
    aRoomMid = ((aRoomL + aRoomR) * 0.5);
    aRoomSide = (((aRoomL - aRoomR) * 0.5) * 1);
    aL = ((aL * 0.88) + ((aRoomMid + aRoomSide) * 0.12));
    aR = ((aR * 0.88) + ((aRoomMid - aRoomSide) * 0.12));
    };
    if((stage >= 5)) {
    aEndMid = ((aL + aR) * 0.5);
    aEndSide = (((aL - aR) * 0.5) * 1.0);
    aL = ((aEndMid + aEndSide) * (17.4).dbamp);
    aL = LeakDC.ar(aL, 0.995);
    aR = ((aEndMid - aEndSide) * (17.4).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]);
        "Umber Grove 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.() };
)