Distance-Based Amplitude Panning (DBAP) — User Guide

A static Distance-Based Amplitude Panner for placing one mono or stereo source at a fixed point in a 2D speaker map and rendering a 2–8 channel result from inverse-distance gains.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.3.1 (2025) License: MIT License Repo: Praat AudioTools
Contents:

What this does

DBAP Static Panner places a source at one fixed position in a two-dimensional loudspeaker map. It converts the selected source to a mono working signal, calculates one DBAP gain for every speaker from the source-to-speaker distances, duplicates the mono source once per speaker, applies the static gain to each copy, and combines the copies into the final multichannel Sound.

Selected mono/stereo Sound
→ convert working copy to mono
→ choose preset source + speaker coordinates
→ calculate source-to-speaker distances
→ apply minimum-distance protection
→ compute inverse-distance gains
→ optional unit-power normalisation
→ duplicate mono source for each speaker
→ apply one static gain per channel
→ combine channels
→ scale final peak to 0.95
→ optional visualisation + playback
Static, not moving: this script computes one gain value per speaker for the entire file. For time-varying trajectories, use DBAP with Movement Control instead.
Input channel handling: mono input is copied to a working Sound; any input with more than one channel is converted to mono before spatialisation. The original source object remains separate from the generated multichannel result.

DBAP theory

Distance and gain

dᵢ = sqrt((x - xᵢ)² + (y - yᵢ)²)
dᵢ ← max(dᵢ, d_min)
gᵢ = 1 / dᵢᵃ

(x,y) is the fixed source position, (xᵢ,yᵢ) is speaker i, a is Distance_exponent, and d_min is Minimum_distance.

Minimum-distance protection: if the source lies exactly on, or extremely close to, a speaker coordinate, the distance is replaced by Minimum_distance before the inverse-distance law is evaluated. This prevents division by zero and limits the maximum raw gain.

Optional power normalisation

When Normalize_gains is enabled, the raw gain vector is divided by its Euclidean norm:

norm = sqrt(Σ gᵢ²)
gᵢ,norm = gᵢ / norm
Σ gᵢ,norm² = 1
Important distinction: normalisation controls the relative DBAP gain vector before rendering. Independently of this setting, the completed multichannel output is always peak-scaled to 0.95 by the current script.

12 presets

Each preset defines the source position and the geometry of the speaker array. The output channel count follows the selected preset.

PresetChannelsSource positionSpeaker layout
1. Stereo Center2(0.0, 0.0)Speakers at (-1,0) and (1,0)
2. Stereo Left2(-0.8, 0.0)Speakers at (-1,0) and (1,0)
3. Stereo Right2(0.8, 0.0)Speakers at (-1,0) and (1,0)
4. Triangle Center3(0.0, 0.0)Three fixed triangular positions
5. Triangle Front3(0.0, 0.7)Same triangular array
6. Quad Center4(0.0, 0.0)Four equally spaced points on the unit circle, rotated 45°
7. Quad Front-Left4(-0.5, 0.5)Same quad array
8. Hexagon Center6(0.0, 0.0)Six equally spaced points on the unit circle
9. Surround 5.16(0.0, 0.3)Six explicitly defined positions
10. Octagon Center8(0.0, 0.0)Eight equally spaced points on the unit circle
11. Octagon Front8(0.0, 0.7)Same octagonal array
12. Custom2–8User Source_x, Source_yRequested number of speakers, equally spaced on the unit circle
“Custom” does not mean arbitrary speaker coordinates. In the current script, Custom exposes the source coordinates and the number of speakers; the speakers themselves are automatically distributed at equal angular intervals on the unit circle.
5.1 is a geometric preset, not an LFE-aware renderer. All six channels in the preset participate in the same DBAP distance calculation. Channel 6 is placed at the map centre; the script does not low-pass it or treat it separately as an LFE channel.

Quick start

  1. In Praat, select exactly one mono or stereo Sound object.
  2. Run script…Distance-Based_Amplitude_Panning_(DBAP).praat.
  3. Choose one of the 12 Preset options.
  4. Adjust Distance_exponent and Minimum_distance if needed.
  5. Keep Normalize_gains enabled for a unit-power directional gain vector, or disable it if you want the raw inverse-distance ratios before the final peak scaling.
  6. For preset 12, set Source_x, Source_y, and Number_of_speakers.
  7. Choose whether to draw the visualisation and play the result, then click OK.

Parameters

Name (GUI)TypeDefaultDescription
Presetoption menuStereo CenterSelects one of 11 fixed configurations or the Custom configuration.
Distance_exponentreal1.0Exponent a in the raw gain law 1/dᵃ.
Minimum_distancereal0.01Distance floor used before the inverse-distance calculation.
Normalize_gainsboolean1Normalises the gain vector so the sum of squared gains is 1.
Source_xreal0.0Custom source x-coordinate. Used only by preset 12.
Source_yreal0.0Custom source y-coordinate. Used only by preset 12.
Number_of_speakersnatural2Output/speaker count for preset 12. The script supports up to 8 channels.
Draw_visualizationboolean1Draws the spatial/gain diagnostic display.
Play_resultboolean1Plays the completed result after processing.

Output

The output object is named:

[SourceName]_DBAP_[PresetName]_[N]ch
Direct playback of a multichannel Sound depends on the available audio device and Praat playback routing. The script itself simply invokes Play when Play_result is enabled.

Visualisation

The current visualisation documents the same fixed DBAP geometry and gains used to create the output.

Speaker layout

Unit-circle reference, listener at the centre, source position, speaker coordinates, source-to-speaker lines, channel numbers, and gain labels. Speaker-dot size and connection-line thickness increase with gain.

DBAP gain bars

One bar per channel, with numerical gain labels and a unity reference line when the displayed range includes 1.0.

Mono downmix

A waveform view made by downmixing the finished multichannel result for compact visual reference.

Summary

Preset, speaker count, source coordinates, distance exponent, and the complete gain list.