Skip to main content

songbird-host-ffi

FFI bridge for hosting C++ (JUCE) VST3/AU plugins from the Rust audio engine. Rust owns the audio thread. Third-party plugins are loaded and processed via JUCE through a thin C ABI layer. The JucePlugin wrapper implements the Rust Plugin trait, so external plugins are interchangeable with stock Rust plugins in the audio graph.

Architecture

FFI Declarations (16 functions)

JucePlugin Wrapper

Buffer Layout

Both sides use non-interleaved (planar) float buffers:
This matches JUCE’s AudioBuffer<float>::getWritePointer() layout, so no format conversion is needed at the boundary.

Out-of-Process Hosting (Future)

The Plugin trait does not assume shared memory. The FFI bridge can be extended to host plugins in a separate process (like Ableton/Bitwig do) by:
  1. Replacing ffi_plugin_process with IPC (shared memory ring buffer or pipe)
  2. Running the JUCE host in a child process
  3. Crashing plugin = child process dies, not the DAW
The JucePlugin wrapper’s interface stays the same — only the transport layer changes.

Status

  • Rust side: Complete (16 extern "C" declarations, JucePlugin wrapper, 6 unit tests)
  • C++ side: Stubs only (needs a thin JUCE wrapper implementing the 16 functions)

Testing