# Build Indigo Arc in Csound

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

Indigo Arc in Csound follows the sound-shaping ideas of the [Ableton Wavetable version](/tutorials/indigo-arc/), 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 — Build the detuned source and amplitude contour

Set `giStage init 1` in the full script. Use 3 band-limited triangle voices at -10 dB each, spread by 10.8 cents between adjacent voices. Reverse the stereo weights across the channels. The amplitude opens in 1.18 seconds, decays over 2.62 seconds to 0.794328, and releases over 3.04 seconds. Basic Shapes is represented by this explicit waveform; Shimmer, where present, becomes slow independent pitch drift rather than the original unison engine.

| Csound control | Value |
| --- | --- |
| Sources | 3 × triangle, -10 dB |
| Adjacent pitch spacing | 10.8 cents |
| Amp A/D/S/R | 1.18 s / 2.62 s / 0.794328 / 3.04 s |
| Instrument gain | -9 dB |
| Velocity multiplier | 0.4 + 0.6 × velocity |

<audio controls preload="none" aria-label="Csound Indigo Arc 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 — Blend the second source and animate the filters

Set `giStage init 2` in the full script. Add a triangle layer at -20 dB, 7 semitones and 0 cents. Add the quieter octave-down sine sub. The lowpass center starts from 1610 Hz and moves by 0.9 octaves under the second envelope. A positive depth opens the spectral ceiling; a negative depth moves the notch downward. The serial second filter keeps the specified high or low edge under control. Exact wavetable morphing, Warp/Fold and free-running source modulation are not implemented; the code below defines the chosen static spectra and note-local drift.

| Csound control | Value |
| --- | --- |
| Secondary layer | triangle, -20 dB; 7 st; 0 cents |
| Filter 1 | Lowpass, 1610 Hz base, 0.9 octave depth |
| Filter contour | 2.2 / 3.3 / 0.65 / 3.5 |
| Filter 2 | Highpass at 95.0 Hz |
| Pulse width | Not used |

<audio controls preload="none" aria-label="Csound Indigo Arc 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 moving stereo chorus

Set `giStage init 3` in the full script. Move two delay taps around 20 ms by ±4.6 ms at 0.38 Hz, with opposite phases and 24% wet mix. Highpass only the wet inputs at 200 Hz to leave the direct low body clear. Scale side information by 1.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 | 20 / ±4.6 ms |
| Rate / wet | 0.38 Hz / 24% |
| Wet highpass | 200 Hz |
| Width / feedback | 1.1 / 0 |
| Warmth shaping | 12% smooth-drive interpretation |

<audio controls preload="none" aria-label="Csound Indigo Arc 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 25 ms predelay into `reverbsc`, with feedback 0.8465, 3300 Hz damping and 28% wet mix. Predelay leaves the initial articulation in front; feedback prolongs the tail, while damping darkens repeated circulation. The source room decay setting is 4.2 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 | 4.2 s (not a measured Csound decay) |
| Predelay / feedback | 25 ms / 0.8465 |
| Damping / wet | 3300 Hz / 28% |
| Room side multiplier | 1 |
| Room input cuts | Off |

<audio controls preload="none" aria-label="Csound Indigo Arc 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 — Set the final width and gain

Set `giStage init 5` in the full script. Use 3.44 dB gain after the effects. Scale the side signal by 1.05, preserving the center. Highpass only the side at 180 Hz to focus the lowest frequencies. 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 | 3.44 dB |
| Width | 1.05 × side |
| Bass side cutoff | 180 Hz |
| DC removal | Order 2048 |

<audio controls preload="none" aria-label="Csound Indigo Arc 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/indigo-arc.webm) · [Complete settings](ALL_PARAMETERS.md) · [Ableton version](/tutorials/indigo-arc/)

## Full Csound script

This document contains the complete Indigo Arc source, shared effects and example score. `giStage` selects the cumulative stages from 1 to 5; 5 is the finished sound.

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

giStage init 5
giOutputScale init 1.321872
giSine ftgen 0, 0, 16384, 10, 1
gaLeft init 0
gaRight init 0

instr 1
  iHz = cpsmidinn(p4)
  iVelocity = limit(p5, 0, 1)
  kJ0 oscili 1.44, 0.1, giSine, 0.0
  aV0 vco2 ampdb(-10.0), iHz*pow(2,(-10.799999999999999+kJ0)/1200), 12, 0.5, 0.0
  if giStage >= 2 then
  aW0 vco2 ampdb(-20.0), iHz*pow(2,7.0/12+(-10.799999999999999)/1200), 12, 0.25, 0.0
  aV0 = aV0+aW0
  endif
  kJ1 oscili 1.44, 0.13, giSine, 0.3333333333333333
  aV1 vco2 ampdb(-10.0), iHz*pow(2,(0.0+kJ1)/1200), 12, 0.5, 0.3333333333333333
  if giStage >= 2 then
  aW1 vco2 ampdb(-20.0), iHz*pow(2,7.0/12+(0.0)/1200), 12, 0.25, 0.3333333333333333
  aV1 = aV1+aW1
  endif
  kJ2 oscili 1.44, 0.16, giSine, 0.6666666666666666
  aV2 vco2 ampdb(-10.0), iHz*pow(2,(10.799999999999999+kJ2)/1200), 12, 0.5, 0.6666666666666666
  if giStage >= 2 then
  aW2 vco2 ampdb(-20.0), iHz*pow(2,7.0/12+(10.799999999999999)/1200), 12, 0.25, 0.6666666666666666
  aV2 = aV2+aW2
  endif
  aL = (aV0*0.8+aV1*0.5+aV2*0.20000000000000007)/1.5
  aR = (aV0*0.2+aV1*0.5+aV2*0.8)/1.5
  if giStage >= 2 then
  aSub oscili ampdb(-20.0), iHz*0.5, giSine, 0
  aL = aL+aSub
  aR = aR+aSub
  endif
  if giStage >= 2 then
  kFilter linsegr 0, 2.2, 1, 3.3, 0.65, 3.5, 0
  kCut = limit(1610.0*pow(2,0.9*kFilter+0.0*(p4-60)/12),30,18000)
  aL lowpass2 aL, kCut, 1.12
  aL butterhp aL, 95.0
  aR lowpass2 aR, kCut, 1.12
  aR butterhp aR, 95.0
  endif
  kAmp linsegr 0, 1.18, 1, 2.62, 0.7943282347242815, 3.04, 0
  kGain = kAmp*ampdb(-9.0)*(0.4+0.6*iVelocity)
  aL = aL*kGain
  aR = aR*kGain
  gaLeft = gaLeft+aL
  gaRight = gaRight+aR
endin
instr 90
  aL = gaLeft
  aR = gaRight
  if giStage >= 3 then
    aChFbL init 0
    aChFbR init 0
    aChInL butterhp aL, 200.0
    aChInR butterhp aR, 200.0
    kCh oscili 1, 0.38, giSine
    aChTimeL interp 20+4.6000000000000005*kCh
    aChTimeR interp 20-4.6000000000000005*kCh
    aTapL vdelay3 aChInL+aChFbL*0, aChTimeL, 80
    aTapR vdelay3 aChInR+aChFbR*0, aChTimeR, 80
    aChFbL = aTapL
    aChFbR = aTapR
    aL = aL*0.76+aTapL*0.24
    aR = aR*0.76+aTapR*0.24
    aChMid = (aL+aR)*0.5
    aChSide = (aL-aR)*0.5*1.1
    aL = aChMid+aChSide
    aR = aChMid-aChSide
    aL = tanh(aL*1.12)/1.12
    aR = tanh(aR*1.12)/1.12
  endif
  if giStage >= 4 then
    aRoomInL = aL
    aRoomPreL delay aRoomInL, 0.025
    aRoomInR = aR
    aRoomPreR delay aRoomInR, 0.025
    aRoomL, aRoomR reverbsc aRoomPreL, aRoomPreR, 0.8465, 3300.0, sr, 0.4
    aRoomMid = (aRoomL+aRoomR)*0.5
    aRoomSide = (aRoomL-aRoomR)*0.5*1
    aL = aL*0.72+(aRoomMid+aRoomSide)*0.28
    aR = aR*0.72+(aRoomMid-aRoomSide)*0.28
  endif
  if giStage >= 5 then
    aEndMid = (aL+aR)*0.5
    aEndSide = (aL-aR)*0.5*1.05
    aEndSide butterhp aEndSide, 180.0
    aL = (aEndMid+aEndSide)*ampdb(3.44)
    aL dcblock2 aL, 2048
    aR = (aEndMid-aEndSide)*ampdb(3.44)
    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 3 48 0.8
i 1 7.5 3 55 0.9
i 1 15 3 60 0.72
i 90 0 36.5
e
</CsScore>
</CsoundSynthesizer>
```

[Read on playgrid.cc](https://playgrid.cc/tutorials/indigo-arc/csound/)
