Harmonic Spray / Partial Panner — User Guide

Spectral spatialisation by band: a selected Sound is reduced to mono, split into logarithmically spaced Hann-pass bands, and each band is distributed by frequency across stereo or an evenly spaced 4/6/8-channel speaker ring.

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

What this does

Partial Panner creates frequency-dependent spatial distribution. The input is first converted to a mono working source. The script then builds N logarithmically spaced spectral bands, assigns each band a frequency-dependent width, maps that width to a target azimuth, and accumulates the filtered band into the output channels.

Input semantics: The script requires exactly one Sound. If that Sound has more than one channel, Praat's Convert to mono is used first. The original stereo or multichannel image is therefore not preserved; the output spatial field is synthesized from the mono working source.

Quick start

  1. Select exactly one Sound in Praat.
  2. Run Partial_Panner.praat.
  3. Choose a preset. The form default is Standard Spread.
  4. For Custom, choose 2, 4, 6, or 8 output channels, then set band count, width, bandwidth, spread arc, frequency range, LF protection, and dry/wet mix.
  5. Run the script. The output is normalized to peak 0.99 and optionally visualized and played.
Output naming: source_spray_PresetName_Nch, for example voice_spray_Standard_2ch or field_spray_Quad360_4ch.

Spatial mapping

1. Spectral bands

Band centre i: f_i = f_min × (f_max / f_min)^((i - 0.5) / N) Effective maximum: f_max = min(Max_frequency_Hz, 0.95 × Nyquist) Bandwidth: multiplier = 2^(Bandwidth_octaves) low_i = f_i / sqrt(multiplier) high_i = f_i × sqrt(multiplier) smoothing = (high_i - low_i) / 6

The centres are logarithmically spaced. The filtered bands can overlap; this is a creative filter-bank reconstruction rather than a guaranteed unity-sum crossover.

2. Band order to effective width

Band-order position: normPos = (i - 1) / (N - 1) [0..1, or 0.5 when N=1] S-shaped mapping: s = tanh(2.5 × (2×normPos - 1)) Frequency scale: q = ln(f_i / f_min) / ln(f_max / f_min) freqScale = 0.3 + 0.7 × q^0.7 Below LF_protection_Hz: lfScale = (f_i / LF_protection_Hz)^2 freqScale *= 0.2 + 0.8 × lfScale Effective width: effectiveWidth = Pan_width × freqScale panNorm = s × effectiveWidth

The low-frequency rule is an explicit mapping choice in this tool: it keeps lower bands closer to the spatial centre than higher bands. It should not be read as a physical or psychoacoustic localization model.

3. Stereo output

For two channels, Spread_arc_degrees is internally forced to 180°. The actual audio gains use classic constant-power stereo panning:

panAngle = ((panNorm + 1) / 2) × pi/2 L = cos(panAngle) R = sin(panAngle)

Within the intended range Pan_width ∈ [-1,1], negative width reverses the low-to-high direction. The code does not clamp Pan_width; values outside this range extrapolate the panning law and can produce negative stereo gains.

4. 4/6/8-channel output

For multichannel output, speakers are placed on an evenly spaced ring beginning at Channel 1 = 0° front, increasing clockwise: 90° is right and 180° is back. The target azimuth is:

azimuth = panNorm × (Spread_arc_degrees / 2) then wrapped to [0°, 360°)

The target is routed only to the two adjacent ring speakers. If the target lies a fraction u between them, the gains are:

gain_low = cos(u × pi/2) gain_high = sin(u × pi/2)

This is adjacent-speaker constant-power interpolation. The implementation does not perform a full geometric VBAP matrix solve.

5. Dry anchor

OutputDry signal routing
StereoThe mono working source is copied identically to L and R, producing a centre image.
4/6/8 channelThe mono working source is placed only in Channel 1 (front 0°); all other dry channels are silent.

Dry_wet_mix is a linear amplitude interpolation: wet level = mix, dry level = 1 − mix. The combined result is then normalized to peak 0.99.

Preset configurations

The form contains 9 options including Custom. Presets override channel count, band count, pan width, bandwidth, and spread arc; they do not override LF protection, min/max frequency, dry/wet mix, visualization, or playback.

PresetOutputBandsWidthBW (oct)Arc
CustomUserUserUserUserUser*
Subtle Widening2ch60.50.50180°
Standard Spread default2ch80.80.50180°
Extreme Spray2ch161.00.33180°
Reverse (High→L, Low→R)2ch10-0.90.50180°
Dense Shimmer2ch200.70.33180°
Coarse Texture2ch41.01.00180°
Quad Surround (4ch)4ch121.00.50360°
Octagon Spray (8ch)8ch161.00.33360°

*In stereo, the arc is always forced to 180°. In 4/6/8-channel Custom mode it is clamped to 10°–360°. There is no dedicated 6-channel preset; choose 6ch in Custom.

Parameters & validation

ParameterForm defaultEnforced behaviour
PresetStandard SpreadPreset values override the relevant custom fields.
Number_of_channels2 (stereo)Options are 2, 4, 6, 8. Non-Custom presets may override it.
Number_of_bands8At least 1.
Pan_width0.8Not clamped. Intended range is approximately −1…+1; negative reverses the mapping.
Bandwidth_octaves0.5Must be > 0 or the script exits.
Spread_arc_degrees180Stereo: forced to 180°. Multichannel: clamped to 10°–360°.
LF_protection_Hz150Positive form value; below-cutoff bands receive extra width reduction.
Min_frequency_Hz80Must remain below the effective maximum after Nyquist limiting.
Max_frequency_Hz16000Effective max = min(user max, 0.95 × Nyquist).
Dry_wet_mix1.0Clamped to 0…1.
Draw_visualizationyesDraw the diagnostic figure after processing.
Play_resultyesPlay the resulting object in Praat.
Pan-width extrapolation: Unlike several other parameters, Pan_width is not validated or clamped. Values beyond ±1 are therefore not simply “more width”; in stereo they can push panAngle beyond the normal 0…π/2 panning interval and introduce negative gains.

Processing pipeline

1. Validate exactly one selected Sound. 2. Resolve preset and output channel count. 3. Clamp dry/wet and multichannel arc; force stereo arc to 180°. 4. Limit max frequency to 95% of Nyquist and validate min < max. 5. Convert the selected Sound to mono when needed. 6. Compute logarithmic band centres and octave-based pass bands. 7. For each band: a. compute S-shaped spectral position; b. apply frequency-dependent width and LF reduction; c. map to stereo pan or multichannel azimuth; d. Hann-band filter the mono source; e. add the filtered band to its destination channel(s). 8. Build the dry anchor if Dry_wet_mix < 1. 9. Mix wet and dry linearly. 10. Apply Scale peak: 0.99. 11. Draw the optional visualization and optionally play the result.
Normalization: Scale peak: 0.99 is unconditional. It is not a limiter or attenuation-only ceiling: it can also increase the level of a quiet result. Consequently, absolute level differences caused by dry/wet balance or filtering are not preserved at the final object peak.

Visualization

When enabled, v0.4.2 draws an 8-wide diagnostic figure:

Interpretation: The visualization reports the mapping and gains used by the script. It is not a room simulation, loudspeaker-response model, HRTF display, or prediction of perceived source location.

Limits & interpretation

Practical uses

The tool is suited to experimental spectral distribution, mono-to-stereo texture creation, and preparation of frequency-dependent multichannel material. For mastering or archival work, use conservative settings and verify the result against the unprocessed source, because the filter bank and final normalization can alter timbre and level.