playgrid.ccRead tutorial

Tutorial 010 / SuperCollider

Build Resonant Octave Mist in SuperCollider

Build Resonant Octave Mist in SuperCollider with resonant noise pad, explicit envelopes and the sound-shaping chain explained in the guide.

4 stepsResonant Noise PadSuperCollider

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

Make a narrow, singing noise band

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. Filter quiet white noise through two narrow resonances. The center is 890 Hz at MIDI 69 and tracks the keyboard; the channels differ by seven cents. A 0.30 Hz filter motion and slower pitch drift loosen the ringing. Shape amplitude with a 2.20 s attack, full sustain and 3.20 s release. This noise-band model approximates the source resonant tone without implementing Drift's self-oscillating filter.

SuperCollider control Value
Noise / instrument −24 / −12 dB
Centers 890 Hz at MIDI 69, full tracking; 7-cent channel separation
Bandwidth Center / 60
Motion 0.30 Hz, ±0.003 octaves; slower ±3 cents
Amplitude 2.20 s attack, full sustain, 3.20 s release

Sound after step 1 — WebM/Opus

Next: Add the upper octave echo →

Step 02 / 4

Add the upper octave echo

Set ~soundStage = 2 in the full script. Use two overlapping 100 ms delay windows to shift the preceding signal by a frequency ratio of 2, plus 3 cents. The delay begins at 375 ms and moves across the additional window. Blend 4% shifted signal, lowpassed at 2000 Hz, with 3.3% local feedback. The next stage receives this whole blend, so series octave relationships also interact. This moving-window shifter differs from Ableton Shifter and adds window latency.

SuperCollider control Value
Pitch ratio / cents 2 / 3
Base delay / window 375 / 100 ms
Feedback / wet 3.3% / 4%
Tone 2000 Hz

Sound after step 2 — WebM/Opus

Next: Add the lower octave echo →

Step 03 / 4

Add the lower octave echo

Set ~soundStage = 3 in the full script. Use two overlapping 100 ms delay windows to shift the preceding signal by a frequency ratio of 0.5, plus -3 cents. The delay begins at 500 ms and moves across the additional window. Blend 2.5% shifted signal, lowpassed at 1800 Hz, with 6.8% local feedback. The next stage receives this whole blend, so series octave relationships also interact. This moving-window shifter differs from Ableton Shifter and adds window latency.

SuperCollider control Value
Pitch ratio / cents 0.5 / -3
Base delay / window 500 / 100 ms
Feedback / wet 6.8% / 2.5%
Tone 1800 Hz

Sound after step 3 — WebM/Opus

Next: Surround the tone with a damped room →

Step 04 / 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.96 and damping is 0.8875. 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.96
Damping 0.8875
Predelay 10 ms
External room wet 50%
SuperCollider control Value
Room side multiplier 1
Room input cuts Off

Sound after step 4 — WebM/Opus

Audio & settings ↓

Audio & settings

Audio recordings and settings for this tutorial.

Full SuperCollider script

The complete Resonant Octave Mist 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 = 215.2053;
~soundRelease = 3.2;
~soundNames = (motion: \pgResonantOctaveMistMotion, voice: \pgResonantOctaveMistVoice, effects: \pgResonantOctaveMistEffects);

~soundDefs = [
    SynthDef(\pgResonantOctaveMistMotion, { |out=0| Out.kr(out, DC.kr(0)) }),
    SynthDef(\pgResonantOctaveMistVoice, { |out=0, midi=60, velocity=0.8, gate=1, startMidi=60|
        var stage = ~soundStage;
    var aL = 0, aLeft = 0, aNoise = 0, aR = 0, aRight = 0, iHz = 0, iVelocity = 0, kAmp = 0;
    var kCenter = 0, kDrift = 0, kMotion = 0;
    iHz = (midi).midicps;
    iVelocity = (velocity).clip(0, 1);
    aNoise = WhiteNoise.ar(((0 - 24)).dbamp);
    kMotion = (SinOsc.kr(0.30, 0 * 2pi) * 1);
    kDrift = (SinOsc.kr(0.13, 0.2 * 2pi) * 3);
    kCenter = ((890 * (2 ** ((((midi - 69) / 12) + ((3.5 + kDrift) / 1200)) + (0.003 * kMotion))))).clip(30, 11000);
    aLeft = BPF.ar(aNoise, (kCenter).clip(20, 18000), ((kCenter / 60) / kCenter).clip(0.001, 4));
    aRight = BPF.ar(aNoise, ((kCenter * (2 ** ((0 - 7) / 1200)))).clip(20, 18000), ((kCenter / 60) / (kCenter * (2 ** ((0 - 7) / 1200)))).clip(0.001, 4));
    kAmp = EnvGen.kr(Env([0, 1, 1, 0], [2.2, 0.6, 3.2], \lin, releaseNode: 2), gate);
    aL = (((aLeft * kAmp) * ((0 - 12)).dbamp) * (0.5 + (0.5 * iVelocity)));
    aR = (((aRight * kAmp) * ((0 - 12)).dbamp) * (0.5 + (0.5 * iVelocity)));
    Out.ar(out, [aL, aR]);
        EnvGen.kr(Env.asr(0.0001, 1, 3.2), gate, doneAction: 2);
    }),
    SynthDef(\pgResonantOctaveMistEffects, { |in=0, out=0|
        var stage = ~soundStage;
        var outputScale = ~soundOutputScale;
        var input = In.ar(in, 2);
    var feedback = LocalIn.ar(4);
    var aDownFeedbackL = 0, aDownFeedbackR = 0, aDownPhase = 0, aDownPhase2 = 0, aDownTap2L = 0, aDownTap2R = 0, aDownTapL = 0, aDownTapR = 0;
    var aDownTime = 0, aDownTime2 = 0, aDownWetL = 0, aDownWetR = 0, aDownWin = 0, aDownWin2 = 0, aL = 0, aR = 0;
    var aRoomInL = 0, aRoomInR = 0, aRoomL = 0, aRoomMid = 0, aRoomPreL = 0, aRoomPreR = 0, aRoomR = 0, aRoomSide = 0;
    var aUpFeedbackL = 0, aUpFeedbackR = 0, aUpPhase = 0, aUpPhase2 = 0, aUpTap2L = 0, aUpTap2R = 0, aUpTapL = 0, aUpTapR = 0;
    var aUpTime = 0, aUpTime2 = 0, aUpWetL = 0, aUpWetR = 0, aUpWin = 0, aUpWin2 = 0, room51 = 0;
    aL = input[0];
    aR = input[1];
    if((stage >= 2)) {
    aUpFeedbackL = feedback[0];
    aUpFeedbackR = feedback[1];
    aUpPhase = Phasor.ar(0, (((2 * (2 ** (3 / 1200))) - 1) / 0.1) / SampleRate.ir, 0, 1);
    aUpPhase2 = ((aUpPhase + 0.5)).wrap(0, 1);
    aUpWin = (((aUpPhase * 3.14159265359)).sin ** 2);
    aUpWin2 = (((aUpPhase2 * 3.14159265359)).sin ** 2);
    aUpTime = (375.0 + ((1 - aUpPhase) * 100));
    aUpTime2 = (375.0 + ((1 - aUpPhase2) * 100));
    aUpTapL = DelayC.ar((aL + (aUpFeedbackL * 0.033)), 2000 / 1000, (aUpTime / 1000).clip(0.00002, 2000 / 1000));
    aUpTap2L = DelayC.ar((aL + (aUpFeedbackL * 0.033)), 2000 / 1000, (aUpTime2 / 1000).clip(0.00002, 2000 / 1000));
    aUpWetL = ((aUpTapL * aUpWin) + (aUpTap2L * aUpWin2));
    aUpWetL = LPF.ar(aUpWetL, (2000).clip(20, 18000));
    aUpFeedbackL = aUpWetL;
    aL = ((aL * 0.96) + (aUpWetL * 0.04));
    aUpTapR = DelayC.ar((aR + (aUpFeedbackR * 0.033)), 2000 / 1000, (aUpTime / 1000).clip(0.00002, 2000 / 1000));
    aUpTap2R = DelayC.ar((aR + (aUpFeedbackR * 0.033)), 2000 / 1000, (aUpTime2 / 1000).clip(0.00002, 2000 / 1000));
    aUpWetR = ((aUpTapR * aUpWin) + (aUpTap2R * aUpWin2));
    aUpWetR = LPF.ar(aUpWetR, (2000).clip(20, 18000));
    aUpFeedbackR = aUpWetR;
    aR = ((aR * 0.96) + (aUpWetR * 0.04));
    };
    if((stage >= 3)) {
    aDownFeedbackL = feedback[2];
    aDownFeedbackR = feedback[3];
    aDownPhase = Phasor.ar(0, (((0.5 * (2 ** ((0 - 3) / 1200))) - 1) / 0.1) / SampleRate.ir, 0, 1);
    aDownPhase2 = ((aDownPhase + 0.5)).wrap(0, 1);
    aDownWin = (((aDownPhase * 3.14159265359)).sin ** 2);
    aDownWin2 = (((aDownPhase2 * 3.14159265359)).sin ** 2);
    aDownTime = (500.0 + ((1 - aDownPhase) * 100));
    aDownTime2 = (500.0 + ((1 - aDownPhase2) * 100));
    aDownTapL = DelayC.ar((aL + (aDownFeedbackL * 0.068)), 2000 / 1000, (aDownTime / 1000).clip(0.00002, 2000 / 1000));
    aDownTap2L = DelayC.ar((aL + (aDownFeedbackL * 0.068)), 2000 / 1000, (aDownTime2 / 1000).clip(0.00002, 2000 / 1000));
    aDownWetL = ((aDownTapL * aDownWin) + (aDownTap2L * aDownWin2));
    aDownWetL = LPF.ar(aDownWetL, (1800).clip(20, 18000));
    aDownFeedbackL = aDownWetL;
    aL = ((aL * 0.975) + (aDownWetL * 0.025));
    aDownTapR = DelayC.ar((aR + (aDownFeedbackR * 0.068)), 2000 / 1000, (aDownTime / 1000).clip(0.00002, 2000 / 1000));
    aDownTap2R = DelayC.ar((aR + (aDownFeedbackR * 0.068)), 2000 / 1000, (aDownTime2 / 1000).clip(0.00002, 2000 / 1000));
    aDownWetR = ((aDownTapR * aDownWin) + (aDownTap2R * aDownWin2));
    aDownWetR = LPF.ar(aDownWetR, (1800).clip(20, 18000));
    aDownFeedbackR = aDownWetR;
    aR = ((aR * 0.975) + (aDownWetR * 0.025));
    };
    if((stage >= 4)) {
    aRoomInL = aL;
    aRoomPreL = DelayN.ar(aRoomInL, 0.01, 0.01);
    aRoomInR = aR;
    aRoomPreR = DelayN.ar(aRoomInR, 0.01, 0.01);
    room51 = FreeVerb2.ar(aRoomPreL, aRoomPreR, 1, 0.96, 0.8875);
    aRoomL = room51[0];
    aRoomR = room51[1];
    aRoomMid = ((aRoomL + aRoomR) * 0.5);
    aRoomSide = (((aRoomL - aRoomR) * 0.5) * 1);
    aL = ((aL * 0.5) + ((aRoomMid + aRoomSide) * 0.5));
    aR = ((aR * 0.5) + ((aRoomMid - aRoomSide) * 0.5));
    };
    LocalOut.ar([aUpFeedbackL, aUpFeedbackR, aDownFeedbackL, aDownFeedbackR].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]);
        "Resonant Octave Mist 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.() };
)