Repository navigation
Home
How Corrosion works inside, for developers. Corrosion is a physical-modelling instrument plugin (VST3 and CLAP) written in Rust on NIH-plug: a MIDI note excites a bank of resonant modes through one of 16 exciter models, and the sound passes through a post chain of filter, drive, body, spread, Space, a diode stage and a limiter. The same engine and editor also run in the browser as the web app.
- New to the code? Start with Repository layout, then Signal chain: together they show where everything lives and how a note becomes sound. Every other page goes deeper into one stage.
- Looking for a file? Every page ends with a Source files list, so searching the wiki for a path finds the pages that explain it.
- Unfamiliar term? See the Glossary.
-
Want the history behind a decision?
docs/ARCHITECTURE.mdin the repository is the as-built record, with measurements and the changes that shaped the code;openspec/changes/archive/holds each change's proposal, design and numbers. This wiki explains how things work today. - Playing the instrument rather than changing it? The Corrosion Wiki is the user guide.
- Repository layout: the two Cargo workspaces, features, targets, and what every directory holds.
- Signal chain: a note's path from MIDI to the limiter, and the per-sample voice loop.
-
Plugin lifecycle: NIH-plug wiring: construction,
initialize,process, MIDI and CCs, state migrations. - Parameters: how parameters are declared, named, displayed and smoothed, and which act live.
- Voices and polyphony: the 16-voice pool: note-on, release, tails, stealing, sustain and panic.
- Note expression: voice IDs, PolyTuning, pressure, choke.
-
Kit mode: per-key pads and the lock-free
KitTable.
- Modal resonator: the mode bank, its per-sample loop and how it is built and retuned.
- Objects: the nine objects and how each computes its modes.
- Exciters: the machinery all 16 exciters share: dispatch, drive levels, the governor.
- Hit exciters: the seven struck models.
- Friction exciters: the five friction models and the release snap.
- Specialty exciters: Pneumatic Jet, Electromagnetic Hum, Tension Snap, Particle Rain.
- Interaction bus and contact: the two-way exciter–object loop and implicit contact.
- Envelopes and modulation: AR, ADSR, MSEG, gesture modifiers, position envelope and wander.
- Material transformations: Rust, Thickness, Heat, Sludge and Damage.
- DSP utilities: the DC blocker, noise and the smaller helpers.
- Sample-rate rule: why constants are written at 48 kHz and how they are converted.
- Post chain: every stage after the voice mix, quality modes and latency.
- Filter and drive: the ladder filter, the master drive and the Lorenz drive.
- Body, spread and Space: the FEM body, the stereo spread and the three Space modes.
- Output protection: half-band oversampling, the diode stage and the limiters.
- Presets and migrations: the preset format, both migration paths, the browser, import and export.
- Factory bank: the 214 factory presets built in code, the seeder and its levelling.
- Randomizer: the four randomizer modes and their safety rules.
- Editor: the egui editor: layout, controls, help, fonts and the keyboard.
- Web app: the browser build: two wasm modules, the AudioWorklet and the bridge.
- Site and user Wiki tooling: the site, the user Wiki's build, generated data, clips and screenshots.
- Real-time safety: the audio-thread contract and how the tests enforce it.
- Testing: the test lanes, integration tests, fixtures and offline renders.
- Benchmarks and performance: benchmarks, how to measure honestly, and the CPU rules.
- Building and bundling: targets, bundles, validators, vendored crates and the notices.
- CI and releases: every CI job, the nightly release and the wiki publish.
- Contributing and keeping this wiki current: branches, the OpenSpec workflow and the rule that keeps this wiki true.
- Glossary: the terms these pages use.
These pages live in docs/internals/ in the repository and are published here from main; edits made on GitHub are overwritten. Every change to the code updates the pages that describe it, in the same change, and a test checks that every source file is named by a page and that every link resolves. See Contributing and keeping this wiki current.
Corrosion Internals is generated from docs/internals/ in the repository. Edits made here are overwritten on the next publish: change the pages there, in a pull request.
Start
Plugin
Engine
- Modal resonator
- Objects
- Exciters
- Hit exciters
- Friction exciters
- Specialty exciters
- Interaction bus and contact
- Envelopes and modulation
- Material transformations
- DSP utilities
- Sample-rate rule
Post chain
State
Front ends
Quality
Process