Harmonic Formant Locking — User Guide
Source-filter coupling effect: snaps formant frequencies to the nearest harmonics of F0, creating bell-like, metallic, or synthetic vocal timbres through harmonic alignment.
What this does
This script implements Harmonic Formant Locking — a source-filter coupling effect that snaps formant frequencies to the nearest harmonics of the fundamental frequency (F0). Unlike natural speech where formants are independent of pitch, this effect forces harmonic alignment between the source spectrum and vocal tract resonances, creating bell-like, metallic, or synthetic vocal timbres.
Key Features:
- 6 Preset Strategies — Safe Start to Extreme Synth, plus Custom
- Adjustable Lock Strength — 0-100% blend between original and locked formants
- Bandwidth Scaling — Controls resonance sharpness (1.5× natural to 0.7× metallic)
- 4 Snap Modes — Nearest, Upward, Downward, Octave
- Stability Enhancements — F0 stabilization, formant smoothing, jump limiting
- Intensity Gating — Prevents processing in weak/unvoiced regions
- LPC Resynthesis — High-quality source-filter separation and recombination
- Comprehensive Visualization — Original/locked waveforms, formant trajectories with harmonic grid, spectrograms
🎵 What is Harmonic Formant Locking?
In natural speech, formants (vocal tract resonances) are independent of pitch. A vowel maintains its identity regardless of whether you sing it high or low. This independence is what gives speech its flexibility.
Harmonic Formant Locking breaks this independence by forcing formants to align with harmonics of F0:
- F1 is pulled toward the nearest harmonic (n × F0)
- F2 is pulled toward its nearest harmonic
- F3, F4, F5 similarly "lock" onto the harmonic grid
The result: A coupling between source and filter that creates bell-like, metallic, or synthetic timbres — sounds that seem to "ring" at harmonically related frequencies, like a struck metal plate or a synthesizer with fixed formants.
Technical Implementation: (1) Analysis: Extract F0 (pitch), intensity, and formants (LPC) with formant path tracking. (2) Stabilization: Median filter F0 to reduce octave jumps; smooth formant trajectories. (3) Harmonic Calculation: For each formant, compute harmonic number = round(formant_freq / F0). (4) Locking: Blend original and harmonic-locked frequencies based on lock_strength. (5) Resynthesis: Rebuild formant grid with locked frequencies and scaled bandwidths; perform LPC resynthesis from source excitation. (6) Visualization: Show original vs. locked formant trajectories overlaid on harmonic grid.
Quick start
- In Praat, select exactly one Sound object (speech/voice recommended).
- Run script… → select
Harmonic_Formant_Locking.praat. - Choose Preset (2-6 for specific intensities, 1 for custom).
- Adjust lock strength and bandwidth scale as desired.
- Configure stability options (keep default ON for most material).
- Set snap mode and harmonic range if using custom mode.
- Enable Draw_visualization to see formant trajectories.
- Click OK — processor analyzes, locks formants, resynthesizes.
Harmonic Formant Theory
The Locking Equation
Harmonic Grid
📐 The Harmonic Series
A harmonic series consists of integer multiples of the fundamental:
h₁ = F0 (fundamental)
h₂ = 2 × F0 (octave)
h₃ = 3 × F0 (octave + fifth)
h₄ = 4 × F0 (two octaves)
h₅ = 5 × F0 (two octaves + major third)
h₆ = 6 × F0 (two octaves + fifth)
h₇ = 7 × F0 (≈ harmonic seventh)
h₈ = 8 × F0 (three octaves)
Example with F0 = 200 Hz:
| Harmonic | Frequency | Musical Interval |
|---|---|---|
| 2 | 400 Hz | Octave |
| 3 | 600 Hz | Octave + fifth |
| 4 | 800 Hz | Two octaves |
| 5 | 1000 Hz | Two octaves + major third |
| 6 | 1200 Hz | Two octaves + fifth |
| 7 | 1400 Hz | ≈ minor seventh |
| 8 | 1600 Hz | Three octaves |
Snap Modes Explained
Stability Mechanisms
🛡️ Preventing Artifacts
F0 Stabilization (median filter): Replaces each F0 value with median of neighboring 7 frames. Reduces octave jumps and pitch tracking errors that would cause sudden formant shifts.
Jump Limiting: Restricts harmonic changes to ±2 harmonics per frame. Prevents "zipper noise" — audible steps when formants jump between harmonics.
Formant Smoothing (5-frame moving average): Smooths locked formant trajectories. Reduces graininess and creates more natural transitions.
Intensity Gating: Only applies locking when intensity > min_intensity_dB. Prevents processing in unvoiced regions, silence, or background noise where F0 is unreliable.
Bandwidth Scaling
Preset Strategies
Preset 2: Safe Start (20% lock, wide bands)
🛡️ Conservative Starting Point
Lock strength: 20%
Bandwidth scale: 1.5× (very wide, smooth)
Time step: 0.012 s
Character: Minimal locking, wide bandwidths — subtle effect, safe for any material
Use on: Testing, unfamiliar material, first explorations
Preset 3: Subtle Shimmer (35%)
✨ Gentle Harmonic Enhancement
Lock strength: 35%
Bandwidth scale: 1.2× (slightly wide)
Time step: 0.010 s
Character: Noticeable but not extreme — adds a subtle "shimmer" or "ring" to voices
Use on: Vocals, speech, any material needing gentle enhancement
Preset 4: Moderate Bell (60%)
🔔 Bell-like Resonance
Lock strength: 60%
Bandwidth scale: 1.0× (original bandwidth)
Time step: 0.010 s
Character: Strong coupling — voice takes on bell-like, resonant quality
Use on: Singing, sustained vowels, creating "singing bowl" effects
Preset 5: Strong Metal (85%)
⚙️ Metallic Transformation
Lock strength: 85%
Bandwidth scale: 0.8× (narrow)
Time step: 0.008 s (higher temporal resolution)
Character: Strong harmonic locking with narrow bandwidths — metallic, ringing timbre
Use on: Sound design, industrial textures, robot voices
Preset 6: Extreme Synth (100%)
🎛️ Synthetic Maximum
Lock strength: 100%
Bandwidth scale: 0.7× (very narrow)
Time step: 0.008 s
Snap mode: Octave
Character: Full locking to octave harmonics with very narrow bandwidths — purely synthetic, organ-like timbre
Use on: Experimental synthesis, extreme transformations
Parameters & Controls
Main Controls
| Parameter | Type | Default | Description |
|---|---|---|---|
| Lock_strength_(%) | real | 35 | 0% = original, 100% = fully locked to harmonics |
| Bandwidth_scale | real | 1.2 | Multiplier for formant bandwidths (0.5-2.0 typical) |
Stability Options
| Parameter | Type | Default | Description |
|---|---|---|---|
| Stabilize_F0 | boolean | 1 | Median filter F0 to reduce octave jumps |
| Smooth_formant_transitions | boolean | 1 | 5-frame moving average on locked formants |
| Gate_weak_unvoiced | boolean | 1 | Skip processing when intensity below threshold |
| Min_intensity_dB | real | -25 | Intensity threshold for gating |
| Limit_harmonic_jumps | boolean | 1 | Restrict harmonic changes to ±2 per frame |
| Max_harmonic_jump_per_frame | integer | 2 | Maximum allowed harmonic change |
Timing
| Parameter | Type | Default | Description |
|---|---|---|---|
| Time_step_s | positive | 0.010 | Analysis frame interval (seconds) |
Advanced Options
| Parameter | Type | Default | Description |
|---|---|---|---|
| Snap_mode | option | Nearest | How formants align to harmonics |
| Min_harmonic | integer | 2 | Lowest allowed harmonic (1 = fundamental) |
| Max_harmonic | integer | 20 | Highest allowed harmonic |
| Show_diagnostics | boolean | 1 | Display pitch tracking statistics |
Output
| Parameter | Type | Default | Description |
|---|---|---|---|
| Draw_visualization | boolean | 1 | Generate formant trajectory plot |
| Play_result | boolean | 1 | Audition after processing |
Visualization & Analysis
Visualization Panels
Reading the Formant Trajectory Plot
- Gray dotted lines: Original formant paths — may cross harmonic grid lines independently
- Colored solid lines: Locked formants — should follow harmonic grid lines (horizontal)
- Convergence: Where colored lines align with gray horizontals = strong locking
- Divergence: Where colored lines drift = weaker locking or transition between harmonics
- Step patterns: In extreme locking, formants may jump between harmonics (visible as vertical steps)
- Smoothness: With smoothing enabled, transitions between harmonics are gradual
Diagnostic Output
- Pitch range: Estimated F0 floor/ceiling from quantile analysis
- Pitch issues: Count of unvoiced frames and octave jumps before/after stabilization
- Locked points: Number of successfully locked formant points
- Gated frames: Frames skipped due to low intensity
- Jump-limited transitions: Number of times jump limiting prevented excessive harmonic shifts
- Listening checklist: Troubleshooting guide for common artifacts
Applications
Voice Transformation & Special Effects
Use case: Creating robot voices, metallic characters, or synthetic vocal timbres
Technique: Strong Metal or Extreme Synth presets
Workflow:
- Record spoken or sung phrase
- Apply Strong Metal (85% lock, 0.8× bandwidth)
- Adjust lock strength to taste (60-90% range)
- Experiment with snap modes: Nearest = natural, Upward = brighter, Downward = darker
Bell and Metal Synthesis
Use case: Transforming any sound into bell-like or metallic timbres
Technique: Moderate Bell preset with narrow bandwidth
Settings:
- Preset: Moderate Bell (60% lock)
- Bandwidth scale: 0.7-0.8 (narrow for ringing)
- Snap mode: Nearest (natural bell partials)
- Source: Percussive sounds, piano, any transient-rich material
Result: Source takes on bell-like resonance — each partial aligns with harmonic series, creating "singing" quality
Musical Timbral Design
Use case: Creating evolving timbral textures for electronic music
Technique: Moderate lock strength with varying bandwidth
Applications:
- Pads: 40-50% lock, 1.2× bandwidth (smooth harmonic enhancement)
- Leads: 60-70% lock, 0.9× bandwidth (pronounced harmonic character)
- Basses: 30-40% lock, 1.5× bandwidth (subtle warmth)
- Effects: 80-100% lock, 0.7× bandwidth, Octave snap (extreme synthetic)
Research & Education
Use case: Demonstrating source-filter theory and harmonic relationships
Technique: Enable visualization, compare presets on sustained vowels
Learning outcomes:
- See formants "snap" to harmonic grid in real-time
- Hear the perceptual difference between independent formants and coupled formants
- Understand relationship between harmonic number and musical interval
- Explore effects of bandwidth on timbral brightness/ringing
Practical Workflow Examples
🎤 Robot Voice Effect
Goal: Transform spoken phrase into robotic, synthetic voice
Settings:
- Preset: Strong Metal (85% lock)
- Bandwidth: 0.8× (moderate ringing)
- Snap mode: Nearest (natural harmonic alignment)
- Stabilize F0: ON (reduces warbles)
- Source: Clear speech with varied intonation
Result: Voice takes on metallic, robotic character while retaining intelligibility
🔔 Bell from Piano Note
Goal: Transform piano note into bell-like tone
Settings:
- Preset: Moderate Bell (60% lock)
- Bandwidth: 0.75× (narrow for ringing)
- Snap mode: Nearest
- Source: Single piano note with clear decay
Result: Piano's inharmonic partials are pulled to harmonic series — creates bell-like, ringing tone
🎚️ Vocal Warmth Enhancement
Goal: Add subtle harmonic richness to vocal recording
Settings:
- Preset: Subtle Shimmer (35% lock)
- Bandwidth: 1.2× (slightly wide, smooth)
- Stabilize F0: ON
- Smooth transitions: ON
- Gate weak: ON (preserves breaths)
Result: Vocals gain subtle harmonic "shimmer" without obvious processing
Troubleshooting Common Issues
Cause: F0 tracking errors or octave jumps
Solution: Ensure Stabilize_F0 is ON, reduce lock strength, check recording quality
Cause: Formants jumping too quickly between harmonics
Solution: Enable Limit_harmonic_jumps, increase time_step_s, reduce lock strength
Cause: Bandwidth too narrow for lock strength
Solution: Increase bandwidth_scale (1.0-1.5), reduce lock strength
Cause: LPC resynthesis artifacts or formant smoothing too aggressive
Solution: Reduce lock strength, increase bandwidth, check LPC order
Cause: Intensity gating threshold too high
Solution: Reduce min_intensity_dB (-30 to -40 dB) or disable gating
Advanced Techniques
- Bass emphasis: min_harmonic = 1, max_harmonic = 8 (focus on low harmonics)
- Treble emphasis: min_harmonic = 8, max_harmonic = 30 (focus on high harmonics)
- Odd harmonics only: Modify script to force odd numbers (2n-1) — creates clarinet-like timbre
- Prime harmonics: Force to prime numbers (2,3,5,7,11,13,17,19) — creates unusual inharmonicity
- F1 emphasis: Increase formant_weights#[1] to 1.0 — stronger locking on first formant
- F2 emphasis: Keep F2 at 1.0, reduce others — focus on vowel frontness
- Equal weights: Set all to 1.0 — uniform locking across all formants
- High formants only: Zero out F1,F2 — lock only high frequencies (airy, shimmering)