IRCAM Pan to Binaural — User Guide

Places a mono or stereo source at a static or moving position, encodes it to Higher-Order Ambisonics, decodes it to a controlled virtual loudspeaker array, and renders the result to binaural stereo with IRCAM Spat5.

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

What this does

IRCAM Pan to Binaural is a spatializer and renderer for one mono or stereo Sound. It creates a spatial position or trajectory, encodes the source into a three-dimensional HOA field, decodes that field to a virtual loudspeaker array, and then renders those loudspeakers to the two ears through HRTFs.

MONO / STEREO SOURCE ↓ position or movement azimuth + elevation ↓ spat5.hoa.encoder~ ↓ HOA soundfield ↓ spat5.hoa.decoder~ ↓ virtual loudspeaker feeds ↓ spat5.virtualspeakers~ HRTF + ITD + optional room ↓ BINAURAL STEREO

The tool is intended for creative spatial placement and movement rather than for converting an already-authored loudspeaker mix.

How it complements Multichannel to Binaural

ToolInputMain role
IRCAM Pan to BinauralMono or stereo sourceCreates the spatial position / movement, then renders it binaurally.
IRCAM Multichannel to BinauralExisting loudspeaker feedsPreserves the given loudspeaker layout and virtualizes it through HRTFs.

In other words, Pan to Binaural is a spatializer + renderer; Multichannel to Binaural is primarily a renderer.

Quick start

  1. Install IRCAM Spat5 and locate the folder containing spat5.hoa.encoder~, spat5.hoa.decoder~, and spat5.virtualspeakers~.
  2. Place spat_bridge.py in the Praat AudioTools script folder.
  3. Select exactly one mono or stereo Sound.
  4. Choose whether a stereo input is summed to mono or preserved as two spread sources.
  5. Choose Horizontal or 3D quality.
  6. Choose Static or one of the movement trajectories.
  7. Set azimuth, end azimuth, elevation, and cycles as required by the trajectory.
  8. Choose HRTF / room settings.
  9. Leave Headroom on Auto safe render for normal use.
For a simple binaural panner, use Static. For a conventional left-to-right movement, use Linear with Azimuth = −90 and End azimuth = +90.

Processing chain

1. HOA encoder

The source is encoded at the current azimuth and elevation. In stereo-preserve mode, left and right become two separate sources positioned symmetrically around the trajectory centre according to Stereo spread.

2. HOA decoder

The HOA field is decoded to a predefined virtual loudspeaker array. HOA order and speaker array are deliberately chosen together rather than exposed as arbitrary combinations.

3. Binaural virtual speakers

The decoded loudspeaker feeds are passed to spat5.virtualspeakers~, which applies the selected HRTF / SOFA data, ITD scaling, and optional room model.

The HOA path is an intermediate representation. The final listening format is always two-channel binaural stereo.

Mono & stereo sources

Source modeBehavior
MonoA mono source remains mono. A stereo input is summed to mono before spatial encoding.
Stereo: keep L/RThe left and right input channels are preserved as two HOA sources placed on opposite sides of the centre position.

With stereo preservation, the two source azimuths are:

Left = centre azimuth − Stereo spread / 2 Right = centre azimuth + Stereo spread / 2

The stereo pair follows the same trajectory while retaining its internal left/right separation.

Horizontal & 3D quality

QualityHOAVirtual arrayUse
HorizontalOrder 17 full-range speakers, 7.0Azimuthal placement and movement around the listener.
3DOrder 211 full-range speakers, then silent LFE inserted for 7.1.4Azimuth plus elevation using a bed ring and four height speakers.

Horizontal array

The seven virtual speakers are placed at approximately −150°, −90°, −30°, 0°, +30°, +90°, and +150°, all at 0° elevation.

3D array

The same seven-speaker horizontal bed is supplemented by four height speakers at approximately ±45° and ±135° azimuth, all at +45° elevation. The HOA decoder produces 11 full-range feeds; the Python bridge inserts a silent LFE at channel 4 before the 7.1.4 binaural stage.

Elevation in Horizontal mode is intentionally ignored. Choose 3D quality when elevation is musically important.
The 7.1.4 array contains height speakers above the listener, but no lower speaker ring. Negative elevation values are therefore represented by the HOA decode through the available bed/height array rather than by dedicated HRTFs below the listener.

Movement trajectories

Movement is defined directly in azimuth and elevation. There is no distance or trajectory-radius parameter because the HOA encoder is being used here for direction, not source distance.

ModeBehaviorMain controls
StaticOne fixed azimuth / elevation for the complete source.Azimuth, Elevation
Linear sweepLinear angular interpolation from Azimuth to End azimuth.Azimuth, End azimuth
RotationOne or more complete 360° rotations beginning at Azimuth.Azimuth, Cycles
PendulumSmooth sinusoidal movement between Azimuth and End azimuth.Azimuth, End azimuth, Cycles
ZigzagLinear back-and-forth triangular motion between the two azimuth limits.Azimuth, End azimuth, Cycles
WanderDeterministic quasi-random angular motion built from two incommensurate sinusoidal components.Azimuth, End azimuth, Cycles
Rising arcLinear azimuth sweep while elevation rises from 0 to the requested value and returns to 0.Azimuth, End azimuth, Elevation
Figure-8Azimuth oscillates while elevation oscillates at twice the rate.Azimuth, End azimuth, Elevation, Cycles

Angles are sampled once per processing chunk and wrapped to the standard ±180° region before being sent to the encoder.

Movement resolution

With Advanced movement settings, the default chunk duration is 0.25 s and the default crossfade is 0.05 s. Shorter chunks make movement finer but increase processing time because every chunk must pass through the complete three-stage Spat chain.

Safe render

The tool analyses all three external-processing stages:

  1. HOA encoder output
  2. virtual loudspeaker decoder output
  3. final binaural output

PCM full-scale samples at any stage are treated as clipping. In Auto safe render, if even one movement chunk clips, all chunks from that pass are discarded and the complete movement is rendered again with 6 dB more input attenuation. This preserves consistent gain throughout the trajectory.

render all chunks at current gain ↓ any stage clips? YES → discard the pass input −6 dB render every chunk again NO → accept pass ↓ assemble + optional normalization

Up to five complete passes can be attempted in automatic mode. Manual pre-gain performs one checked pass.

The source is normally exported as a 24-bit intermediate WAV. If the first external render cannot use that intermediate format, the tool retries with 16-bit WAV.

Normalization is performed only after a clean pass has been assembled. A clipped render is never “repaired” by lowering its level afterwards.

This checking is one reason moving renders take longer: every chunk is encoded, decoded, binauralized, and measured, and a failed pass may be rendered again in full.

HRTF, ITD & room

PresetSOFA/HRTFRoom
KEMAR / neutralKEMARnone
KEMAR / hallKEMARhall
KEMAR / studioKEMARstudio
SOFA customValue of Sofa fileUser-selected Room preset

ITD percent scales interaural time difference from 0 to 200%. Values outside this range are clamped.

With a custom SOFA dataset, the Room preset may be none, hall, living room, studio, preset1–4, or legacy1–3.

In movement mode, each chunk receives its own complete Spat render. Room processing is therefore chunk-based rather than one continuously evolving physical reverberation state across the entire trajectory. The final chunk's genuine room tail is preserved.

Controls

ControlDefaultRole
Tools folderSpat5 tools pathFolder containing the three required Spat5 command-line processors.
Source modeMonoSum stereo to mono, or preserve L/R as two spatial sources.
Stereo spread60°Angular separation of the preserved stereo pair.
QualityHorizontalHOA order 1 → 7.0, or HOA order 2 → 7.1.4.
MovementStaticStatic placement or one of seven movement trajectories.
Azimuth0°Static position, trajectory start, or trajectory centre depending on mode.
End azimuth90°Trajectory destination / range for relevant modes.
Elevation0°Static elevation or vertical extent for 3D movement.
Cycles1Number of rotations / swings / oscillations for cyclic trajectories.
HRTF presetKEMAR / neutralSelect KEMAR or custom SOFA rendering.
Sofa filekemarCustom SOFA dataset name.
ITD percent100Interaural time-difference scaling.
Room presetnoneRoom model used with Custom SOFA.
HeadroomAuto safe renderAutomatic re-rendering or one-pass manual gain.
Manual pre-gain−9 dBRequested input gain in Manual mode.
Normalise outputOnScale a clean assembled result to the requested output peak.
Output peak−1 dBFSFinal normalization target; values are constrained to −24…0 dBFS.
Advanced movement settingsOffExpose chunk duration and crossfade.
Draw visualizationOnCreate the AudioTools spatial / level diagnostic figure.
Play resultOnPlay an accepted clean result.

Visualization

The Picture-window report combines spatial and level information:

Output & timing

Static rendering produces a stereo Sound named approximately:

source_panBinaural

Moving renders append the trajectory name, for example:

source_panBinaural_Linear source_panBinaural_Rotation source_panBinaural_Figure8

Movement chunks overlap through crossfades. Internal chunk tails are discarded when the next chunk takes over, while a genuine room tail from the final chunk may extend the output beyond the source duration.

The Info window reports a level ledger including source peak, accepted input attenuation, number of safe-render passes, intermediate bit depth, render peak, normalization, final peak, total output length, and L/R correlation.

Practical notes

Troubleshooting

Spat5 processor not found

Set Tools folder to the directory containing all three required Spat5 command-line processors.

Python not found

The script checks common Python 3 commands. Python must be available on the system PATH. NumPy is optional and accelerates WAV analysis when installed.

The moving render is very slow

Increase Chunk duration in Advanced movement settings. This reduces the number of encoder → decoder → binaural operations, at the cost of coarser movement.

Movement sounds stepped

Reduce Chunk duration. A smaller value gives more spatial updates per second. Crossfade can also be increased modestly to smooth transitions.

The result clips or the script performs several passes

This is the Safe Render system working as intended. A clipped pass is rejected and the whole trajectory is rendered again with 6 dB more attenuation.

Elevation has no effect

Check that Quality = 3D. Horizontal quality uses only the seven-speaker horizontal array and fixes elevation to 0°.

Stereo input collapses to one source

Choose Source mode = Stereo: keep L/R, spread around the position. The default Mono mode intentionally sums a stereo input before encoding.

Dependencies