Stereo Panorama Mixer — User Guide

Distributes one or more selected Sounds across a configurable stereo field, with six presets, three source-order strategies, three panning laws, automatic sample-rate matching, output peak scaling, and suite-standard spatial visualisation.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2025) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

Stereo Panorama Mixer creates one stereo mix from the selected Sound objects. Each source receives a target pan position, the position is converted to left/right gains according to the selected panning law, and the panned signals are accumulated into a stereo canvas whose duration matches the longest source.

Signal flow
selected Sounds
→ choose preset / width / ordering / pan law
→ first selected Sound defines output sample rate
→ resample mismatched sources when necessary
→ assign pan position to every source
→ derive L/R gains from selected pan law
→ mix each source from time 0 for its own duration
→ scale completed stereo mix to Output_peak
→ optional visualisation and playback
One source is valid. Unlike the older version documented here previously, v0.4 no longer requires at least two Sounds. With one selected source, its pan position is set safely to the centre instead of dividing by N-1.
Selection order matters. Forward, Reverse, and Center-out determine which selected source occupies each stereo slot. Pan width then scales those slots toward or away from the centre.
Current stereo-input implementation: the form labels one mode Preserve balance (pan each input channel), but in the current v0.4 code the extracted left and right channels are averaged together before the pan gains are applied. For an ordinary stereo source this is effectively a fold-to-mono operation, so the original L/R balance is not actually preserved. The explicit Fold to mono mode therefore produces essentially the same spatial input signal. This is an implementation issue in the script rather than a documentation convention.

Quick start

  1. In Praat, select one or more Sound objects.
  2. Run script…Distribute_sounds_in_stereo_field.praat.
  3. Choose a Preset, or select Custom and set Pan_width and Order manually.
  4. Choose a Pan_law.
  5. Choose the stereo-input handling mode. See the implementation warning above for the current behaviour of Preserve balance.
  6. Set the desired Output_peak.
  7. Enable or disable Draw_visualization and Play_result, then click OK.
Sources with sampling rates different from the first selected Sound are automatically resampled to the first source's rate before mixing. The output duration is the duration of the longest selected source.

Presets & ordering

Custom

Uses the values entered for Pan_width and Order.

Even Spread

Full stereo width (1.0) in Forward order.

Headphone-Friendly

80% stereo width (0.8) in Forward order, avoiding the hardest extremes.

Cluster Center

40% stereo width (0.4) in Forward order for a compact central image.

Reverse Order

Full stereo width with the selected sources assigned right-to-left.

Spread from Center

Full width using the Center-out source-order strategy.

Pan positions

For more than one source, output slots are evenly spaced across the full range and then multiplied by Pan_width:

rawPan(slot) = -1 + 2 × (slot - 1) / (N - 1)
pan = rawPan × Pan_width

Pan_width is clamped to the safe range 0–1. At 1.0, the outermost slots reach hard left and hard right; at 0.4, the same distribution occupies only the central 40% of the stereo range.

Order modes

Panning laws

The pan parameter runs from -1 (left) to +1 (right). Internally it is mapped to pos = (pan + 1) / 2.

1. Constant power (square-root)

L = sqrt(1 - pos)
R = sqrt(pos)
L² + R² = 1

Maintains unit summed squared gain across the field.

2. Linear

L = 1 - pos
R = pos

Simple equal-voltage interpolation. At the centre both gains are 0.5, so summed squared gain is 0.5 rather than 1.

3. -3 dB sin/cos

L = cos(pos × π / 2)
R = sin(pos × π / 2)
L² + R² = 1

A trigonometric constant-power curve. Like the square-root law it reaches approximately 0.707 per channel at centre, but the curve shape away from centre is different.

Parameters

Name (GUI)TypeDefaultDescription
Presetoption menuCustomSix choices: Custom, Even Spread, Headphone-Friendly, Cluster Center, Reverse Order, and Spread from Center.
Pan_widthreal1.0Scales the stereo distribution around the centre. Values are clamped to 0–1. Presets may override it.
Orderoption menuForwardForward, Reverse, or Center-out. Presets may override it.
Pan_lawoption menuConstant power (sqrt)Square-root constant power, Linear, or -3 dB sin/cos.
Stereo_input_handlingoption menuPreserve balanceOffers Preserve balance or Fold to mono. In the present v0.4 implementation, Preserve balance also averages channels 1 and 2 before panning; see warning above.
Output_peakreal0.95Target used by Scale peak on the completed stereo mix.
Draw_visualizationboolean1Draws the 8×8 suite-standard diagnostic display.
Play_resultboolean1Plays the final stereo mix after processing.

Processing details

Output canvas

The first selected Sound defines the output sample rate and the output name base. The canvas is stereo, begins at 0 seconds, and extends to the longest selected duration.

[FirstSourceName]_panMix_[PresetName]

Sample-rate handling

If another selected source has a different sampling frequency, the script reports a warning and resamples that source to the first source's rate using Praat's Resample command before mixing it.

Source duration

Each source contributes from time 0 to its own duration. Shorter sources end naturally while longer sources continue until the maximum output duration.

RMS analysis

Per-source RMS is measured for the visualisation. For mono/folded input it is the RMS of the working mono source. In the nominal Preserve-balance branch it is calculated from the separate input-channel RMS values before those channels are averaged for mixing.

Final gain

After all sources have been accumulated, the complete stereo result is processed with:

Scale peak: Output_peak
This is target peak scaling, not merely clipping protection: a mix below the target may also be amplified.

Visualisation

Version 0.4 uses the suite-standard 8×8 spatial visualisation. The DSP itself is unchanged by the later visual-standardisation pass.

Stereo field placement

Horizontal L–C–R strip showing each source at its actual pan position. Marker size reflects source RMS; source names and width edges are shown directly on the field.

Pan-law curves

Left and right gain curves across pan position for the selected law, with markers at every source's actual L/R gain pair.

Per-source RMS

RMS bars sorted from left to right, labelled by original source index and pan position.

Output waveform

Final stereo waveform with left in blue and right in orange, plus amplitude and time label rails.

Compact summary

Preset, source count, width, pan law, order, stereo-input mode, output duration and peak, followed by a compact source/pan list.

Outputs

Applications

Sound masses

Rapidly arrange multiple related sounds across a controlled stereo width.

Layered textures

Create a reproducible panorama for drones, granular layers, sustained materials, or environmental recordings.

Rhythmic collections

Separate simultaneous or related attacks spatially without manually assigning every pan value.

Comparative listening

Compare pan laws, stereo widths, and source-order strategies using the same input set.