Manguebyte

Open-source audio framework for Rust

Tested, not promised.

Manguebyte builds audio plugins and applications in Rust: DSP and instruments, metering, MIDI, files, devices, plugin editors and hosting, and native CLAP, VST 3, LV2 and Audio Unit export from one line each. Its goal is to be for Rust what JUCE is for C++, and then to go further. Every claim on this site links to the test that proves it.

Get started Read the source

Version 0.2.0, on crates.io. The project is young and the API will change before 1.0. Plugin editors open in Win32 windows and are tested in CI; by hand, one has been opened in a host so far, Mangue Pluck’s in REAPER. See what is missing.

Manguebyte: a crab wearing headphones and playing an electric guitar

01

Four things it proves on every commit

Matching JUCE is the baseline. These are places where Manguebyte already does something JUCE 9.0.4 does not, each one backed by a test that runs in CI. The full list has seventeen, with a source for everything said about JUCE and the limit of every claim.

  1. Automation lands on the exact sample

    Every parameter change arrives with the frame it falls on and is applied on that frame: in the test harness, through CLAP, and through VST 3, where every point of every automation queue is delivered.

    In JUCE 9.0.4
    A processor reads each parameter once per block.
    Limit
    A processor chooses whether to use the timing. Reading a value once per block is still valid, and cheaper.

    Proof

  2. The same sound at any block size

    One song rendered with six block patterns, from a steady 64 frames to an irregular 1, 511, 7, 300, 64, 2, 129, must match bit for bit. The first time this test ran, it failed, and exposed a real bug.

    In JUCE 9.0.4
    Whether the sound depends on the host’s buffer size is up to each plugin.
    Limit
    It covers what follows events. A value read once per block changes at block boundaries by definition.

    Proof

  3. No heap on the audio thread, or CI fails

    The tests replace the global allocator with one that counts. If any processor, or the CLAP wrapper, allocates or frees while processing, the build is red. It has already caught a mutex that allocates on macOS.

    In JUCE 9.0.4
    Real-time safety is a rule in the documentation.
    Limit
    A test that runs, not a compile-time proof. It catches heap use on the paths the tests exercise.

    Proof

  4. CLAP and VST 3 from one line each, checked by their own validators

    export_clap! and export_vst3! turn the same plugin into both formats. CI runs the CLAP project’s validator and Steinberg’s on an instrument and an effect, and neither fails a test; all 537 of Steinberg’s pass on Windows, Linux and macOS, its double-precision tests included. Both were also tested by hand in REAPER, and export_lv2! and export_au! add LV2 and Audio Units, which pass Apple’s auval in CI.

    In JUCE 9.0.4
    CLAP export is not available natively.
    Limit
    Editors are tested in CI; by hand, only Mangue Pluck’s CLAP editor has been opened in a host. LV2 has run in no host but the framework’s own, and no DAW has loaded the Audio Units yet. No AUv3 or AAX.

    Proof

All seventeen claims, with proofs and limits

02

A whole plugin, then one line per format

This is the example effect from the repository: a sidechain ducker. It describes itself, splits each block at its events, and is exported in four formats. None of the code below was written for this page.

  1. One description

    INFO and LAYOUT are constants. The same description becomes the CLAP descriptor, the VST 3 class, whose id is the same on every platform, the LV2 plugin’s Turtle files, and the Audio Unit’s codes, which are hashed from the plugin’s id.

  2. Events on their frame

    split_at_events renders up to each event, applies it and carries on, without copying or allocating. That call is all a plugin does to get sample-accurate automation.

  3. Four formats, four lines

    The macros are the whole integration, and editor hands the wrappers the plugin’s editor. cargo mangue then builds a .clap, a .vst3 and an .lv2 bundle in each system’s layout, and on a Mac a .component.

Rust
impl Plugin for Duck {
    const INFO: PluginInfo = PluginInfo {
        id: "org.manguebyte.duck",
        name: "Mangue Duck",
        vendor: "Manguebyte",
        version: env!("CARGO_PKG_VERSION"),
        description: "A sidechain ducker, as an example of the Manguebyte framework",
        kind: PluginKind::Effect,
    };
    const LAYOUT: AudioLayout = AudioLayout {
        inputs: 2,
        outputs: 2,
        sidechain: 2,
    };
    type Params = DuckParams;
    // ... new, params and prepare are left out here
    fn process(&mut self, buffer: &mut AudioBuffer<f32>, context: &ProcessContext<'_, f32>) {
        self.cursor = 0;
        let sidechain = context.sidechain;
        split_at_events(self, buffer, context.events, Self::handle, |duck, piece| {
            duck.render(piece, sidechain)
        });
        self.publish_reduction();
    }
    // ... reset
    fn editor(&self) -> Option<Box<dyn EditorSpec>> {
        Some(Box::new(self.editor_spec()))
    }
    // ... tail_samples
}

manguebyte::clap::export_clap!(Duck);
manguebyte::vst3::export_vst3!(Duck);
manguebyte::lv2::export_lv2!(Duck);
manguebyte_au::export_au!(Duck);
Excerpt from plugins/duck/src/lib.rs at commit 46ec338. Lines beginning // ... mark what is left out.

And a test of it, with no host

Harness plays audio, a sidechain and automation into the plugin inside an ordinary unit test. This one checks that a change of depth lands on frame 1,000 of the block, and not one frame earlier.

Rust
#[test]
fn automation_lands_on_its_frame_with_audio_running_through() {
    let mut harness = Harness::<Duck>::new(RATE, 256);
    let input = steady(1.0, 24_000);
    let loud = steady(1.0, 24_000);
    // Let the follower settle, then ask for a different depth on one
    // particular frame in the middle of a block.
    harness.process_with_sidechain(&input, &loud);
    harness.automate(24_000 + 1_000, "depth", 24.0);
    let output = harness.process_with_sidechain(&input, &loud);

    let before = db_to_gain(-12.0) as f32;
    let after = db_to_gain(-24.0) as f32;
    assert!((output.channel(0)[999] - before).abs() < 1e-4);
    assert!((output.channel(0)[1_000] - after).abs() < 1e-4);
}
From plugins/duck/src/lib.rs at commit 46ec338, as it is in the file.

03

What you get today

Twenty-seven crates that work together, each usable on its own, one of them a command-line tool. All of them are on crates.io as version 0.2.0, with their documentation on docs.rs. manguebyte-core has no dependencies at all.

Every feature, by area

04

Where JUCE is ahead

JUCE has more than twenty years of production use behind it, and far more breadth. Today it has, and Manguebyte does not:

  • a complete GUI toolkit, with plugin editor windows on macOS and Linux as well as Windows (Manguebyte’s editors open on Windows only so far, and only one has been opened by hand in a DAW);
  • the AUv3 and AAX plugin formats, and Audio Units checked in real hosts (Manguebyte’s AUv2 wrapper has only its own tests and auval in CI);
  • the editors of hosted plugins on every system (Manguebyte hosts CLAP, VST 3, LV2 and Audio Unit plugins and scans for them; the editors of hosted CLAP and VST 3 plugins open in tests on Windows only, and no LV2 or AU editor is hosted);
  • SIMD wrappers and lookup tables among its DSP utilities;
  • iOS and Android (Manguebyte’s audio and device crates are built for both in CI, but not run on a device);
  • documentation, tutorials and a large community.

The roadmap says what exists and in what order the gap is being closed.

05

The Manguebyte ecosystem

Four more projects from Recife grow from the same mangue, built to run on Manguebyte.

  • This framework

    Manguebyte

    The open-source audio framework for Rust, under MIT or Apache-2.0, released on crates.io. Aratu already plays on its browser engine, and its Aratu Bridge plugin plays the same music in a DAW; Caecilia and Parabolic are built on it.

  • In development

    Aratu

    A live-coding language that reads like music: measures, beats and note values first, in Portuguese, Spanish and English. Its editor runs in the browser and plays on Manguebyte.

  • Alpha

    Caecilia

    A virtual pipe organ written in Rust on Manguebyte: a program of its own and VST3 and CLAP plugins.

  • In development

    Parabolic

    A tool for musicians to turn their own sounds into plugins and samplers without writing code.

  • In design

    MARÉ

    Multi-device Audio Realtime Exchange: an open protocol for low-latency audio and MIDI, to replace ASIO. Many programs on one device at once, many devices as one, MIDI 2.0 on the same clock.

Built on it by others

  • By cloudbeer · Apache-2.0

    muser

    A headless music-arrangement engine built for AI agents. An agent writes the project as JSON, through a command-line tool or an MCP server, and muser turns it into audio on Manguebyte, which synthesizes its more than 100 built-in instruments. Playing live and rendering to a WAV file share the same code and come out sample for sample the same.

More about Aratu

06

Crabs with brains

The name comes from Recife, the city in the north-east of Brazil where this project was born. Recife is built on mangroves, mangue in Portuguese.

In the early 1990s a group of local musicians answered the city’s troubles with a manifesto, Caranguejos com Cérebro, “Crabs with Brains”: plug the rich, muddy roots of the region’s culture into the global network of ideas. The image they chose was a satellite dish stuck in the mangrove mud.

The story of the name

Start with one dependency

Manguebyte is on crates.io, with its documentation on docs.rs:

TOML
[dependencies]
manguebyte = "0.2"
From README.md at commit 46ec338, as it is in the file.

Or install the command-line tool and let it write a plugin crate for you:

Shell
cargo install cargo-mangue
cargo mangue new my-gain
From README.md at commit 46ec338, as it is in the file.

The getting started guide The repository on GitHub