Expand description
The Manguebyte Audio Framework: real-time-safe audio for Rust.
This crate gathers the whole framework under one name. Each area lives in its own crate, which you can also depend on directly:
| Module | Crate | What it holds |
|---|---|---|
| (root) | manguebyte-core | AudioBuffer, Sample, Smoothed, atomics, spsc queue, NoDenormals, source (pulled audio sources) |
dsp | manguebyte-dsp | processor chains, sample-accurate events, MIDI, MPE and MIDI 2.0 read into per-note events, audio sources built from sources, polyphonic synth, instruments, filters, effects, dynamics with sidechain keying, convolution, wavetables, FFT, response curves for drawing |
params | manguebyte-params | thread-safe parameters, ranges, smoothing, saved state |
graph | manguebyte-graph | a processing graph that can be rewired while it plays |
plugin | manguebyte-plugin | the format-independent plugin API and a test harness |
midi | manguebyte-midi | MIDI 1.0 and 2.0 messages, stream parsing, MIDI files, MPE, MIDI-CI, sample-accurate event buffers |
formats | manguebyte-formats | audio file reading and writing, metadata, waveform thumbnails; AAC, ALAC and WMA through the system’s codecs (feature platform-codecs); streamed playback with a transport |
clap | manguebyte-clap | builds CLAP plugins (feature clap) |
vst3 | manguebyte-vst3 | builds VST 3 plugins (feature vst3) |
lv2 | manguebyte-lv2 | builds LV2 plugins and their Turtle files (feature lv2) |
au | manguebyte-au | builds Audio Units for macOS and their Info.plist (feature au) |
gui | manguebyte-gui | opens a plugin’s editor in the host’s window (feature gui) |
ui | manguebyte-ui | the widgets editors are made of (feature gui) |
sampler | manguebyte-sampler | an SFZ sampler, from files or from memory (feature sampler) |
host | manguebyte-host | loads CLAP, VST 3, LV2 and Audio Unit plugins and runs them as processors, and scans for them out of process (feature host) |
analysis | manguebyte-analysis | loudness, true peak, level meters, spectrum and pitch (feature analysis, on by default) |
osc | manguebyte-osc | Open Sound Control, with time tags landing on their frame (feature osc, on by default) |
standalone | manguebyte-standalone | runs a plugin on the sound card and MIDI ports (feature standalone) |
devices | manguebyte-devices | audio hosts, device input, output and duplex streams, a device manager with saved setups and hot-plug, MIDI ports (feature devices, on by default) |
§Example
Render a filtered sawtooth and save it as a WAV file:
use manguebyte::prelude::*;
let spec = ProcessSpec { sample_rate: 48_000.0, max_block_size: 480, num_channels: 2 };
let mut voice = (
Oscillator::new(Waveform::Saw, note_to_hz(45.0)),
Filter::new(FilterShape::Lowpass, 1_200.0, 1.5),
Gain::from_db(-12.0),
);
voice.prepare(&spec);
let mut block = AudioBuffer::<f32>::new(2, 480);
voice.process(&mut block);
let mut file = Vec::new();
wav::write(&mut file, &block, 48_000, WavFormat::Int16)?;Re-exports§
pub use manguebyte_analysis as analysis;pub use manguebyte_au as au;pub use manguebyte_clap as clap;pub use manguebyte_devices as devices;pub use manguebyte_dsp as dsp;pub use manguebyte_formats as formats;pub use manguebyte_graph as graph;pub use manguebyte_gui as gui;pub use manguebyte_host as host;pub use manguebyte_lv2 as lv2;pub use manguebyte_midi as midi;pub use manguebyte_osc as osc;pub use manguebyte_params as params;pub use manguebyte_plugin as plugin;pub use manguebyte_sampler as sampler;pub use manguebyte_standalone as standalone;pub use manguebyte_ui as ui;pub use manguebyte_vst3 as vst3;
Modules§
- decibels
- Conversions between decibels and linear gain.
- prelude
- The names most programs need, in one import.
- source
- Sources of audio that are pulled, a block at a time.
- spsc
- A wait-free single-producer single-consumer queue.
Structs§
- Atomic
F32 - An
f32that can be read and written from several threads without locks. - Atomic
F64 - An
f64that can be read and written from several threads without locks. - Audio
Buffer - A planar, multi-channel block of audio samples.
- Drained
Log - What one
drainfound. - LogQueue
- Messages from any thread, the audio thread included, to a thread that may block. See the module documentation.
- LogRecord
- One message taken from a
LogQueue. - NoDenormals
- While one of these is alive, the processor treats subnormal numbers as zero on the current thread.
- ParamId
- A compact, stable number standing for a parameter.
- Smoothed
- A value that glides linearly towards its target, avoiding clicks when a parameter changes.
Enums§
- LogLevel
- How much a message matters, from most to least.
Traits§
- Sample
- A floating-point audio sample.