A modern Rust library for hosting audio plugins
⚠️ WARNING: WORK IN PROGRESS⚠️ This library is in early development and NOT YET FUNCTIONAL. The API is unstable and will change. Do not use in production. Published to reserve the crate name and test the build process.
Rack is a cross-platform library for discovering, loading, and processing audio through VST3, AudioUnit, CLAP, and other plugin formats in Rust applications.
- 🎵 AudioUnit support (macOS) - built-in
- 🔌 VST3 support - coming soon
- 🎛️ CLAP support - coming soon
- 🎚️ Clean, safe API - no unsafe code in your application
- 🔄 cpal integration - optional audio I/O helpers
- 🚀 Zero-cost abstractions - trait-based design
Add to your Cargo.toml:
[dependencies]
rack = "0.1"use rack::prelude::*;
fn main() -> Result<()> {
let scanner = Scanner::new();
let plugins = scanner.scan()?;
for plugin in plugins {
println!("{}", plugin);
}
Ok(())
}use rack::prelude::*;
fn main() -> Result<()> {
let scanner = Scanner::new();
let plugins = scanner.scan()?;
// Load first plugin
let mut plugin = scanner.load(&plugins[0])?;
plugin.initialize(48000.0, 512)?;
// Process audio
let input = vec![0.0; 512];
let mut output = vec![0.0; 512];
plugin.process(&input, &mut output)?;
Ok(())
}Enable the cpal feature:
[dependencies]
rack = { version = "0.1", features = ["cpal"] }
cpal = "0.15"See examples/simple_host.rs for a complete example.
| Platform | AudioUnit | VST3 | CLAP | LV2 |
|---|---|---|---|---|
| macOS | ✅ | 🚧 | 🚧 | ❌ |
| Windows | ❌ | 🚧 | 🚧 | ❌ |
| Linux | ❌ | 🚧 | 🚧 | 🚧 |
- ✅ Supported
- 🚧 Planned
- ❌ Not applicable
Run the examples:
# List all available plugins
cargo run --example list_plugins
# Simple host with audio playback (requires cpal feature)
cargo run --example simple_host --features cpalRack uses a trait-based design for maximum flexibility:
pub trait PluginScanner {
type Plugin: PluginInstance;
fn scan(&self) -> Result<Vec<PluginInfo>>;
fn load(&self, info: &PluginInfo) -> Result<Self::Plugin>;
}
pub trait PluginInstance: Send {
fn initialize(&mut self, sample_rate: f64, max_block_size: usize) -> Result<()>;
fn process(&mut self, input: &[f32], output: &mut [f32]) -> Result<()>;
fn get_parameter(&self, index: usize) -> Result<f32>;
fn set_parameter(&mut self, index: usize, value: f32) -> Result<()>;
// ... more methods
}This allows different plugin formats to implement the same interface, making your code portable across formats.
- AudioUnit scanning (macOS)
- AudioUnit loading and instantiation
- AudioUnit audio processing
- AudioUnit parameter handling
- VST3 support (cross-platform)
- CLAP support (cross-platform)
- LV2 support (Linux)
- GUI hosting
- Preset management
- MIDI support
Contributions are welcome! This is an early-stage project and there's lots to do.
Areas where help is needed:
- AudioUnit implementation (FFI work)
- VST3 backend
- CLAP backend
- Documentation
- Examples
- Testing
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
- Inspired by VCV Rack and the modular synthesis community
- Built on top of coreaudio-rs
- Thanks to the Rust audio community at rust.audio
The name is inspired by modular synthesizer racks and VCV Rack - the idea of a framework where you can plug in different modules (plugins) and wire them together. Plus, it was available on crates.io! 🎉