# Build Cirrus Window in Csound

[SuperCollider version](/tutorials/cirrus-window/supercollider/): the same five-stage pad interpreted with stock SuperCollider synthesis units.

A Csound interpretation of the [Ableton Cirrus Window](/tutorials/cirrus-window/) pad. The two versions share a sound identity and five synthesis stages; the oscillator and effect algorithms differ.

[Complete orchestra and settings](ALL_PARAMETERS.md) · [Starting settings](STARTING_STATE.md)

## Step 1 — Build the detuned saw voices and slow amplitude contour

Define the `CirrusVoice` opcode and three voice calls from the [complete orchestra](ALL_PARAMETERS.md#complete-orchestra). Begin with the saw branch only: use `aBasic` as the opcode output. Keep the bandpass and lowpass bypassed, and listen directly to the amplitude-shaped voice sum before effects.

```csound
kAmp linsegr 0, 0.85, 1, 2.5, ampdb(-2), 2.4, 0
kAmp = kAmp^1.6
```

The 850 ms attack softens the saw edge; the power curve makes the middle of the rise quieter. Use detuning of −7, 0 and +7 cents, with ±2.2 cents of slow pitch drift. Weight the outside voices toward opposite stereo channels and keep the center voice shared. The −8 dB instrument gain and 0.65 multiplier set the level before effects. Longer held notes reveal beating; shorter notes may release before the attack reaches its peak.

<audio controls preload="none" aria-label="Csound Cirrus Window after step 1"><source src="audio/steps/step-01.webm" type="audio/webm"></audio>

[Sound after step 1 — WebM/Opus](audio/steps/step-01.webm)

## Step 2 — Add pulse width movement and serial filters

Restore `aBasic + aPulse` in the voice opcode. The pulse is −16 dB, 5 cents above each saw voice. Its width moves around 0.29 by ±0.025 under the shared 0.09 Hz sine LFO. Keep this LFO in instrument 90 so overlapping notes share the same motion.

```csound
kFilterEnv linsegr 0, 1.8, 1, 3, 0.6, 2.4, 0
kCutoff = 850 * pow(2, 0.8*kFilterEnv + 0.15*(p4-60)/12)
aBpL butterbp aL, kCutoff, kCutoff/0.85
aLpL butterlp aBpL, 6200
```

Apply the same filters to the right channel. The bandpass focuses the middle frequencies while its slow envelope opens the tone. The 6200 Hz lowpass softens the upper edge. Multiply both filtered channels by `kAmp * (0.55+0.45*iVelocity) * ampdb(-8) * 0.65` into the shared buses. Higher pitches open the bandpass slightly; velocity changes level without changing the envelope timing.

<audio controls preload="none" aria-label="Csound Cirrus Window after step 2"><source src="audio/steps/step-02.webm" type="audio/webm"></audio>

[Sound after step 2 — WebM/Opus](audio/steps/step-02.webm)

## Step 3 — Widen the pad with a three-tap ensemble

In instrument 90, highpass the effect inputs at 220 Hz, then use three `vdelay3` taps centered on 20 ms. Modulate each delay by ±3.6 ms at 0.24 Hz, with sine phases 0, 1/3 and 2/3. The staggered movement thickens the sustained tone.

```csound
kMod1 oscili 3.6, 0.24, giSine, 0
aTap1 vdelay3 aHpL, 20+kMod1, 40
```

Use the complete orchestra's tap routing: the center tap receives the mean of both highpassed channels. Mix 78% dry and 22% wet, with the outer tap weighted 75% and the center tap 25% in each wet channel. Convert to mid/side and multiply the side by 1.05. Increasing delay depth makes the pitch movement more obvious; increasing wet level brings the moving image forward.

<audio controls preload="none" aria-label="Csound Cirrus Window after step 3"><source src="audio/steps/step-03.webm" type="audio/webm"></audio>

[Sound after step 3 — WebM/Opus](audio/steps/step-03.webm)

## Step 4 — Add a damped stereo hall

Feed the ensemble output through 28 ms of predelay into `reverbsc`.

```csound
aPreL delay aChL, 0.028
aPreR delay aChR, 0.028
aRevL, aRevR reverbsc aPreL, aPreR, 0.84, 3300
aMixL = aChL*0.75 + aRevL*0.25
aMixR = aChR*0.75 + aRevR*0.25
```

Feedback 0.84 gives a lingering hall, while the 3300 Hz feedback damping darkens repeated circulation. The 25% wet mix leaves the filtered attack audible. Longer predelay separates the pad from its room; lower damping cutoff makes the tail darker. These controls approximate the character of the Ableton room rather than matching its decay control numerically.

<audio controls preload="none" aria-label="Csound Cirrus Window after step 4"><source src="audio/steps/step-04.webm" type="audio/webm"></audio>

[Sound after step 4 — WebM/Opus](audio/steps/step-04.webm)

## Step 5 — Focus the lows and finish the output

Convert the reverberated signal to mid/side. Highpass only the side channel at 180 Hz, then reconstruct left and right. This reduces low-frequency spread while leaving upper frequencies wide.

```csound
aMid = (aMixL+aMixR)*0.5
aSide = (aMixL-aMixR)*0.5
aSide butterhp aSide, 180
aOutL dcblock2 (aMid+aSide)*ampdb(10.9)
aOutR dcblock2 (aMid-aSide)*ampdb(10.9)
outs aOutL, aOutR
clear gaL, gaR
```

The +10.9 dB output gain restores level after the filters and effect blends. `dcblock2` removes DC offset. Clearing both buses prevents old note samples from accumulating on the next control block. The finished sound has a slow, focused center with moving upper harmonics and a diffuse stereo tail. See the [complete orchestra](ALL_PARAMETERS.md#complete-orchestra) for the connected implementation.

<audio controls preload="none" aria-label="Csound Cirrus Window after step 5"><source src="audio/steps/step-05.webm" type="audio/webm"></audio>

[Sound after step 5 — WebM/Opus](audio/steps/step-05.webm)

## Downloads and settings

[Finished sound — WebM/Opus](audio/cirrus-window.webm) · [Complete orchestra](ALL_PARAMETERS.md) · [Ableton implementation](/tutorials/cirrus-window/)

## Full Csound script

The complete Cirrus Window instrument, shared effects and example score in one Csound document. The score supplies pitch, held duration and velocity to the note instrument while instrument 90 carries the ensemble and reverb tails.

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

; Cirrus Window: Csound interpretation of the documented Ableton chain.
; Basic Shapes / Pulse PW -> serial BP/LP -> Ensemble -> Reverb -> Utility.
; Wavetable morphing, Shimmer, modulation scaling and effects are approximated.
giSine ftgen 0, 0, 16384, 10, 1
gaL init 0
gaR init 0
gkPosition init 0

; One of three unison voices. At 66%, Basic Shapes is near its saw stage.
opcode CirrusVoice, a, ikii
  iHz, kPW, iCents, iPhase xin
  kShimmer oscili 2.2, 0.17 + abs(iCents)*0.008, giSine, iPhase
  kHz = iHz * pow(2, (iCents+kShimmer)/1200)
  aBasic vco2 ampdb(-13), kHz, 0, 0.5, iPhase
  aPulse vco2 ampdb(-16), kHz*pow(2,5/1200), 2, kPW, iPhase+0.13
  xout aBasic + aPulse
endop

; p3 = held seconds (release is added); p4 = MIDI pitch; p5 = velocity 0..1.
instr 1
  iHz = cpsmidinn(p4)
  iVelocity = limit(p5,0,1)
  xtratim 2.4
  ; Linear attack; gently curved decay/release, matching the slow pad contour.
  kAmp linsegr 0, 0.85, 1, 2.5, ampdb(-2), 2.4, 0
  kAmp = kAmp^1.6
  kFilterEnv linsegr 0, 1.8, 1, 3, 0.6, 2.4, 0
  ; Free-running 0.09 Hz LFO, shared between notes rather than retriggered.
  kPW = 0.29 + 0.025*gkPosition
  aLeft CirrusVoice iHz, kPW, -7, 0.08
  aCenter CirrusVoice iHz, kPW, 0, 0.41
  aRight CirrusVoice iHz, kPW, 7, 0.73
  aL = (aLeft*0.87 + aCenter*0.5 + aRight*0.13)/1.5
  aR = (aRight*0.87 + aCenter*0.5 + aLeft*0.13)/1.5

  ; 850 Hz, 12 dB/oct bandpass; Env 2 opens it slowly.
  ; Matrix amounts are translated to a modest octave sweep/key tracking.
  kCutoff = 850 * pow(2, 0.8*kFilterEnv + 0.15*(p4-60)/12)
  aBpL butterbp aL, kCutoff, kCutoff/0.85
  aBpR butterbp aR, kCutoff, kCutoff/0.85
  aLpL butterlp aBpL, 6200
  aLpR butterlp aBpR, 6200
  ; Balance the filtered oscillator output before the effects.
  kGain = kAmp * (0.55+0.45*iVelocity) * ampdb(-8) * 0.65
  gaL = gaL + aLpL*kGain
  gaR = gaR + aLpR*kGain
endin

; Always-on global LFO, ensemble, reverb and output stage.
instr 90
  gkPosition oscili 1, 0.09, giSine
  ; Ensemble: 220 Hz highpass, 20 ms center delay, slow 0.24 Hz movement.
  aHpL butterhp gaL, 220
  aHpR butterhp gaR, 220
  kMod1 oscili 3.6, 0.24, giSine, 0
  kMod2 oscili 3.6, 0.24, giSine, 0.333333
  kMod3 oscili 3.6, 0.24, giSine, 0.666667
  aTap1 vdelay3 aHpL, 20+kMod1, 40
  aTap2 vdelay3 (aHpL+aHpR)*0.5, 20+kMod2, 40
  aTap3 vdelay3 aHpR, 20+kMod3, 40
  aEnsL = gaL*0.78 + (aTap1*0.75+aTap2*0.25)*0.22
  aEnsR = gaR*0.78 + (aTap3*0.75+aTap2*0.25)*0.22
  aMid = (aEnsL+aEnsR)*0.5
  aSide = (aEnsL-aEnsR)*0.5*1.05
  aChL = aMid+aSide
  aChR = aMid-aSide

  ; Diffuse, modulated hall: 28 ms predelay, roughly 3.6 s midband tail.
  ; Csound's feedback/damping controls differ from Ableton's decay/shelf.
  aPreL delay aChL, 0.028
  aPreR delay aChR, 0.028
  aRevL, aRevR reverbsc aPreL, aPreR, 0.84, 3300
  aMixL = aChL*0.75 + aRevL*0.25
  aMixR = aChR*0.75 + aRevR*0.25

  ; Utility: bass mono below 180 Hz, DC removal and +10.9 dB gain.
  aMid = (aMixL+aMixR)*0.5
  aSide = (aMixL-aMixR)*0.5
  aSide butterhp aSide, 180
  aOutL dcblock2 (aMid+aSide)*ampdb(10.9)
  aOutR dcblock2 (aMid-aSide)*ampdb(10.9)
  outs aOutL, aOutR
  clear gaL, gaR
endin
</CsInstruments>
<CsScore>
; Slow, overlapping pad chords, followed by space for the effect tail.
;     start hold MIDI velocity
i 1   0     2.5  60   0.79
i 1   0     2.5  64   0.79
i 1   0     2.5  67   0.79
i 1   0     2.5  74   0.79
i 1   3.5   2.5  53   0.79
i 1   3.5   2.5  60   0.79
i 1   3.5   2.5  64   0.79
i 1   3.5   2.5  67   0.79
i 90  0     17
e
</CsScore>
</CsoundSynthesizer>
```

[Read on playgrid.cc](https://playgrid.cc/tutorials/cirrus-window/csound/)
