# Build Resonant Octave Mist in Csound

[SuperCollider version](/tutorials/resonant-octave-mist/supercollider/): the same sound interpreted with stock SuperCollider synthesis units.

Resonant Octave Mist in Csound follows the sound-shaping ideas of the [Ableton Drift version](/tutorials/resonant-octave-mist/), 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 — Make a narrow, singing noise band

Set `giStage init 1` in the full script. Filter quiet white noise through two narrow resonances. The center is 890 Hz at MIDI 69 and tracks the keyboard; the channels differ by seven cents. A 0.30 Hz filter motion and slower pitch drift loosen the ringing. Shape amplitude with a 2.20 s attack, full sustain and 3.20 s release. This noise-band model approximates the source resonant tone without implementing Drift's self-oscillating filter.

| Csound control | Value |
| --- | --- |
| Noise / instrument | −24 / −12 dB |
| Centers | 890 Hz at MIDI 69, full tracking; 7-cent channel separation |
| Bandwidth | Center / 60 |
| Motion | 0.30 Hz, ±0.003 octaves; slower ±3 cents |
| Amplitude | 2.20 s attack, full sustain, 3.20 s release |

<audio controls preload="none" aria-label="Csound Resonant Octave Mist 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 the upper octave echo

Set `giStage init 2` in the full script. Use two overlapping 100 ms delay windows to shift the preceding signal by a frequency ratio of 2, plus 3 cents. The delay begins at 375 ms and moves across the additional window. Blend 4% shifted signal, lowpassed at 2000 Hz, with 3.3% local feedback. The next stage receives this whole blend, so series octave relationships also interact. This moving-window shifter differs from Ableton Shifter and adds window latency.

| Csound control | Value |
| --- | --- |
| Pitch ratio / cents | 2 / 3 |
| Base delay / window | 375 / 100 ms |
| Feedback / wet | 3.3% / 4% |
| Tone | 2000 Hz |

<audio controls preload="none" aria-label="Csound Resonant Octave Mist 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 — Add the lower octave echo

Set `giStage init 3` in the full script. Use two overlapping 100 ms delay windows to shift the preceding signal by a frequency ratio of 0.5, plus -3 cents. The delay begins at 500 ms and moves across the additional window. Blend 2.5% shifted signal, lowpassed at 1800 Hz, with 6.8% local feedback. The next stage receives this whole blend, so series octave relationships also interact. This moving-window shifter differs from Ableton Shifter and adds window latency.

| Csound control | Value |
| --- | --- |
| Pitch ratio / cents | 0.5 / -3 |
| Base delay / window | 500 / 100 ms |
| Feedback / wet | 6.8% / 2.5% |
| Tone | 1800 Hz |

<audio controls preload="none" aria-label="Csound Resonant Octave Mist 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 — Surround the tone with a damped room

Set `giStage init 4` in the full script. Feed the preceding signal through 10 ms predelay into `reverbsc`, with feedback 0.9383, 1800 Hz damping and 50% wet mix. Predelay leaves the initial articulation in front; feedback prolongs the tail, while damping darkens repeated circulation. The source room decay setting is 11 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 | 11 s (not a measured Csound decay) |
| Predelay / feedback | 10 ms / 0.9383 |
| Damping / wet | 1800 Hz / 50% |
| Room side multiplier | 1 |
| Room input cuts | Off |

<audio controls preload="none" aria-label="Csound Resonant Octave Mist 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)

## Downloads and settings

[Finished sound — WebM/Opus](audio/Resonant-Octave-Mist.webm) · [Complete settings](ALL_PARAMETERS.md) · [Ableton version](/tutorials/resonant-octave-mist/)

## Full Csound script

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

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

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

instr 1
  iHz = cpsmidinn(p4)
  iVelocity = limit(p5, 0, 1)
  aNoise rand ampdb(-24)
  kMotion oscili 1,0.30,giSine
  kDrift oscili 3,0.13,giSine,0.2
  kCenter = limit(890*pow(2,(p4-69)/12+(3.5+kDrift)/1200+0.003*kMotion),30,11000)
  aLeft reson aNoise,kCenter,kCenter/60,1
  aRight reson aNoise,kCenter*pow(2,-7/1200),kCenter/60,1
  kAmp linsegr 0, 2.2, 1, 0.6, 1, 3.2, 0
  aL = aLeft*kAmp*ampdb(-12)*(0.5+0.5*iVelocity)
  aR = aRight*kAmp*ampdb(-12)*(0.5+0.5*iVelocity)
  gaLeft = gaLeft+aL
  gaRight = gaRight+aR
endin
instr 90
  aL = gaLeft
  aR = gaRight
  if giStage >= 2 then
    aUpFeedbackL init 0
    aUpFeedbackR init 0
    aUpPhase phasor (2*pow(2,3/1200)-1)/0.1
    aUpPhase2 = frac(aUpPhase+0.5)
    aUpWin = sin(aUpPhase*3.14159265359)^2
    aUpWin2 = sin(aUpPhase2*3.14159265359)^2
    aUpTime = 375.0+(1-aUpPhase)*100
    aUpTime2 = 375.0+(1-aUpPhase2)*100
    aUpTapL vdelay3 aL+aUpFeedbackL*0.033, aUpTime, 2000
    aUpTap2L vdelay3 aL+aUpFeedbackL*0.033, aUpTime2, 2000
    aUpWetL = aUpTapL*aUpWin+aUpTap2L*aUpWin2
    aUpWetL butterlp aUpWetL, 2000
    aUpFeedbackL = aUpWetL
    aL = aL*0.96+aUpWetL*0.04
    aUpTapR vdelay3 aR+aUpFeedbackR*0.033, aUpTime, 2000
    aUpTap2R vdelay3 aR+aUpFeedbackR*0.033, aUpTime2, 2000
    aUpWetR = aUpTapR*aUpWin+aUpTap2R*aUpWin2
    aUpWetR butterlp aUpWetR, 2000
    aUpFeedbackR = aUpWetR
    aR = aR*0.96+aUpWetR*0.04
  endif
  if giStage >= 3 then
    aDownFeedbackL init 0
    aDownFeedbackR init 0
    aDownPhase phasor (0.5*pow(2,-3/1200)-1)/0.1
    aDownPhase2 = frac(aDownPhase+0.5)
    aDownWin = sin(aDownPhase*3.14159265359)^2
    aDownWin2 = sin(aDownPhase2*3.14159265359)^2
    aDownTime = 500.0+(1-aDownPhase)*100
    aDownTime2 = 500.0+(1-aDownPhase2)*100
    aDownTapL vdelay3 aL+aDownFeedbackL*0.068, aDownTime, 2000
    aDownTap2L vdelay3 aL+aDownFeedbackL*0.068, aDownTime2, 2000
    aDownWetL = aDownTapL*aDownWin+aDownTap2L*aDownWin2
    aDownWetL butterlp aDownWetL, 1800
    aDownFeedbackL = aDownWetL
    aL = aL*0.975+aDownWetL*0.025
    aDownTapR vdelay3 aR+aDownFeedbackR*0.068, aDownTime, 2000
    aDownTap2R vdelay3 aR+aDownFeedbackR*0.068, aDownTime2, 2000
    aDownWetR = aDownTapR*aDownWin+aDownTap2R*aDownWin2
    aDownWetR butterlp aDownWetR, 1800
    aDownFeedbackR = aDownWetR
    aR = aR*0.975+aDownWetR*0.025
  endif
  if giStage >= 4 then
    aRoomInL = aL
    aRoomPreL delay aRoomInL, 0.01
    aRoomInR = aR
    aRoomPreR delay aRoomInR, 0.01
    aRoomL, aRoomR reverbsc aRoomPreL, aRoomPreR, 0.9383, 1800, sr, 0.4
    aRoomMid = (aRoomL+aRoomR)*0.5
    aRoomSide = (aRoomL-aRoomR)*0.5*1
    aL = aL*0.5+(aRoomMid+aRoomSide)*0.5
    aR = aR*0.5+(aRoomMid-aRoomSide)*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 3 60 0.75
i 1 6 3 67 0.85
i 1 12 3 64 0.7
i 90 0 48.2
e
</CsScore>
</CsoundSynthesizer>
```

[Read on playgrid.cc](https://playgrid.cc/tutorials/resonant-octave-mist/csound/)
