Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The example ladder

Ten small plugins in the examples/ folder. Each is a complete plugin that builds into every format, has a test that renders audio without a sound card and fails if process allocates memory, and adds one idea to the one before. Read them in order.

#ExampleTeaches
01sinethe Plugin trait, export_plugin!, a note in and a sine out, events at their sample, one parameter
02gainan effect: audio in and out, a parameter, Smoother, decibels
03paramsevery parameter kind, curves, units, groups; never rename a key, only append
04envelopeAdsr, velocity, polyphony, voice stealing
05modulationan LFO, mod wheel, pitch bend, modulating without touching the parameter
06filterthe state-variable filter, cutoff smoothing, denormals
07guidata-param bindings, a meter from process to the page, apf.poller, resizing
08presets-and-statefactory and user presets, metadata, a Controller for non-parameter state
09midi-and-learnsustain pedal, MIDI learn, remote controls, host automation
10syntha compact complete synth that uses all of the above, and a look at the full demo synth

Working with an example

cargo test -p example-01-sine                    # plays a note in memory
cargo xtask bundle example-01-sine --install     # builds it and installs it for your host

Open the example’s src/lib.rs, change something, and run its test. The “Try it” list at the end of each chapter has ideas. To hear a change in your host without restarting it, use hot reload.

Each example’s tests/process.rs shows how the plugin is tested through the same interface a host uses.