Examples

Example plugins covering effects, instruments, MIDI processors, and GUI framework integrations. Each one lives under examples/ in the truce repo and is small enough to read top-to-bottom in one sitting.

#Plugins

Plugin Type GUI Screenshot
gain Effect Built-in gain plugin
eq Effect Built-in eq plugin
synth Instrument Built-in synth plugin
transpose MIDI Built-in transpose plugin
arpeggio MIDI Built-in arpeggio plugin
tremolo Effect egui tremolo plugin
state Effect egui state plugin
fundsp-reverb-simple Effect Built-in fundsp-reverb-simple plugin
fundsp-reverb-worker Effect Built-in fundsp-reverb-worker plugin
gain-egui Effect egui gain-egui plugin
gain-iced Effect Iced gain-iced plugin
gain-slint Effect Slint gain-slint plugin
block-gain Effect Built-in block-gain plugin
block-drywet Effect Built-in block-drywet plugin
block-gate Effect Built-in block-gate plugin
block-saturate Effect Built-in block-saturate plugin
block-widen Effect Built-in block-widen plugin
block-surround-meter Effect Built-in block-surround-meter plugin

The four gain variants (gain, gain-egui, gain-iced, gain-slint) implement the same plugin with different GUI frameworks. Compare them to see how each framework handles the same layout.

The six block-* examples each isolate one truce_simd::ops::* or truce_simd::math::* shape (mix_block, mac_block, abs_max_block + zero_block, tanh_block, db_to_linear_block, linear_to_db_block). See the SIMD section of the processing guide for the design.

The two fundsp-reverb-* crates share a topology and signal flow but rebuild the graph differently; the fundsp integration guide walks through both.

#Out-of-tree

Larger examples live in their own repos — useful when you want to see what truce looks like at the scale of a real plugin rather than a 100-line teaching example.

Plugin What it shows
truce-analyzer Real-time spectrum analyzer with diff overlay; non-trivial GUI built on truce.

#Building

cargo build --workspace                       # build all
cargo test --workspace                        # run all tests
cargo truce build                             # build every format into target/bundles/
cargo truce install -p truce-example-gain     # install one plugin
cargo truce run -p truce-example-synth        # run a plugin standalone
cargo truce validate -p truce-example-gain    # auval + pluginval + clap-validator

#Project structure

Each example follows the same layout:

examples/<name>/
├── Cargo.toml
└── src/
    └── lib.rs

GUI framework examples may have additional files:

examples/gain-slint/
├── build.rs              # slint-build compilation
└── ui/
    └── main.slint        # declarative UI markup