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. TheJucePlugin 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:AudioBuffer<float>::getWritePointer() layout, so no format conversion is needed at the boundary.
Out-of-Process Hosting (Future)
ThePlugin trait does not assume shared memory. The FFI bridge can be extended to host plugins in a separate process (like Ableton/Bitwig do) by:
- Replacing
ffi_plugin_processwith IPC (shared memory ring buffer or pipe) - Running the JUCE host in a child process
- Crashing plugin = child process dies, not the DAW
JucePlugin wrapper’s interface stays the same — only the transport layer changes.
Status
- Rust side: Complete (16
extern "C"declarations,JucePluginwrapper, 6 unit tests) - C++ side: Stubs only (needs a thin JUCE wrapper implementing the 16 functions)