Author: Jacob Sundstrom
Distance-based ampltide panning (DBAP). Based on the paper by Trond Lossius, Pascal Baltazar, and Théo de la Hogue with some significant changes described below.
There are bound to be some bugs lying dormant and the algorithm itself could use some serious tweaking as it requires some serious optimization for a given set up. As written, though, it is a faithful implementation of the original algorithm with the exceptions outlined below.
This version differs from the version of DBAP put forward by Lossius et al. primarily in the way the gains are calculated for sources outside the "convex hull". In Lossius 2.6, the issue of sources outside the field of speakers is presented. As a source moves further and further away, the difference between the gains for each speaker is reduced, thus causing the source to lose its perceived spatial properties. To counteract this, Lossius suggests projecting the source that is outside the field onto the convex hull of the loudspeaker field and to use this projected point in subsequent calculations of gain. Doing so would likewise give the distance from the source to the speaker field and thus allow the amplitudes to be scaled as a function of the distance from the hull. The projection provides sufficient biasing of the gains to maintain the spatial illusion.
In cases where the projection is orthogonal to the perimeter of the convex hull, this works adequately. However, when a projection is not orthogonal, as in the case of the area beyond the vertices of the convex hull where the projection is one of the vertices, this method fails to provide a unique solution. In particular, all spatial differentiation is lost when different sources share the same projection onto the same vertex. This is the case for all points in the shaded areas below.
Take the example above of a set of speakers where the convex hull is a square with vertices
Consider now two sources,
This finding further explains the findings of Eckel et al. in their paper "A framework for the choreography of sound" when they write of DBAP: "[W]e discovered that especially the trajectory of moving sounds (as in the example described in section 4.3.2) appears more clearly shaped or ”sharper” [in ADBAP], compared to the unmodified DBAP algorithm." If the implementation was as Lossius suggests, it is no surprise that there was poor spatial differentiation for sources outside the hull.
To compensate for this, several changes are made. In the first place, both the distances between the real source position and speakers (
where
where
Another term is then introduced to express the ratio between the real distance and the projected distance,
From there,
This approach has so far proved sufficient but further testing on more complex speaker arrays is needed to verify its robustness.
- CMake >= 3.5
- SuperCollider source code
- Boost Geometry >= 1.65.1.0
Clone the project:
git clone https://woolgathering/dbap
cd dbap
mkdir build
cd build
Then, use CMake to configure and build it:
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cmake --build . --config Release --target install
You may want to manually specify the install location in the first step to point it at your
SuperCollider extensions directory: add the option -DCMAKE_INSTALL_PREFIX=/path/to/extensions
.
It's expected that the SuperCollider repo is cloned at ../supercollider
relative to this repo. If
it's not: add the option -DSC_PATH=/path/to/sc/source
.
Use the command in regenerate
to update CMakeLists.txt when you add or remove files from the
project. You don't need to run it if you only change the contents of existing files. You may need to
edit the command if you add, remove, or rename plugins, to match the new plugin paths. Run the
script with --help
to see all available options.