playgrid.ccRead tutorial

Tutorial 011 / SuperCollider

Build Swelling Pulse Pad in SuperCollider

Build Swelling Pulse Pad in SuperCollider with swelling pulse pad, explicit envelopes and the sound-shaping chain explained in the guide.

4 stepsSwelling Pulse 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

Build the independently swelling pulse 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 two pulse sources at widths 0.33 and 0.36 with gains −6 and −9 dB, the second seven cents flat. Three light unison offsets span ±2.4 cents. Transpose the whole source one octave down and use −11 dB instrument gain. The 1.95 s amplitude opening is independent of the 1.71 s filter rise; the tracked 1360 Hz lowpass moves by 1.25 octaves then settles to 14% envelope sustain.

SuperCollider control Value
Pulse pair Widths 0.33/0.36; −6/−9 dB; second −7 cents
Unison / transpose −2.4/0/+2.4 cents / −12 st
Amplitude 1.95 s / 2.10 s / full / 2.40 s
Filter 1360 Hz base; full key tracking; 1.25 octave depth
Filter contour 1.71 s / 2.37 s / 0.14 / 2.10 s
Instrument / touch −11 dB / 50%

Sound after step 1 — WebM/Opus

Next: Add moving stereo chorus →

Step 02 / 4

Add moving stereo chorus

Set ~soundStage = 2 in the full script. Move two delay taps around 7 ms by ±13 ms at 0.65 Hz, with opposite phases and 30% wet mix. The wet inputs remain full-band. 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 7 / ±13 ms
Rate / wet 0.65 Hz / 30%
Wet highpass Off
Width / feedback 1 / 0
Warmth shaping 0% smooth-drive interpretation

Sound after step 2 — WebM/Opus

Next: Balance the lower harmonics →

Step 03 / 4

Balance the lower harmonics

Set ~soundStage = 3 in the full script. Use a fixed low shelf at 75 Hz and three peaking filters. The shelf restrains the deepest energy, 160 Hz adds body, 392 Hz emphasizes one middle region and 523 Hz softens another. These centers stay fixed as notes change. The explicit parametric network interprets EQ Eight without its adaptive-Q or oversampling behavior.

SuperCollider control Value
Low shelf 75 Hz, −5 dB, Q 0.71
Peaks 160 Hz +2 dB Q0.8; 392 Hz +4.5 dB Q4; 523 Hz −2.5 dB Q4

Sound after step 3 — WebM/Opus

Next: Add filtered stereo echoes →

Step 04 / 4

Add filtered stereo echoes

Set ~soundStage = 4 in the full script. Use 300 ms left and 325 ms right, 12% feedback and 14% wet. Feed each channel back into itself, keeping the unequal timing paths independent. Filter each echo around 900 Hz, with a 5-octave interval between highpass and lowpass cutoffs. Feedback values are updated once per server processing block, adding that small delay to the recirculating path. Held notes leave older colors behind the current tone.

SuperCollider control Value
Times 300 / 325 ms
Feedback / wet 12% / 14%
Routing Independent channels
Filter center / width 900 Hz / 5 octaves
Time LFO 0 Hz, ±0%

Sound after step 4 — WebM/Opus

Audio & settings ↓

Audio & settings

Audio recordings and settings for this tutorial.

Full SuperCollider script

The complete Swelling Pulse Pad 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.745925;
~soundRelease = 2.4;
~soundNames = (motion: \pgSwellingPulsePadMotion, voice: \pgSwellingPulsePadVoice, effects: \pgSwellingPulsePadEffects);

~soundDefs = [
    SynthDef(\pgSwellingPulsePadMotion, { |out=0| Out.kr(out, DC.kr(0)) }),
    SynthDef(\pgSwellingPulsePadVoice, { |out=0, midi=60, velocity=0.8, gate=1, startMidi=60|
        var stage = ~soundStage;
    var aL = 0, aP0 = 0, aP1 = 0, aP2 = 0, aQ0 = 0, aQ1 = 0, aQ2 = 0, aR = 0;
    var aSource = 0, aV0 = 0, aV1 = 0, aV2 = 0, iHz = 0, iVelocity = 0, kAmp = 0, kCut = 0;
    var kFilter = 0, kHz = 0;
    iHz = (midi).midicps;
    iVelocity = (velocity).clip(0, 1);
    kHz = (iHz * 0.5);
    aP0 = (Pulse.ar((kHz * (2 ** ((0 - 2.4) / 1200))), 0.33) * ((0 - 6)).dbamp);
    aQ0 = (Pulse.ar((kHz * (2 ** ((0 - 9.4) / 1200))), 0.36) * ((0 - 9)).dbamp);
    aV0 = (aP0 + aQ0);
    aP1 = (Pulse.ar((kHz * (2 ** (0 / 1200))), 0.33) * ((0 - 6)).dbamp);
    aQ1 = (Pulse.ar((kHz * (2 ** ((0 - 7) / 1200))), 0.36) * ((0 - 9)).dbamp);
    aV1 = (aP1 + aQ1);
    aP2 = (Pulse.ar((kHz * (2 ** (2.4 / 1200))), 0.33) * ((0 - 6)).dbamp);
    aQ2 = (Pulse.ar((kHz * (2 ** ((0 - 4.6) / 1200))), 0.36) * ((0 - 9)).dbamp);
    aV2 = (aP2 + aQ2);
    aSource = (((aV0 + aV1) + aV2) / 3);
    kFilter = EnvGen.kr(Env([0, 1, 0.14, 0], [1.71, 2.37, 2.1], \lin, releaseNode: 2), gate);
    kCut = ((1360 * (2 ** ((1.25 * kFilter) + ((midi - 60) / 12))))).clip(30, 18000);
    aSource = MoogFF.ar(aSource, (kCut).clip(20, 18000), (0 * 4).clip(0, 3.95));
    kAmp = EnvGen.kr(Env([0, 1, 1, 0], [1.95, 2.1, 2.4], \lin, releaseNode: 2), gate);
    aL = (((aSource * kAmp) * ((0 - 11)).dbamp) * (0.5 + (0.5 * iVelocity)));
    aR = aL;
    Out.ar(out, [aL, aR]);
        EnvGen.kr(Env.asr(0.0001, 1, 2.4), gate, doneAction: 2);
    }),
    SynthDef(\pgSwellingPulsePadEffects, { |in=0, out=0|
        var stage = ~soundStage;
        var outputScale = ~soundOutputScale;
        var input = In.ar(in, 2);
    var feedback = LocalIn.ar(4);
    var aChFbL = 0, aChFbR = 0, aChInL = 0, aChInR = 0, aChMid = 0, aChSide = 0, aChTimeL = 0, aChTimeR = 0;
    var aDelFbL = 0, aDelFbR = 0, aDelSendL = 0, aDelSendR = 0, aDelTimeL = 0, aDelTimeR = 0, aEchoL = 0, aEchoR = 0;
    var aL = 0, aR = 0, aTapL = 0, aTapR = 0, kCh = 0, kDelCenter = 0, kDelMotion = 0;
    aL = input[0];
    aR = input[1];
    if((stage >= 2)) {
    aChFbL = feedback[0];
    aChFbR = feedback[1];
    aChInL = aL;
    aChInR = aR;
    kCh = (SinOsc.kr(0.65, 0 * 2pi) * 1);
    aChTimeL = K2A.ar((7 + (13.0 * kCh)));
    aChTimeR = K2A.ar((7 - (13.0 * 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.7) + (aTapL * 0.3));
    aR = ((aR * 0.7) + (aTapR * 0.3));
    aChMid = ((aL + aR) * 0.5);
    aChSide = (((aL - aR) * 0.5) * 1);
    aL = (aChMid + aChSide);
    aR = (aChMid - aChSide);
    };
    if((stage >= 3)) {
    aL = BLowShelf.ar(aL, 75, 1 / 0.71, (((0 - 5)).dbamp).ampdb);
    aL = BPeakEQ.ar(aL, 160, 1 / 0.8, ((2).dbamp).ampdb);
    aL = BPeakEQ.ar(aL, 392, 1 / 4, ((4.5).dbamp).ampdb);
    aL = BPeakEQ.ar(aL, 523, 1 / 4, (((0 - 2.5)).dbamp).ampdb);
    aR = BLowShelf.ar(aR, 75, 1 / 0.71, (((0 - 5)).dbamp).ampdb);
    aR = BPeakEQ.ar(aR, 160, 1 / 0.8, ((2).dbamp).ampdb);
    aR = BPeakEQ.ar(aR, 392, 1 / 4, ((4.5).dbamp).ampdb);
    aR = BPeakEQ.ar(aR, 523, 1 / 4, (((0 - 2.5)).dbamp).ampdb);
    };
    if((stage >= 4)) {
    aDelFbL = feedback[2];
    aDelFbR = feedback[3];
    kDelMotion = 0;
    aDelTimeL = K2A.ar((300.0 * (1 + (0 * kDelMotion))));
    aDelTimeR = K2A.ar((325.0 * (1 - (0 * kDelMotion))));
    aDelSendL = aL;
    aDelSendR = aR;
    aEchoL = DelayC.ar((aDelSendL + (aDelFbL * 0.12)), 2200 / 1000, (aDelTimeL / 1000).clip(0.00002, 2200 / 1000));
    aEchoR = DelayC.ar((aDelSendR + (aDelFbR * 0.12)), 2200 / 1000, (aDelTimeR / 1000).clip(0.00002, 2200 / 1000));
    kDelCenter = (900 * (2 ** (0 * kDelMotion)));
    aEchoL = HPF.ar(aEchoL, ((kDelCenter / (2 ** 2.5))).clip(20, 18000));
    aEchoL = LPF.ar(aEchoL, ((18000).min((kDelCenter * (2 ** 2.5)))).clip(20, 18000));
    aEchoR = HPF.ar(aEchoR, ((kDelCenter / (2 ** 2.5))).clip(20, 18000));
    aEchoR = LPF.ar(aEchoR, ((18000).min((kDelCenter * (2 ** 2.5)))).clip(20, 18000));
    aDelFbL = aEchoL;
    aDelFbR = aEchoR;
    aL = ((aL * 0.86) + (aEchoL * 0.14));
    aR = ((aR * 0.86) + (aEchoR * 0.14));
    };
    LocalOut.ar([aChFbL, aChFbR, aDelFbL, aDelFbR].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]);
        "Swelling Pulse Pad 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.() };
)