playgrid.ccRead tutorial

Tutorial 145 / Csound

Build Sorrel Hollow in Csound

Build Sorrel Hollow in Csound with drifting bass synthesis, explicit contours and the sound-shaping chain explained in the guide.

4 stepsDrifting BassCsound 6

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

Set giStage init 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.

Csound 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 giStage init 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.

Csound 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

Sound after step 2 — WebM/Opus

Next: Round the signal with saturation →

Step 03 / 4

Round the signal with saturation

Set giStage init 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 × ampdb(drive)) / 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.

Csound control Value
Drive / output 2.3 / -2 dB
Shaped mix 70%
Input DC removal Order 2048

Sound after step 3 — WebM/Opus

Next: Set the final width and gain →

Step 04 / 4

Set the final width and gain

Set giStage init 4 in the full script. Use 2.86 dB gain after the effects. Average the channels for identical mono outputs. Apply order-2048 DC removal, using a longer window to limit low-note loss. The fixed output-scale control at the end of instrument 90 remains a separate Csound gain setting. Clear the shared note buses only after processing them; effect memories continue carrying their own tails.

Csound control Value
Final gain 2.86 dB
Width Mono
Bass side cutoff Off
DC removal Order 2048

Sound after step 4 — WebM/Opus

Audio & settings ↓

Audio & settings

Audio recordings and settings for this tutorial.

Full Csound script

This document contains the complete Sorrel Hollow source, shared effects and example score. giStage selects the cumulative stages from 1 to 4; 4 is the finished sound.

<CsoundSynthesizer>
<CsOptions>
-odac -d
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 16
nchnls = 2
0dbfs = 1

giStage init 4
giOutputScale init 0.6205891
giSine ftgen 0, 0, 16384, 10, 1
gaLeft init 0
gaRight init 0

instr 1
  iHz = cpsmidinn(p4)
  iVelocity = limit(p5, 0, 1)
  kDrift oscili 0.6000000000000001, 0.19, giSine
  kHz = iHz*pow(2,kDrift/1200)
  aSource vco2 ampdb(-8.0), kHz, 0, 0.5, 0
  if giStage >= 2 then
  aSub oscili ampdb(-7.0), kHz*0.5, giSine, 0
  aSource = aSource+aSub
  kFilter linsegr 0, 0.002, 1, 0.45, 0.2, 0.2, 0
  kCut = limit(244.0*pow(2,0.8999999999999999*kFilter+0.6*(p4-60)/12+0.24*iVelocity),30,18000)
  aSource moogladder aSource,kCut,0.25
  aSource butterhp aSource,25.0
  endif
  kAmp linsegr 0, 0.0068, 1, 1.29, 0.7, 0.203, 0
  aL = aSource*kAmp*ampdb(-6.0)*(0.6+0.4*iVelocity)
  aR = aL
  gaLeft = gaLeft+aL
  gaRight = gaRight+aR
endin
instr 90
  aL = gaLeft
  aR = gaRight
  if giStage >= 3 then
    aCleanL dcblock2 aL, 2048
    aShapeL = tanh(aCleanL*3*ampdb(2.3))/3
    aL = (aCleanL*0.30000000000000004+aShapeL*0.7)*ampdb(-2.0)
    aCleanR dcblock2 aR, 2048
    aShapeR = tanh(aCleanR*3*ampdb(2.3))/3
    aR = (aCleanR*0.30000000000000004+aShapeR*0.7)*ampdb(-2.0)
  endif
  if giStage >= 4 then
    aEndMid = (aL+aR)*0.5
    aEndSide = (aL-aR)*0.5*0
    aL = (aEndMid+aEndSide)*ampdb(2.86)
    aL dcblock2 aL, 2048
    aR = (aEndMid-aEndSide)*ampdb(2.86)
    aR dcblock2 aR, 2048
  endif
  outs aL*giOutputScale, aR*giOutputScale
  clear gaLeft, gaRight
endin
</CsInstruments>
<CsScore>
; p3 held seconds, p4 MIDI pitch, p5 velocity
i 1 0 0.8 36 0.85
i 1 1.5 0.8 43 0.95
i 1 3 0.8 40 0.8
i 90 0 8.003
e
</CsScore>
</CsoundSynthesizer>