# Pewter Loom — 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 1.961568 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.

`LeakDC` uses coefficient 0.995. It replaces the longer-window Csound DC blocker, with a different low-frequency response and latency.

`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 first oscillator and touch contour

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. Use saw at -6 dB with pulse width 50% when applicable. The contour has 0.005 s attack, 0.799 s exponential decay to 0.65 sustain and 0.114 s release. Multiply by velocity^2.5; this explicit power curve interprets the source velocity response. Keep the signal centered before adding effects.

| SuperCollider control | Value |
| --- | --- |
| Source | Saw, -6.0 dB; width not used |
| Amplitude A/D/S/R | 0.005 / 0.799 / 0.65 / 0.114 |
| Amplifier / instrument | -6.0 dB / -6.0 dB |
| Velocity power | 2.5 |

### Stage 2 — Add the second oscillator and resonant contour

Set `~soundStage = 2` in the full script. Add rect at -12 dB, tuned by 0 octaves. Use a Low-pass 24dB/oct interpretation with 455 Hz base cutoff, 3.2 octave envelope depth and 0.5 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 1.7 Hz LFO, where enabled, restarts per note rather than running freely.

| SuperCollider control | Value |
| --- | --- |
| Second source | Rect; -12 dB; width 25 % |
| Filter base / source resonance | 455 Hz / 0.52 |
| Filter A/D/S/R | 0.005 / 0.21 / 0.08 / 0.13 |
| Envelope / key / LFO depth | 3.2 / 0.5 / 0.12 octaves |
| LFO rate | 1.7 Hz |
| Filter input shape | tanh(input × 1.4) / 1.4 |

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 — Round the signal with saturation

Set `~soundStage = 3` in the full script. Use +3 dB drive with 70% shaped signal and -3 dB output trim. The smooth curve is `tanh(input × 3 × drive.dbamp) / 3`; the other portion stays clean. Louder peaks enter its curved region more strongly, adding harmonics and rounding the envelope. This interprets the source saturation curve rather than implementing its proprietary transfer function.

| SuperCollider control | Value |
| --- | --- |
| Drive / output | 3 / -3 dB |
| Shaped mix | 70% |
| Input DC removal | LeakDC, coefficient 0.995 |

### Stage 4 — Set the final width and gain

Set `~soundStage = 4` in the full script. Use 3.05 dB gain after the effects. Average the channels for identical mono outputs. Apply `LeakDC` DC removal with coefficient 0.995. The fixed `~soundOutputScale` gain follows the complete effect chain at every stage. The effects Synth reads the stereo bus after the note group, and continues through note releases.

| SuperCollider control | Value |
| --- | --- |
| Final gain | 3.05 dB |
| Width | Mono |
| Bass side cutoff | Off |
| DC removal | LeakDC, coefficient 0.995 |

## Connected instrument

The [full SuperCollider script](/tutorials/pewter-loom/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/pewter-loom/supercollider/settings/)
