Advanced Stereo Panner — User Guide
A creative stereo panner with static or time-varying pan trajectories, two gain models, optional ITD, far-ear head-shadow filtering, and distance-dependent attenuation / air absorption.
What this does
The script converts the selected Sound to a mono working source and renders a stereo result whose left/right relationship can remain fixed or evolve over time. One RealTier acts as the master pan trajectory. The same trajectory drives channel gains, ITD, and trajectory-mode head-shadow depth, so those cues remain synchronized.
- Static panning: 9 position presets plus Custom.
- Built-in trajectories: left→right, right→left, sine sweep, widening oscillation, narrowing oscillation, damped pendulum.
- Drawable trajectory: edit a PanTrajectory RealTier in a two-pass workflow.
- Two gain models: conventional equal-power or bounded ILD.
- Optional ITD: constant in Static mode, time-varying and fractional in trajectory modes.
- Far-ear head shadow: low-pass cue, implemented differently for static and moving pans.
- Distance: true inverse-distance amplitude or the legacy softened rolloff.
- Peak ceiling: attenuation only; it never boosts the output back to a target.
Quick start
- Select exactly one Sound.
- Run
Advanced_Stereo_Panner.praat. - Choose Pan_mode: Static, a built-in trajectory, or Draw Your Own.
- Choose Panning_model. The default is Bounded psychoacoustic ILD.
- Enable or disable ITD, head shadow, distance and air absorption as needed.
- Set Peak_ceiling; 0.95 is the default.
- Run the script. For Draw Your Own, follow the two-pass procedure described below.
Pan modes
| Mode | Actual trajectory | Trajectory_cycles | Trajectory_depth |
|---|---|---|---|
| Static position | Constant pan value from a preset or Custom. | Ignored | Ignored |
| Left to right | Linear -1 → +1. | Ignored | Scales excursion. |
| Right to left | Linear +1 → -1. | Ignored | Scales excursion. |
| Sine sweep | sin(phase). | Controls oscillation count. | Scales excursion. |
| Centre out to both sides | Sine oscillation multiplied by normalized time, so its width grows from 0 to full depth. | Controls oscillation count. | Maximum final excursion. |
| Sides in to centre | Sine oscillation multiplied by 1-u, so its width contracts to centre. | Controls oscillation count. | Initial excursion. |
| Pendulum | sin(phase) × exp(-2u). | Controls oscillation count. | Initial excursion. |
| Draw your own | User-edited RealTier. | Ignored | Ignored for the drawn tier itself. |
Built-in paths are sampled into a RealTier, then read onto a control grid. Values are always clipped to the legal pan range -1…+1 before processing.
Static position presets
| Preset | Pan |
|---|---|
| Centre | 0 |
| Hard Left / Hard Right | -1 / +1 |
| Medium Left / Medium Right | -0.5 / +0.5 |
| Subtle Left / Subtle Right | -0.25 / +0.25 |
| Wide Left / Wide Right | -0.75 / +0.75 |
| Custom | Pan_position, constrained to -1…+1 |
Draw Your Own — two-pass workflow
Praat cannot open another pause form while the script's own form is active, so v2.2 replaced the former waiting dialog with a persistent two-pass handshake.
The initial tier is seeded with a gentle -1, -0.5, 0, +0.5, +1 sweep so the editor opens with the full pan range visible. You may edit and reuse the same RealTier for multiple renders with different spatial-cue settings.
Panning models
1. Conventional equal-power
This model already creates its own left/right level difference; no extra ILD gain is added. At hard pan the far channel reaches exactly zero. Consequently, any ITD or head-shadow processing on that silent far channel is inaudible at the endpoint.
2. Bounded psychoacoustic ILD — default
Instead of taking an equal-power pan and adding another ILD on top, the gains are solved directly from the desired inter-channel level difference.
At ILD_max_dB = 12 and hard pan, the far channel remains approximately 0.2436 rather than becoming silent. This is deliberate: the far-ear ITD and head-shadow cue remain audible.
Interaural Time Difference (ITD)
The far channel is delayed by an amount proportional to pan magnitude. The output duration is always extended by the configured maximum ITD when ITD is enabled, so delayed material is not truncated.
Static mode
The far ear receives one constant delay equal to |pan| × Max_ITD_ms.
Trajectory modes
The pan curve is rasterized and read per audio sample. Each channel reads the untouched source at x - delay(x). Praat interpolation therefore supplies a fractional, continuously changing delay, rather than quantizing ITD to whole samples.
Far-ear head shadow
This cue is a low-pass treatment of the far channel. It is intentionally described as head shadow, not as a complete set of spectral localization cues: there are no pinna notches, HRTFs, elevation cues, or front/back model.
Static mode — moving cutoff
Only the far channel is filtered. At centre no head-shadow filter is applied.
Trajectory mode — dry/wet crossfade
A filter cutoff cannot be swept inside one Praat filter command, so moving-pan mode uses a different but explicitly reported implementation:
Shadow_depth is clamped to 0…0.95. The requested cutoff is also capped at 95% of Nyquist when necessary.
Distance & air absorption
The distance controls are global: they affect both stereo channels equally before the final safety ceiling, so they change overall level without changing the pan ratio.
Inverse distance — default
This is the inverse-distance pressure/amplitude law. Acoustic energy is proportional to the square of pressure, so its energy counterpart follows approximately 1/d².
Softened rolloff
This preserves the v1.1 curve under an accurate name. It is not an inverse-square law and is not normalized to unity at the reference distance.
Distance limits
Reference_distance_meters must be positive. If Max_distance is not above the reference it is internally raised to reference + 1 m. Distance is constrained to the interval from reference distance through maximum distance.
Air absorption
When distance and air absorption are enabled, a global low-pass becomes progressively darker from the reference distance toward Max_distance:
No air filter is applied at the reference distance. The cutoff is constrained to at least 200 Hz and at most 95% of Nyquist.
Parameters
| Parameter | Default | Actual role |
|---|---|---|
| Pan_mode | Static | Static value, six generated trajectories, or Draw Your Own. |
| Preset | Centre | Used only in Static mode. |
| Pan_position | 0 | Custom static pan; must be -1…+1. |
| Trajectory_cycles | 2 | Oscillation count for sine / widening / narrowing / pendulum paths. |
| Trajectory_depth | 1 | Scales built-in trajectory excursion; clamped 0…1. |
| Panning_model | Bounded psychoacoustic ILD | Selects the channel-gain law. |
| ILD_max_dB | 12 dB | Maximum hard-pan difference for the bounded-ILD model. |
| Use_ITD | on | Enables far-channel delay. |
| Max_ITD_ms | 0.65 ms | Maximum ITD at |pan| = 1. |
| Use_head_shadow | on | Enables far-channel low-pass cue. |
| Head_shadow_cutoff_Hz | 8000 Hz | Base cutoff; Nyquist-capped if necessary. |
| Shadow_depth | 0.5 | Static cutoff depth or trajectory dry/wet depth; clamped 0…0.95. |
| Use_distance | on | Enables global distance attenuation. |
| Distance_model | Inverse distance | Inverse-distance amplitude or legacy softened curve. |
| Distance_meters | 1 m | Current distance, internally constrained to reference…maximum. |
| Max_distance_meters | 30 m | Upper distance bound. |
| Reference_distance_meters | 1 m | Unity-distance reference for inverse-distance mode. |
| Use_air_absorption | on | Enables progressive global low-pass when distance is active. |
| Air_cutoff_at_reference_Hz | 12000 Hz | Reference cutoff from which distance darkening is calculated. |
| Peak_ceiling | 0.95 | Attenuation-only output ceiling; invalid values reset to 0.95. |
| Draw_visualization | on | Draws the v2.2.1 process figure. |
| Play_result | on | Plays the final stereo Sound. |
Output & peak ceiling
The working source is mono even when the selected input is multichannel. The left and right processed channels are combined into one stereo result named:
Attenuation-only ceiling
This is deliberately not peak normalization to a target. Quiet or distant results are not boosted. Consequently, distance attenuation and the absolute pan level survive into the delivered Sound.
Visualization v2.2.1
Implementation notes & limitations
- Exactly one Sound: one RealTier may additionally be selected for Draw Your Own pass 2.
- Multichannel input: converted to mono using Praat's ordinary mono conversion before spatial processing.
- Non-zero source times: the working mono source is normalized to begin at t = 0.
- Control density: approximately 200 trajectory-control points per second, with a minimum of 100 and maximum of 20,000. AmplitudeTier interpolation smooths gain changes between control points.
- Static and moving head shadow differ: Static mode moves the low-pass cutoff; trajectory mode crossfades dry signal with a fixed-cutoff low-pass. This is intentional and reported by the script.
- ITD changes output duration: when ITD is enabled, the stereo object is source duration + configured maximum ITD, even when a particular static pan uses less than the maximum delay.
- No HRTF: no pinna, elevation, individualized anatomy, front/back discrimination, or crosstalk cancellation.
- No reverberation: distance consists of amplitude rolloff and optional low-pass darkening only.
- Drawn trajectories persist: a user-supplied PanTrajectory is never deleted by the script.