# Random Filter Keys — complete SuperCollider settings

## Signal flow and implementation

`~soundStage` is compiled into the SynthDefs. Re-evaluate the complete block after changing it; source and effects are then replaced together. The fixed output multiplier `~soundOutputScale` is 6.744405 and applies after the whole chain at every stage. It is separate from any final gain step.

`EnvGen` supplies the explicit linear or exponential contours. Exponential floors stay positive. Closing the gate begins each release; a separate silent lifetime envelope frees the note after the longest source release. Shared effects continue independently.

`MoogFF` replaces the ladder filter. Its gain argument is four times the source 0–1 resonance amount, limited to 3.95; it is a different circuit. Cutoffs are limited to 20–18000 Hz.

`LocalIn`/`LocalOut` carry all feedback paths in a single multichannel loop. Recirculation adds one server processing block to each delay; changing block size therefore changes short comb/flanger tuning. `DelayC` uses seconds, converted from the millisecond tap values in the design.

`FreeVerb2` replaces the diffuse room with its own room and damping controls, both dimensionless. The per-stage values below are specific to this algorithm and do not specify a measured decay time or damping frequency.

`Saw` and `Pulse` use SuperCollider oscillator implementations and startup phases; they replace the source engines and do not scan proprietary wavetables.

## Synthesis and effect controls

### Stage 1 — Build the two-octave resonant body

Select `~soundStage = 1` and evaluate the full script at the end of this guide. Wait for the instrument-ready message before playing.

Set `~soundStage = 1` in the full script. Blend two saws at −6 dB each: one at the note plus two cents, the other an octave down. Add an octave-down sine at −15 dB. A 300 Hz tracked ladder lowpass uses resonance 0.67 and +3 dB smooth drive. The amplitude has 57 ms attack, decay and release with −2.3 dB sustain; instrument gain is −19 dB with 50% touch response.

| SuperCollider control | Value |
| --- | --- |
| Saw / sub | −6/−6 dB saws; octave-down sine −15 dB |
| Filter | 300 Hz, full tracking, 0.67 resonance, +3 dB drive |
| Amplitude | 57 ms / 57 ms / −2.3 dB / 57 ms |
| Instrument | −19 dB |

For `MoogFF`, multiply the stated source resonance amount by four to obtain its 0–4 gain argument (limited to 3.95). The complete script gives this gain expression beside each cutoff.

### Stage 2 — Jump between random filter states

Set `~soundStage = 2` in the full script. A sample-and-hold random value changes at 2.67 Hz. Use it for ±1 octave of cutoff and ±3 dB of input drive. Positive values brighten and push the resonant filter, while negative values darken it. Each note has its own random generator; the exact source noise waveform and modulation scale differ.

| SuperCollider control | Value |
| --- | --- |
| Random rate | 2.67 Hz |
| Cutoff / drive movement | ±1 octave / ±3 dB |

For `MoogFF`, multiply the stated source resonance amount by four to obtain its 0–4 gain argument (limited to 3.95). The complete script gives this gain expression beside each cutoff.

### Stage 3 — Add filtered stereo echoes

Set `~soundStage = 3` in the full script. Use 750 ms left and 775 ms right, 25% feedback and 30% wet. Feed each channel back into itself, keeping the unequal timing paths independent. Filter each echo around 900 Hz, with a 7-octave interval between highpass and lowpass cutoffs. Feedback values are updated once per server processing block, adding that small delay to the recirculating path. Held notes leave older colors behind the current tone.

| SuperCollider control | Value |
| --- | --- |
| Times | 750 / 775 ms |
| Feedback / wet | 25% / 30% |
| Routing | Independent channels |
| Filter center / width | 900 Hz / 7 octaves |
| Time LFO | 0 Hz, ±0% |

### Stage 4 — Surround the tone with a damped room

Set `~soundStage = 4` and evaluate the full block. Feed the preceding signal into `FreeVerb2`, using its fully wet output and the dry/wet routing shown in the script. The room continues after individual note envelopes release. Predelay separates the initial articulation from the diffuse tail; the external wet mix controls how far that tail moves forward.

The SuperCollider room value is 0.96 and damping is 0.8875. These dimensionless settings are choices for this algorithm, rather than equivalent values for Ableton decay or Csound feedback and damping. More damping darkens the circulating highs. Any input filters and mid/side width changes in this stage retain their own explicit settings in the full script.

| SuperCollider room control | Value |
| --- | --- |
| FreeVerb2 internal mix | 1, wet output only |
| Room | 0.96 |
| Damping | 0.8875 |
| Predelay | 5 ms |
| External room wet | 15% |

| SuperCollider control | Value |
| --- | --- |
| Room side multiplier | 1 |
| Room input cuts | Off |

## Connected instrument

The [full SuperCollider script](/tutorials/random-filter-keys/supercollider/#full-supercollider-script) contains the complete voice, shared effects, bus ordering and note helper. No external sample or third-party unit is required.

[Read on playgrid.cc](https://playgrid.cc/tutorials/random-filter-keys/supercollider/settings/)
