Harmonic Formant Locking — User Guide
Spectral-envelope transformation that moves energy from measured formant-landmark regions toward exact harmonics of F0 while preserving the original complex-spectrum phase.
What this does
Harmonic Formant Locking uses pitch and formant analysis to reshape the spectral envelope of a selected Sound. The measured formants are treated as robust spectral-envelope landmarks. They do not become LPC resonator poles and the script does not perform LPC resynthesis.
For each reliable landmark, the processor chooses an allowed harmonic number and defines the destination as exactly n × F0. A broad Gaussian-shaped attenuation is placed around the original landmark region and a matching enhancement is placed around the harmonic destination. The same real-valued gain is applied to the real and imaginary spectrum components, so the original complex-spectrum phase is retained.
What “locking” means here
The tool does not literally move an LPC formant track. It redistributes spectral-envelope emphasis from a measured landmark toward an exact harmonic of the current or stable F0. This creates source/filter coupling while keeping the transformation within the original signal’s spectrum rather than rebuilding the voice from a separate excitation and filter model.
Quick start
- Select exactly one Sound object in Praat.
- Run
Harmonic_Formant_Locking.praat. - Start with Safe Start (20%) or Subtle Shimmer (35%).
- Use Dynamic F0 / stable formant landmarks for changing pitch, speech, or singing.
- Use Stable note for a sustained pitch when you want one fixed spectral curve across the complete sound.
- Keep Preserve frame energy enabled unless level change inside the spectral transformation is part of the desired effect.
- Leave Safety ceiling selected for a conservative output level.
- Enable the visualization to inspect the measured landmarks and harmonic targets.
Processing pipeline
Formant landmarks
To FormantPath (burg) is used for analysis. For each of up to five formants, the script takes the median frequency and the interquartile range over the file. These statistics define a stable landmark and a broad envelope-region width. The width is constrained by a per-formant floor, a fraction of the landmark frequency, the observed IQR spread, and a 900 Hz cap.
Harmonic target selection
The allowed harmonic ceiling is calculated from F0 and Nyquist for each target, with an additional safety cap of harmonic 64. There is no fixed “maximum harmonic 20” limit. The minimum harmonic is 2.
Dynamic mode adds harmonic hysteresis so a target does not switch harmonics unnecessarily near a boundary. Octave mode keeps targets on powers of two even when constrained by Nyquist.
Spectral shaping
For each active landmark, the maximum shaping amount is:
The built-in landmark weights are F1 0.60, F2 1.00, F3 1.00, F4 0.80, F5 0.60. A positive Gaussian region is centered at the harmonic target and a corresponding negative region is centered at the original landmark. Overlapping contributions add and the final spectral gain is clamped to ±Max_shape_dB.
Tracking modes
Dynamic F0 / stable formant landmarks
The formant landmarks remain fixed, but F0 is sampled over time. The processor uses approximately 50 updates per second and a 40–80 ms adaptive grain. Each grain receives exact harmonic targets derived from its stabilized F0.
Audio is reconstructed with integer-sample Hann analysis/synthesis and Hann² weighted overlap-add normalization.
Stable note
The median F0 and the robust landmarks define one fixed spectral curve. Each channel is transformed with a single FFT and the same curve is applied across the whole file.
This mode is time-invariant. Gate weak/unvoiced is not used in Stable-note mode.
Dynamic F0 stabilization and gating
With Stabilize F0 enabled, each dynamic F0 estimate is replaced by a small running median of nearby valid estimates. This suppresses isolated tracking errors without averaging the harmonic target frequency itself.
With Gate weak/unvoiced enabled, a dynamic grain must have a valid F0 and sufficient intensity. The threshold is relative to the loudest analyzed grain:
When a grain is inactive, no spectral-locking curve is applied to that grain.
Presets
| Preset | Lock | Max shape | Snap | Character |
|---|---|---|---|---|
| Custom | Form value | Form value | Form value | Uses the controls as entered. |
| Safe Start | 20% | ±6 dB | Form value | Conservative spectral coupling. |
| Subtle Shimmer | 35% | ±9 dB | Form value | Moderate harmonic emphasis. |
| Moderate Bell | 60% | ±12 dB | Form value | Clearly audible harmonic locking. |
| Strong Metal | 85% | ±15 dB | Form value | Strong spectral relocation. |
| Extreme Synth | 100% | ±18 dB | Octave harmonic | Maximum shaping with power-of-two harmonic targets. |
Parameters
| Control | Default | Meaning |
|---|---|---|
| Preset | Safe Start | Loads the musical strength settings shown above. |
| Lock strength (%) | 35 | Scales how strongly each landmark-region transfer is applied. 0% is a true bypass. |
| Max shape dB | 9 | Maximum positive or negative spectral gain after overlapping landmark contributions are summed. |
| Tracking mode | Dynamic F0 | Chooses dynamic grain-based targets or one fixed stable-note curve. |
| Snap mode | Nearest harmonic | Defines how the harmonic number is selected. |
| Preserve frame energy | On | Applies exact spectral-energy compensation after shaping. In Stable mode this is whole-file FFT energy; in Dynamic mode it is per processed grain. |
| Stabilize F0 | On | Small running-median stabilization in Dynamic mode. Stable-note mode already uses median F0. |
| Gate weak/unvoiced | On | Dynamic mode only. Suppresses locking in grains without valid F0 or below the relative intensity threshold. |
| Min intensity dB | -25 | Dynamic gate offset relative to the maximum analyzed intensity, not an absolute dBFS threshold. |
| Dry/Wet mix | 1.0 | 0 = true bypass before analysis; 1 = fully processed. Intermediate values linearly mix processed and original channel samples. |
| Output level mode | Safety ceiling | Chooses final level handling. |
| Ceiling peak | 0.95 | Peak used by Safety ceiling, RMS+ceiling and Peak normalize. |
| Show diagnostics | On | Adds target/gating information to the Info window. |
| Draw visualization | On | Draws the suite-standard diagnostic page. |
| Play result | On | Auditions the final object. If its peak exceeds 1, playback uses a temporary scaled copy while the stored output remains unchanged. |
Output level modes
| Mode | Behavior |
|---|---|
| Natural level | No final gain correction. Peaks above 1 are possible. |
| Safety ceiling | Attenuates only when the processed peak exceeds Ceiling_peak; otherwise leaves level unchanged. |
| Match input RMS + safety ceiling | First matches the input RMS, then attenuates if the resulting peak exceeds the ceiling. |
| Peak normalize | Always scales a non-zero result so its peak equals Ceiling_peak. |
Input & output behavior
- Selection: exactly one Sound is required.
- Minimum duration: 120 ms.
- Sample rate: preserved. Very low sample rates are rejected if they cannot support reliable multi-formant analysis.
- Channels: all input channels are preserved and processed independently with the same analysis-derived target structure.
- Analysis of multichannel input: normally uses a mono fold; if the fold nearly cancels, the loudest real channel is used instead.
- Duration: preserved.
- Start time: processing occurs on a time-zero work copy; the original
xminis restored to the final output. - Randomness: none.
- Normal output name:
<original>_HarmonicLock_<PresetName>. - Bypass output: Lock = 0 or Dry/Wet = 0 returns a copied full-bypass object named
<original>_HarmonicLock_Bypass. The output-level stage is intentionally skipped in this path. - Low envelope confidence: the input is returned unchanged as
<original>_HarmonicLock_NoReliableEnvelope.
Visualization
The visualization is diagnostic; it does not alter the stored audio.
- Input waveform: grey.
- Locked output waveform: green. Input and output use the same amplitude scale.
- Harmonic target map: measured F1–F3 landmarks are grey dotted horizontal references; colored trajectories show the actual harmonic targets; pale horizontal lines show a median-F0 harmonic grid for reference.
- Dynamic mode: colored target trajectories can move with stabilized F0. The pale reference grid remains based on median F0 and is therefore not the dynamic target itself.
- Stable-note mode: colored targets are fixed horizontal lines.
- Summary panel: reports engine, landmark count, lock amount, maximum shaping, target changes or fixed F0, energy-preservation state, peak and output-level action.
Notes & limitations
- The effect depends on reliable pitch estimation. Unpitched or strongly noisy material may be rejected, gated in Dynamic mode, or produce less meaningful targets.
- Formant landmarks are robust file-level statistics, not continuously tracked trajectories. This is deliberate: F0 may move dynamically while the estimated envelope landmarks remain stable.
- In Dynamic mode, rapid F0 motion is limited by the roughly 50 Hz update rate and the 40–80 ms analysis grains.
- Stable-note mode deliberately applies one fixed spectral curve over the entire sound. Its weak/unvoiced gate control is therefore inactive.
- Preserve frame energy preserves spectral energy, not peak amplitude. Peaks can still rise after spectral reshaping or overlap-add reconstruction.
- Strong shaping can emphasize narrow spectral regions substantially even when total frame energy is preserved. Use the output-level stage as needed.
- Dynamic and Stable modes can sound different even with the same median F0 because one is local WOLA processing and the other is a single whole-file FFT transformation.
Further Reading
- Praat Manual — FormantPath. Describes FormantPath as a path through alternative Formant analyses and the role of differing analysis ceilings.
- Praat Manual — Sound: To FormantPath (burg).... Documents the Burg-based FormantPath analysis used for the landmarks.
- Praat Manual — Sound: To Pitch (raw cross-correlation).... Current documentation for the cross-correlation pitch-analysis family used by the script.
- Praat Manual — Sound: To Spectrum.... Documents Praat’s complex Spectrum representation, Fourier transform, and Spectrum-to-Sound reconstruction.
- Fant, G. (1960). Acoustic Theory of Speech Production. Mouton. Background on source–filter organization and formant acoustics; the present processor deliberately couples spectral-envelope regions to source harmonics as a creative transformation.