Skip to content
Projets

À propos

A safe Rust library for hosting VST3 plugins — discover, load, play audio, automate parameters, send/receive MIDI, and isolate plugin crashes, with zero unsafe in the public API.

Design et médias

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
+4
in 15 days
+5
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

vst3-host

Crates.io Docs.rs CI License

A safe Rust library for hosting VST3 plugins: discover them, load them, play audio through them, control parameters, send MIDI, and isolate crashes — without writing any unsafe code yourself.

use vst3_host::{simple, midi::MidiChannel};

fn main() -> vst3_host::Result<()> {
    // Load a synth and start it playing through the default audio device.
    let plugin = simple::load_plugin("/Library/Audio/Plug-Ins/VST3/Dexed.vst3")?;
    let audio = simple::play(plugin)?;

    // Play middle C (MIDI note 60) for one second.
    audio.lock().send_midi_note(60, 100, MidiChannel::Ch1)?;
    std::thread::sleep(std::time::Duration::from_secs(1));
    Ok(())
}

What it does

  • Discovery — find installed VST3 plugins and read their metadata.
  • Audio — a bundled CPAL backend drives a plugin to your speakers; or plug in your own backend. Host effects on live audio input, or render offline to a WAV file.
  • Parameters — list, read, set, and format parameters as the plugin itself displays them, with sample-accurate automation (set_parameter_at).
  • MIDI — notes, control changes, pitch bend, and aftertouch, with sample-accurate scheduling; per-note expression / MPE (note_on / send_note_expression).
  • State & presets — save/restore a plugin's own state, and read/write .vstpreset files.
  • Metering — peak/RMS levels with ready-made UI ballistics (PeakMeter, RmsWindow).
  • Crash isolation — run a plugin in a separate process so a crash can't take down your app; crashes surface as Error::PluginCrashed and Plugin::recover() reloads it.
  • Native plugin editors — open a plugin's own GUI in a standalone window, or embed it in your egui app (EmbeddedEditor, macOS).

All VST3 COM interaction is contained behind a safe API. The public surface has no unsafe.

Status

The core is working and exercised against real plugins on macOS. Known limitations — see Platform support and each guide: the default audio path is correctness-first (a lock-free play_realtime path also exists, though neither is a fully RT-audited engine yet), process isolation is opt-in, and editor embedding into egui (EmbeddedEditor) works on macOS — the Windows/Linux window code compiles but isn't yet runtime-verified.

Install

[dependencies]
vst3-host = "0.11"

No VST3 SDK or extra setup is required — the vst3 dependency ships pre-generated bindings. Building from source is just:

git clone https://github.com/HelgeSverre/rust-vst3-host.git
cd rust-vst3-host
cargo build --release

(libclang must be installed for cpal's bindgen-based audio deps on macOS/Linux.)

Documentation

Start with the documentation index. It's organized by what you're doing:

Workspace layout

  • vst3-host/ — the library.
  • vst3-inspector/ — a GUI app (egui) built entirely on the library's public API; a worked example of consuming it.

Common tasks are wrapped in a justfile: just build, just test, just play, just lint.

Tests render audio into memory or use mock backends. just selftest also renders offline; it does not open an audio device. The two hardware playback tests require both --ignored and VST3_HOST_TEST_AUDIO_OUTPUT=1. Without that explicit opt-in they return before loading a plugin or opening the default output device, including during broad --ignored runs. To deliberately run an audible hardware check:

VST3_HOST_TEST_AUDIO_OUTPUT=1 cargo test -p vst3-host --all-features --test integration_tests test_audio_processing -- --ignored --exact

Hardware checks can play notes, change the device sample rate, and click on stream startup/shutdown. Use a muted or disconnected output when running them. Arbitrary native plugins loaded by discovery tests can also have their own side effects.

License

MIT — see LICENSE.

Explorer des projets similaires

Chargement…