bbx_audio

A Rust workspace for audio DSP with C FFI bindings for JUCE plugin integration.

Note: These crates are still in early development. Expect breaking changes in some releases.

What is bbx_audio?

bbx_audio is a collection of Rust crates designed for real-time audio digital signal processing (DSP). It provides a graph-based architecture for building audio processing chains, with first-class support for integrating Rust DSP code into C++ audio applications like JUCE plugins.

Crates

CrateDescription
bbx_coreError types and foundational utilities
bbx_dspDSP graph system, blocks, and PluginDsp trait
bbx_pluginC FFI bindings for JUCE integration
bbx_fileAudio file I/O (WAV)
bbx_midiMIDI message parsing and streaming
bbx_drawAudio visualization primitives for nannou
bbx_sandboxExamples and testing playground

Architecture Overview

bbx_core (foundational utilities)
    └── bbx_dsp (DSP graph system)
            ├── bbx_file (audio file I/O via hound/wavers)
            └── bbx_plugin (FFI bindings)
bbx_midi (MIDI streaming via midir, independent)

The core DSP system is built around a Graph of connected Blocks:

  • Block trait: Defines the DSP processing interface with process(), input/output counts, and modulation outputs
  • BlockType enum: Wraps all concrete block implementations (oscillators, effects, I/O, modulators)
  • Graph: Manages block connections, topological sorting for execution order, and buffer allocation
  • GraphBuilder: Fluent API for constructing DSP graphs

Who is this documentation for?

Audio Programmers

If you're exploring Rust for audio software and want to understand real-time DSP patterns:

  1. Quick Start - Build your first DSP graph
  2. Graph Architecture - Core design patterns
  3. Real-Time Safety - Allocation-free, lock-free processing

Plugin Developers

If you want to use Rust for your audio plugin DSP while keeping your UI and plugin framework in C++/JUCE, start with:

  1. Quick Start - Get a simple graph running
  2. JUCE Plugin Integration - Full integration guide
  3. Parameter System - Managing plugin parameters

Game Audio Developers

If you're building audio systems for games and want real-time safe DSP in Rust:

  1. Quick Start - Build your first DSP graph
  2. Real-Time Safety - Allocation-free, lock-free processing
  3. Graph Architecture - Efficient audio routing

Experimental Musicians

If you're building instruments, exploring synthesis, or experimenting with sound design:

  1. Terminal Synthesizer - Build a MIDI-controlled synth from scratch
  2. Parameter Modulation - LFOs, envelopes, and modulation routing
  3. MIDI Integration - Connect keyboards and controllers

Generative Artists

If you're creating sound installations, audio visualizations, or experimenting with procedural audio:

  1. Quick Start - Build your first DSP graph
  2. Real-Time Visualization - Visualize audio with nannou
  3. Sketch Discovery - Manage and organize visual sketches

Library Contributors

If you want to contribute to bbx_audio or understand its internals:

  1. Development Setup - Set up your environment
  2. DSP Graph Architecture - Understand the core design
  3. Adding New Blocks - Extend the block library

Quick Example

#![allow(unused)]
fn main() {
use bbx_dsp::{GraphBuilder, blocks::*};

// Build a simple oscillator -> gain -> output chain
let graph = GraphBuilder::new()
    .add_block(OscillatorBlock::new(440.0, Waveform::Sine))
    .add_block(GainBlock::new(-6.0, None))
    .add_block(OutputBlock::new(2))
    .connect(0, 0, 1, 0)?  // Oscillator -> Gain
    .connect(1, 0, 2, 0)?  // Gain -> Output
    .build()?;
}

License

bbx_audio is licensed under the MIT License. See LICENSE for details.