playgrid.ccRead tutorial

Tutorial 002 / SuperCollider

Build Hollow Pulse Bass in SuperCollider

Build Hollow Pulse Bass in SuperCollider with harmonic bass, explicit envelopes and the sound-shaping chain explained in the guide.

6 stepsHarmonic 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 / 6

Establish the strong second harmonic

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. A sine at ratio 2 carries the body, with 2 ms attack, 1 s decay to −3.5 dB and 25 ms release. Velocity contributes 35% of its level multiplier. The root will arrive later, leaving the octave deliberately strongest.

SuperCollider control Value
A Sine, ratio 2, 0 dB
Amplitude 2 ms / 1 s / −3.5 dB / 25 ms
Instrument −12 dB

Sound after step 1 — WebM/Opus

Next: Replace the sine with a bright saw →

Step 02 / 6

Replace the sine with a bright saw

Set ~soundStage = 2 in the full script. Change A to a band-limited saw at the same ratio and level. Its upper harmonics brighten the second-harmonic body. This interprets Saw 64 without fixing the source to exactly 64 harmonics at every pitch.

SuperCollider control Value
A waveform Band-limited saw, ratio 2

Sound after step 2 — WebM/Opus

Next: Add the quieter root and third-harmonic layer →

Step 03 / 6

Add the quieter root and third-harmonic layer

Set ~soundStage = 3 in the full script. Add ratio-3 saw at −6.5 dB and ratio-1 sine at −15 dB. Their 2 ms / 1 s / −2.5 dB / 25 ms contour keeps them close to the main body while allowing the root to remain quieter than the octave.

SuperCollider control Value
B Saw, ratio 3, −6.5 dB
C Sine, ratio 1, −15 dB
B/C sustain −2.5 dB

Sound after step 3 — WebM/Opus

Next: Let the fourth harmonic swell and recede →

Step 04 / 6

Let the fourth harmonic swell and recede

Set ~soundStage = 4 in the full script. Add a ratio-4 sine at −10 dB with a 280 ms rise, 120 ms fall to zero and 25 ms release. Its independent envelope produces a rounded middle without a repeating LFO.

SuperCollider control Value
D Sine, ratio 4, −10 dB
D envelope 280 ms / 120 ms / zero / 25 ms

Sound after step 4 — WebM/Opus

Next: Close the spectral ceiling →

Step 05 / 6

Close the spectral ceiling

Set ~soundStage = 5 in the full script. Use a 280 Hz Butterworth lowpass with a 480 ms envelope moving it by 3.3 octaves at the beginning. This explicit sweep interprets the source 55% modulation amount; no key or velocity tracking is added.

SuperCollider control Value
Filter 280 Hz base; 3.3 octave opening
Filter decay / release 480 / 50 ms

Sound after step 5 — WebM/Opus

Next: Add the small downward tuning drift →

Step 06 / 6

Add the small downward tuning drift

Set ~soundStage = 6 in the full script. Move every source from −5 to −18 cents over 500 ms and use −8 dB instrument gain. The movement is intentionally cents, not a many-semitone fall. The output remains centered and contains no external effects.

SuperCollider control Value
Pitch −5 → −18 cents in 500 ms
Instrument −8 dB

Sound after step 6 — WebM/Opus

Audio & settings ↓

Audio & settings

Audio recordings and settings for this tutorial.

Full SuperCollider script

The complete Hollow Pulse Bass instrument uses stock SuperCollider units. Set ~soundStage from 1 to 6 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 = 6;
~soundOutputScale = 0.4482905;
~soundRelease = 0.05;
~soundNames = (motion: \pgHollowPulseBassMotion, voice: \pgHollowPulseBassVoice, effects: \pgHollowPulseBassEffects);

~soundDefs = [
    SynthDef(\pgHollowPulseBassMotion, { |out=0| Out.kr(out, DC.kr(0)) }),
    SynthDef(\pgHollowPulseBassVoice, { |out=0, midi=60, velocity=0.8, gate=1, startMidi=60|
        var stage = ~soundStage;
    var aA = 0, aB = 0, aC = 0, aD = 0, aL = 0, aR = 0, aSaw = 0, aSource = 0;
    var iHz = 0, iVelocity = 0, kA = 0, kBC = 0, kCents = 0, kD = 0, kFilter = 0, kGain = 0;
    var kHz = 0;
    iHz = (midi).midicps;
    iVelocity = (velocity).clip(0, 1);
    kCents = 0;
    if((stage >= 6)) {
    kCents = EnvGen.kr(Env([(0 - 5), (0 - 18), (0 - 18)], [0.5, 1], \lin));
    };
    kHz = (iHz * (2 ** (kCents / 1200)));
    aA = (SinOsc.ar((kHz * 2), 0 * 2pi) * 1);
    if((stage >= 2)) {
    aSaw = (Saw.ar((kHz * 2)) * 1);
    aA = aSaw;
    };
    kA = EnvGen.kr(Env([0, 1, 0.6683439175686147, 0], [0.002, 1, 0.025], \lin, releaseNode: 2), gate);
    aSource = ((aA * kA) * (0.65 + (0.35 * iVelocity)));
    if((stage >= 3)) {
    aB = (Saw.ar((kHz * 3)) * ((0 - 6.5)).dbamp);
    aC = (SinOsc.ar(kHz, 0 * 2pi) * ((0 - 15)).dbamp);
    kBC = EnvGen.kr(Env([0, 1, 0.7498942093324559, 0], [0.002, 1, 0.025], \lin, releaseNode: 2), gate);
    aSource = (aSource + (((aB + aC) * kBC) * (0.65 + (0.35 * iVelocity))));
    };
    if((stage >= 4)) {
    kD = EnvGen.kr(Env([0, 1, 0, 0], [0.28, 0.12, 0.025], \lin, releaseNode: 2), gate);
    aD = (SinOsc.ar((kHz * 4), 0 * 2pi) * ((0 - 10)).dbamp);
    aSource = (aSource + ((aD * kD) * (0.65 + (0.35 * iVelocity))));
    };
    if((stage >= 5)) {
    kFilter = EnvGen.kr(Env([1, 0, 0], [0.480, 0.05], \lin, releaseNode: 1), gate);
    aSource = LPF.ar(aSource, ((280 * (2 ** (3.3 * kFilter)))).clip(20, 18000));
    };
    kGain = ((0 - 12)).dbamp;
    if((stage >= 6)) {
    kGain = ((0 - 8)).dbamp;
    };
    aL = (aSource * kGain);
    aR = aL;
    Out.ar(out, [aL, aR]);
        EnvGen.kr(Env.asr(0.0001, 1, 0.05), gate, doneAction: 2);
    }),
    SynthDef(\pgHollowPulseBassEffects, { |in=0, out=0|
        var stage = ~soundStage;
        var outputScale = ~soundOutputScale;
        var input = In.ar(in, 2);
    var aL = 0, aR = 0;
    aL = input[0];
    aR = input[1];
    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]);
        "Hollow Pulse Bass 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.() };
)