Skip to content
github-actions[bot] edited this page Nov 19, 2026 · 2 revisions

Corrosion Internals

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.

How to read this wiki

  • 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.md in 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.

Page map

Start

  • 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

  • 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.

Engine

Post chain

State

  • 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.

Front ends

  • 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.

Quality

Process

Keeping it true

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.

Clone this wiki locally