Skip to content

calanuzao/beebap

Repository files navigation

BeeBAP – 3D VBAP Panner

BeeBAP is a professional-grade spatial audio plugin implementing Vector Base Amplitude Panning (VBAP) for precise 3D sound positioning across a hexagonal speaker array. It provides real-time azimuth and elevation control with intuitive visual feedback.

BeeBAP 2D View BeeBAP 3D View


Features

  • Full VBAP Implementation: Mathematically accurate gain computation with pair and solo fallback modes
  • Hexagonal Speaker Layout: Six-channel output for 2D horizontal surround with elevation support
  • Interactive Visualization: Drag-and-drop interface for real-time speaker and source repositioning
  • Active Set Indication: Visual highlighting of active speaker pairs/triplets
  • Per-Speaker Gain Meters: Real-time VBAP gain distribution feedback
  • Input/Output Metering: L/R input and aggregated output RMS monitoring
  • Bypass and Reset Controls: Quick A/B comparison and layout restoration
  • VST3 Format: Cross-platform plugin compatible with major DAWs

Speaker Layout

BeeBAP uses a 6-speaker hexagonal configuration in the default horizontal plane. Positions are fully reconfigurable via drag-and-drop in the plugin interface.


VBAP Algorithm

BeeBAP implements the Pulkki VBAP algorithm through these stages:

  1. Speaker Triplet Selection: Identifies the enclosing triplet of speakers for the source direction
  2. Matrix Inversion: Solves for gain factors $\mathbf{g} = [g_1, g_2, g_3]$ using: $$\mathbf{g} = \mathbf{L}^{-1} \mathbf{s}$$ where $\mathbf{L}$ is the 3×3 matrix of speaker direction vectors and $\mathbf{s}$ is the source direction
  3. Gain Normalization: Applies energy-preserving normalization to preserve loudness: $$g_i' = \frac{g_i}{\sqrt{g_1^2 + g_2^2 + g_3^2}}$$
  4. Fallback Modes:
    • Pair mode when source lies on speaker pair edge (2D inversion)
    • Solo mode when source coincides with a single speaker (1D point)

Active Set Visualization:

  • Yellow triangle: Active triplet
  • Yellow line: Active pair
  • Green highlight: Solo speaker

Building from Source

Prerequisites

  • CMake 3.22 or later
  • C++17 compatible compiler (GCC 9+, Clang 10+, MSVC 2019+)
  • JUCE Framework 7.x (included as submodule)
  • libcurl development libraries
  • Linux: ALSA, Freetype, X11 libraries (libasound2-dev libfreetype6-dev libx11-dev)

Build Steps

# Clone with submodules
git clone --recurse-submodules https://github.com/calanuzao/beevap.git
cd beevap

# Configure CMake
mkdir build && cd build
cmake ..

# Build (multi-threaded)
cmake --build . -j$(nproc)

# VST3 output location
# build/BEEBAP_artefacts/Release/VST3/BeeBAP.vst3

Incremental Builds

After modifying source files:

cmake --build build -j$(nproc)

For CMakeLists changes, reconfigure first:

cd build && cmake .. && cmake --build . -j$(nproc)

Usage

Loading the Plugin

Copy BeeBAP.vst3 to your system's VST3 directory and rescan plugins in your DAW:

  • Linux: ~/.vst3/
  • macOS: ~/Library/Audio/Plug-Ins/VST3/
  • Windows: C:\Program Files\Common Files\VST3\

Interface Controls

  • Red source dot: Drag to position sound (azimuth/elevation)
  • Blue speaker markers: Drag to reconfigure layout
  • Top bar: Reset, Bypass, and Help controls
  • Side meters: Input (L/R) and output (RMS) levels with per-speaker gain indicators
  • Bottom legend: Az/El readout and color reference

Project Structure

beevap/
├── Source/
│   ├── PluginProcessor.cpp/h    # Audio processing, parameter management
│   ├── PluginEditor.cpp/h       # UI rendering, interaction handling
│   ├── VBAPEngine.cpp/h         # Core VBAP algorithm implementation
│   ├── SpeakerLayout.cpp/h      # Speaker configuration management
│   ├── VectorMath.cpp/h         # 3D vector utilities (cross/dot products)
│   └── Vector3D.h               # Lightweight 3D vector template
├── Tests/                       # Unit tests (Catch2)
├── JUCE/                        # JUCE framework (submodule)
├── Docs/                        # Flow diagrams and documentation
├── CMakeLists.txt               # Build configuration
└── README.md                    # This file

Technical Details

  • Audio I/O: Stereo input (2 ch) → Hexaphonic output (6 ch), processing: $\text{out}_i = g_i \cdot \text{mono}$
  • Parameters: Azimuth $\theta \in [-180°, +180°]$, Elevation $\phi \in [-90°, +90°]$, Bypass toggle
  • Performance: Lock-free parameter updates, real-time safe VBAP, 30 Hz UI refresh

Dependencies

  • JUCE 7.x: Cross-platform audio plugin framework
  • libcurl: Network functionality (JUCE dependency)
  • Catch2: Testing framework (fetched automatically by CMake)

License

This project is developed for academic and thesis purposes.


Acknowledgments

  • Ville Pulkki: VBAP algorithm research and publications
  • JUCE Framework: Cross-platform audio development toolkit
  • NYU Tandon: C++ for Audio Applications and Real-Time Embedded Systems

Contributing

Fork the repository and submit pull requests. For major changes, open an issue first to discuss proposed modifications.


Contact

Developed by Christopher Lanuza
Repository: https://github.com/calanuzao/beevap

About

Vector Based Amplitude Panning Plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published