vbap
Vector Base Amplitude Panning (VBAP) positions virtual sound sources in a speaker array by computing gain coefficients for the 2-3 speakers nearest to the source direction. Originally described by Ville Pulkki in 1997.
Inspired by Ardour's implementation.
Usage
use VBAPanner;
let panner = builder
.stereo
.build
.unwrap;
let gains = panner.compute_gains; // 15° left
Presets
stereo()- L/R at ±30°surround_5_1()- standard 5.1surround_7_1()- standard 7.1atmos_7_1_4()- 7.1.4 with height speakers
Custom layouts
let panner = builder
.add_speaker // azimuth, elevation
.add_speaker
.add_speaker
.add_speaker
.build
.unwrap;
Angles
- Azimuth: 0° front, 90° left, -90° right, 180° rear
- Elevation: 0° horizontal, 90° above
This follows the counter-clockwise positive convention defined in:
- ITU-R BS.2076 (Audio Definition Model) — 0° front, positive azimuth to the left
- EBU ADM Guidelines — Coordinate System
And consistent with the original VBAP paper:
- Pulkki, V. (1997). "Virtual Sound Source Positioning Using Vector Base Amplitude Panning." J. Audio Eng. Soc., 45(6), 456–466.
no_std support
This crate works without the standard library. Disable the default std feature in your Cargo.toml:
[]
= { = "0.1.1", = false }
An allocator is still required (alloc). The only difference is that VBAPError won't implement std::error::Error.
License
MIT