# Build Solar Brass in Csound

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

Solar Brass in Csound follows the sound-shaping ideas of the [Ableton Analog version](/tutorials/solar-brass/), 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 first oscillator and touch contour

Set `giStage init 1` in the full script. Use saw at -8 dB with pulse width 50% when applicable. The contour has 0.035 s attack, 0.85 s exponential decay to 0.8 sustain and 0.35 s release. Multiply by velocity^3; this explicit power curve interprets the source velocity response. Keep the signal centered before adding effects.

| Csound control | Value |
| --- | --- |
| Source | Saw, -8.0 dB; width not used |
| Amplitude A/D/S/R | 0.035 / 0.85 / 0.8 / 0.35 |
| Amplifier / instrument | -6.0 dB / -6.0 dB |
| Velocity power | 3.0 |

<audio controls preload="none" aria-label="Csound Solar Brass 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 second oscillator and resonant contour

Set `giStage init 2` in the full script. Add rect at -15 dB, tuned by 0 octaves. Use a Low-pass 12dB/oct interpretation with 950 Hz base cutoff, 2 octave envelope depth and 0.6 octave-per-octave pitch tracking. The contour opens then settles quickly while the amplitude remains. Smooth input drive interprets Sym1; the ladder or second-order lowpass is a different circuit. The 0 Hz LFO, where enabled, restarts per score note rather than running freely.

| Csound control | Value |
| --- | --- |
| Second source | Rect; -15 dB; width 46 % |
| Filter base / resonance | 950 Hz / 0.2 |
| Filter A/D/S/R | 0.07 / 0.35 / 0.45 / 0.42 |
| Envelope / key / LFO depth | 2 / 0.6 / 0 octaves |
| LFO rate | 0 Hz |
| Filter input shape | tanh(input × 1.4) / 1.4 |

<audio controls preload="none" aria-label="Csound Solar Brass 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 12 ms by ±2.8 ms at 0.4 Hz, with opposite phases and 16% wet mix. Highpass only the wet inputs at 200 Hz to leave the direct low body clear. 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 | 12 / ±2.8 ms |
| Rate / wet | 0.4 Hz / 16% |
| Wet highpass | 200 Hz |
| Width / feedback | 1 / 0 |
| Warmth shaping | 0% smooth-drive interpretation |

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

<audio controls preload="none" aria-label="Csound Solar Brass 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 7.95 dB gain after the effects. Scale the side signal by 1, preserving the center. 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 | 7.95 dB |
| Width | 1 × side |
| Bass side cutoff | Off |
| DC removal | Order 2048 |

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

## Full Csound script

This document contains the complete Solar Brass 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 0.677229
giSine ftgen 0, 0, 16384, 10, 1
gaLeft init 0
gaRight init 0

instr 1
  iHz = cpsmidinn(p4)
  iVelocity = limit(p5, 0, 1)
  aSource vco2 ampdb(-8.0), iHz, 0, 0.5, 0
  if giStage >= 2 then
  aSecond vco2 ampdb(-15.0), iHz*pow(2,0+3.0/1200), 2, 0.46, 0
  aSource = aSource+aSecond
  kFilterGate linseg 0, 0.07, 1, 1, 1
  kFilterDecay expsegr 1, 0.07, 1, 0.35, 0.45, 0.42, 0.000001
  kFilter = kFilterGate*kFilterDecay
  kLFO oscili 1, 0, giSine
  kCut = limit(950.0*pow(2,2.0*kFilter+0.6*(p4-60)/12+0*kLFO),30,18000)
  aSource = tanh(aSource*1.4)/1.4
  aSource lowpass2 aSource, kCut, 1.2
  endif
  aAmpGate linseg 0, 0.035, 1, 1, 1
  aAmpDecay expsegr 1, 0.035, 1, 0.85, 0.8, 0.35, 0.000001
  aAmp = aAmpGate*aAmpDecay
  aL = aSource*aAmp*ampdb(-12.0)*iVelocity^3.0
  aR = aL
  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.4, giSine
    aChTimeL interp 12+2.8000000000000003*kCh
    aChTimeR interp 12-2.8000000000000003*kCh
    aTapL vdelay3 aChInL+aChFbL*0, aChTimeL, 80
    aTapR vdelay3 aChInR+aChFbR*0, aChTimeR, 80
    aChFbL = aTapL
    aChFbR = aTapR
    aL = aL*0.84+aTapL*0.16
    aR = aR*0.84+aTapR*0.16
    aChMid = (aL+aR)*0.5
    aChSide = (aL-aR)*0.5*1.0
    aL = aChMid+aChSide
    aR = aChMid-aChSide
  endif
  if giStage >= 4 then
    aRoomInL = aL
    aRoomPreL delay aRoomInL, 0.012
    aRoomInR = aR
    aRoomPreR delay aRoomInR, 0.012
    aRoomL, aRoomR reverbsc aRoomPreL, aRoomPreR, 0.6065, 4500.0, sr, 0.4
    aRoomMid = (aRoomL+aRoomR)*0.5
    aRoomSide = (aRoomL-aRoomR)*0.5*1
    aL = aL*0.86+(aRoomMid+aRoomSide)*0.14
    aR = aR*0.86+(aRoomMid-aRoomSide)*0.14
  endif
  if giStage >= 5 then
    aEndMid = (aL+aR)*0.5
    aEndSide = (aL-aR)*0.5*1.0
    aL = (aEndMid+aEndSide)*ampdb(7.95)
    aL dcblock2 aL, 2048
    aR = (aEndMid-aEndSide)*ampdb(7.95)
    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 1.5 48 0.8
i 1 2.92 1.5 55 0.9
i 1 5.84 1.5 60 0.72
i 90 0 19.76
e
</CsScore>
</CsoundSynthesizer>
```

[Read on playgrid.cc](https://playgrid.cc/tutorials/solar-brass/csound/)
