BPM Rhythmic Panning — User Guide

BPM-locked rhythmic stereo panning with musical subdivisions, swing, accent grids, polyrhythms, gates, constant-power pan law, tempo-aware control-rate rendering, and drum-machine-style visualisation.

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

What this does

BPM Rhythmic Panning turns one mono or stereo Sound into a stereo rhythmic spatial pattern locked to a user-defined tempo and musical subdivision. Unlike a free-running autopanner, its movement is organised around beats, subdivision steps, swing, accent patterns, and named rhythmic figures.

Core idea: tempo and subdivision define a musical control grid. The selected pattern converts that grid into a pan-position curve and an amplitude curve; these are then rendered as complementary left/right gain envelopes and applied to the source.
Source Sound
→ validate mono/stereo input
→ derive BPM/subdivision timing grid
→ apply swing + accent logic where relevant
→ generate pan + amplitude trajectories
→ constant-power left/right gain envelopes
→ AmplitudeTier rendering
→ stereo output
→ optional normalisation + visualisation
True panning vs. balance modulation: With Downmix to mono and pan, stereo input is first converted to mono and the complete source can travel anywhere between left and right. Preserve stereo and modulate balance keeps the original channels separate; material that exists only on one side cannot cross to the other, so this mode is balance modulation rather than true panning.

Rhythmic engine

Eight subdivision choices are available: quarter notes, eighth notes, eighth-note triplets, sixteenth notes, sixteenth-note triplets, thirty-second notes, dotted quarters, and dotted eighths. Swing uses the conventional scale: 50% = straight, 66.7% = triplet swing, and 75% = hard shuffle. Swing warps the boundary inside each pair of subdivision steps while preserving the total duration of the pair.

Swing is pattern-dependent: it applies only to patterns that use the selected subdivision grid. Patterns with their own independent rhythmic clock report swing as not applicable rather than pretending to use it.

Constant-power pan law

For pan position p and pattern amplitude a:

gL = a × sqrt((1 - p) / 2)
gR = a × sqrt((1 + p) / 2)
gL² + gR² = a²

This keeps the squared gain sum constant while the image moves across the stereo field.

Tempo-aware control resolution: the script derives its control rate from the fastest event in the selected pattern, targets 24 control points per event, uses a 200 Hz floor, and caps the render at 6000 Hz / 400,000 control points for practicality.

Quick start

  1. In Praat, select exactly one mono or stereo Sound object.
  2. Run script… → BPM_Panning.praat.
  3. Set Tempo_bpm and choose a musical Subdivision.
  4. Set Swing_percent if the selected pattern uses the subdivision grid. Use 50 for straight timing, 66.7 for triplet swing, or 75 for a hard shuffle.
  5. Edit the Accent_grid if desired. Any character other than 1 is treated as an unaccented step; the grid is limited to 32 characters.
  6. Choose one of the 15 rhythmic Pattern options.
  7. Adjust Edge_transition_percent to smooth rapid envelope changes in musical units: the value is a percentage of one subdivision step.
  8. For true panning of a stereo source, keep Stereo_input at Downmix to mono and pan. Choose the preserve-stereo option only when balance modulation is intentional.
  9. Choose the desired Output_normalisation mode and Peak_target.
  10. Enable or disable Draw_visualization and Play_result, then click OK.

Parameters (form fields)

Name (GUI)TypeDefaultDescription
Tempo_bpmreal120Tempo in beats per minute. Accepted range: 1–999 BPM.
Subdivisionoption menu1/16Rhythmic grid: 1/4, 1/8, 1/8T, 1/16, 1/16T, 1/32, 1/4D, or 1/8D.
Swing_percentreal50Swing position inside each pair of subdivision steps. 50 = straight, 66.7 = triplet swing, 75 = hard shuffle. Values are clamped to 25–75. Some independently-clocked patterns do not use swing.
Accent_gridsentence1010100110101001Repeating accent pattern. Character 1 means accented; all other characters are unaccented. Empty input falls back to 1000100010001000; maximum length is 32 steps.
Patternoption menuPing-pongOne of 15 BPM-locked rhythmic figures: Ping-pong, Two-beat pendulum, Backbeat snap, Hat 16ths, Dotted dub, Trance gate, Pulse train, Ghost notes, Stutter, Roll, 3-against-4, 5-against-7, Two-bar arc, Phrase build, or Polymeter shift.
Edge_transition_percentreal12One-pole transition time expressed as a percentage of one subdivision step. Clamped to 0–100. At 0%, AmplitudeTier interpolation still makes transitions very fast rather than mathematically square.
Stereo_inputoption menuDownmix to mono and panDownmix to mono and pan provides true panning. Preserve stereo and modulate balance keeps original channels separate and therefore cannot move one-sided material across the stereo image.
Output_normalisationoption menuPeakPeak scales the final stereo output to the target, Attenuate only reduces level only when the peak exceeds the target, and None leaves output level unchanged.
Peak_targetreal0.95Target absolute peak for the normalization modes. Invalid values fall back to 0.95.
Draw_visualizationboolean1Draws the drum-machine-style diagnostic display.
Play_resultboolean1Plays the final stereo Sound after processing.

15 Patterns

Ping-pong

Alternates left and right on the selected subdivision grid.

Two-beat pendulum

Slower beat-scale movement with a pendulum-like arc.

Backbeat snap

Emphasises backbeat positions with abrupt spatial contrast.

Hat 16ths

Fast sixteenth-note spatial articulation.

Dotted dub

Dotted-eighth movement suited to dub-style rhythmic spacing.

Trance gate

Regular gated motion with strong subdivision locking.

Pulse train

Repeated pulses articulated through both level and position.

Ghost notes

Uses accent and non-accent steps to create foreground/background motion.

Stutter

Rapid repeated directional attacks.

Roll

Dense rolling movement with fast spatial repetition.

3-against-4

Polyrhythmic spatial cycle based on three against four.

5-against-7

More complex polyrhythmic spatial interference.

Two-bar arc

Long-form motion shaped across a two-bar span.

Phrase build

Progressively develops movement over a phrase-scale trajectory.

Polymeter shift

Uses mismatched repeating cycles to create slowly shifting spatial alignment.

Accent grid: patterns that use accents read the repeating character string from left to right. Character 1 is accented; every other character is treated as unaccented.

Visualisation

When Draw_visualization is enabled, the script produces a compact drum-machine-style diagnostic view of the rhythmic spatial process.

  • Rhythmic grid — subdivision steps, beat lines, swing displacement, and accent states.
  • Pan trajectory — left/right spatial position through time.
  • Amplitude trajectory — rhythmic gain contour used by the pattern.
  • Left/right gains — complementary constant-power gain envelopes.
  • Output waveform — final stereo result for structural reference.
  • Summary panel — BPM, subdivision, swing status, pattern, control rate, transition time, normalisation mode, and peak statistics.

Outputs