# Build Falling Spectral Lead in Csound

[SuperCollider version](/tutorials/falling-spectral-lead/supercollider/): the same sound interpreted with stock SuperCollider synthesis units.

Falling Spectral Lead in Csound follows the sound-shaping ideas of the [Ableton Operator version](/tutorials/falling-spectral-lead/), using the explicit oscillators, contours and effects below.

[Starting settings](STARTING_STATE.md) · [Complete settings](ALL_PARAMETERS.md). The complete script follows the final step and related sounds.

## Step 1 — Begin with the plain sine

Set `giStage init 1` in the full script. Start from a sine carrier, a near-instant opening, full sustain and 400 ms release. Use −18 dB source gain and no filter, pitch movement or effects. The initial source isolates the fundamental before its harmonic layers are added.

| Csound control | Value |
| --- | --- |
| Carrier / gain | Sine, ratio 1 / −18 dB |
| Amplitude | 0.1 ms attack; full sustain; 400 ms release |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead 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 — Build the parallel harmonic layers

Set `giStage init 2` in the full script. Mix four independent sources. Truncated saw tables retain four, three and eight partials rather than using FM; the sine at ratio 4 reinforces the high even body. GEN10 tables use unnormalized 1/n coefficients. This keeps the harmonic construction explicit.

| Csound control | Value |
| --- | --- |
| A | Ratio 2; four-partial saw; −5 dB |
| B | Ratio 4; sine; −1 dB |
| C | Ratio 3; three-partial saw; −7 dB |
| D | Ratio 1; eight-partial saw; −18 dB |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead 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 — Give every layer the same swell

Set `giStage init 3` in the full script. Use a 145 ms attack, 1.10 s decay to −10 dB and 350 ms release. A shared linear contour represents the four matching source envelopes. Short notes release before the body develops; held notes settle into a quieter sustain.

| Csound control | Value |
| --- | --- |
| Amplitude A/D/S/R | 145 ms / 1.10 s / −10 dB / 350 ms |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead 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 the falling pitch contour

Set `giStage init 4` in the full script. Start two semitones above each note and fall to its pitch over 1.10 seconds. A note-off release of 899 ms brings any remaining offset to zero. Every harmonic follows the same moving fundamental.

| Csound control | Value |
| --- | --- |
| Pitch | +2 → 0 semitones in 1.10 s |
| Pitch release | 899 ms |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead 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 — Soften the spectrum and raise instrument gain

Set `giStage init 5` in the full script. Use a 6200 Hz ladder lowpass with zero resonance, then set instrument gain to +2.5 dB. This interprets the source Clean 24 dB filter. Operator Tone and its small global spread are not separate controls here; chorus supplies the later stereo movement.

| Csound control | Value |
| --- | --- |
| Lowpass | 6200 Hz, resonance 0 |
| Instrument gain | +2.5 dB |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead 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)

## Step 6 — Add moving stereo chorus

Set `giStage init 6` in the full script. Move two delay taps around 15 ms by ±4.4 ms at 0.65 Hz, with opposite phases and 20% 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.

| Csound control | Value |
| --- | --- |
| Tap center / excursion | 15 / ±4.4 ms |
| Rate / wet | 0.65 Hz / 20% |
| Wet highpass | Off |
| Width / feedback | 1 / 0 |
| Warmth shaping | 0% smooth-drive interpretation |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead after step 6"><source src="audio/steps/step-06.webm" type="audio/webm"></audio>

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

## Step 7 — Add full-band stereo echoes

Set `giStage init 7` in the full script. Use 939 ms left and 939 ms right, 32% feedback and 22% wet. Inject the centered input on the left and cross-feed the filtered echoes so later repeats alternate sides. Keep repeats full-band. Feedback values are updated once per 16-sample block, adding that small delay to the recirculating path. Held notes leave older colors behind the current tone.

| Csound control | Value |
| --- | --- |
| Times | 939 / 939 ms |
| Feedback / wet | 32% / 22% |
| Routing | Crossed, left input |
| Filter center / width | Off |
| Time LFO | 0 Hz, ±0% |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead after step 7"><source src="audio/steps/step-07.webm" type="audio/webm"></audio>

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

## Step 8 — Surround the tone with a damped room

Set `giStage init 8` in the full script. Feed the preceding signal through 12 ms predelay into `reverbsc`, with feedback 0.9209, 6000 Hz damping and 68% wet mix. Predelay leaves the initial articulation in front; feedback prolongs the tail, while damping darkens repeated circulation. The source room decay setting is 8.5 seconds, but Csound feedback is not a decay-time control: this is an interpretation of that space, with different diffusion and modulation. 

| Csound control | Value |
| --- | --- |
| Source decay target | 8.5 s (not a measured Csound decay) |
| Predelay / feedback | 12 ms / 0.9209 |
| Damping / wet | 6000 Hz / 68% |
| Room side multiplier | 1 |
| Room input cuts | Off |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead after step 8"><source src="audio/steps/step-08.webm" type="audio/webm"></audio>

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

## Step 9 — Set the final width and gain

Set `giStage init 9` in the full script. Use 0.5 dB gain after the effects. Scale the side signal by 0.85, preserving the center. Leave final DC removal off. 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 | 0.5 dB |
| Width | 0.85 × side |
| Bass side cutoff | Off |
| DC removal | Off |

<audio controls preload="none" aria-label="Csound Falling Spectral Lead after step 9"><source src="audio/steps/step-09.webm" type="audio/webm"></audio>

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

## Downloads and settings

[Finished sound — WebM/Opus](audio/Falling-Spectral-Lead.webm) · [Complete settings](ALL_PARAMETERS.md) · [Ableton version](/tutorials/falling-spectral-lead/)

## Full Csound script

This document contains the complete Falling Spectral Lead source, shared effects and example score. `giStage` selects the cumulative stages from 1 to 9; 9 is the finished sound.

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

giStage init 9
giOutputScale init 0.08914749
giSine ftgen 0, 0, 16384, 10, 1
gaLeft init 0
gaRight init 0
giSawA ftgen 0,0,16384,-10,1.0,0.5,0.3333333333333333,0.25
giSawC ftgen 0,0,16384,-10,1.0,0.5,0.3333333333333333
giSawD ftgen 0,0,16384,-10,1.0,0.5,0.3333333333333333,0.25,0.2,0.16666666666666666,0.14285714285714285,0.125

instr 1
  iHz = cpsmidinn(p4)
  iVelocity = limit(p5, 0, 1)
  kPitch = 0
  if giStage >= 4 then
    kPitch linsegr 2,1.10,0,0.899,0
  endif
  kHz = iHz*pow(2,kPitch/12)
  aSource oscili 1,kHz,giSine
  if giStage >= 2 then
    aA oscili ampdb(-5),kHz*2,giSawA
    aB oscili ampdb(-1),kHz*4,giSine
    aC oscili ampdb(-7),kHz*3,giSawC
    aD oscili ampdb(-18),kHz,giSawD
    aSource = aA+aB+aC+aD
  endif
  kAmp linsegr 0,0.0001,1,1,1,0.4,0
  if giStage >= 3 then
    kFinal linsegr 0,0.145,1,1.10,ampdb(-10),0.350,0
    kAmp = kFinal
  endif
  kGain = ampdb(-18)
  if giStage >= 5 then
    aSource moogladder aSource,6200,0
    kGain = ampdb(2.5)
  endif
  aL = aSource*kAmp*kGain
  aR = aL
  gaLeft = gaLeft+aL
  gaRight = gaRight+aR
endin
instr 90
  aL = gaLeft
  aR = gaRight
  if giStage >= 6 then
    aChFbL init 0
    aChFbR init 0
    aChInL = aL
    aChInR = aR
    kCh oscili 1, 0.65, giSine
    aChTimeL interp 15+4.4*kCh
    aChTimeR interp 15-4.4*kCh
    aTapL vdelay3 aChInL+aChFbL*0, aChTimeL, 80
    aTapR vdelay3 aChInR+aChFbR*0, aChTimeR, 80
    aChFbL = aTapL
    aChFbR = aTapR
    aL = aL*0.8+aTapL*0.2
    aR = aR*0.8+aTapR*0.2
    aChMid = (aL+aR)*0.5
    aChSide = (aL-aR)*0.5*1
    aL = aChMid+aChSide
    aR = aChMid-aChSide
  endif
  if giStage >= 7 then
    aDelFbL init 0
    aDelFbR init 0
    kDelMotion = 0
    aDelTimeL interp 939.0*(1+0*kDelMotion)
    aDelTimeR interp 939.0*(1-0*kDelMotion)
    aDelSendL = (aL+aR)*0.5
    aDelSendR = 0
    aEchoL vdelay3 aDelSendL+aDelFbR*0.32, aDelTimeL, 2200
    aEchoR vdelay3 aDelSendR+aDelFbL*0.32, aDelTimeR, 2200
    aDelFbL = aEchoL
    aDelFbR = aEchoR
    aL = aL*0.78+aEchoL*0.22
    aR = aR*0.78+aEchoR*0.22
  endif
  if giStage >= 8 then
    aRoomInL = aL
    aRoomPreL delay aRoomInL, 0.012
    aRoomInR = aR
    aRoomPreR delay aRoomInR, 0.012
    aRoomL, aRoomR reverbsc aRoomPreL, aRoomPreR, 0.9209, 6000, sr, 0.4
    aRoomMid = (aRoomL+aRoomR)*0.5
    aRoomSide = (aRoomL-aRoomR)*0.5*1
    aL = aL*0.31999999999999995+(aRoomMid+aRoomSide)*0.68
    aR = aR*0.31999999999999995+(aRoomMid-aRoomSide)*0.68
  endif
  if giStage >= 9 then
    aEndMid = (aL+aR)*0.5
    aEndSide = (aL-aR)*0.5*0.85
    aL = (aEndMid+aEndSide)*ampdb(0.5)
    aR = (aEndMid-aEndSide)*ampdb(0.5)
  endif
  outs aL*giOutputScale, aR*giOutputScale
  clear gaLeft, gaRight
endin
</CsInstruments>
<CsScore>
; p3 held seconds, p4 MIDI pitch, p5 velocity
i 1 0 1.7 67 0.8
i 1 4 1.7 64 0.8
i 1 8 1.7 69 0.8
i 90 0 34.6
e
</CsScore>
</CsoundSynthesizer>
```

[Read on playgrid.cc](https://playgrid.cc/tutorials/falling-spectral-lead/csound/)
