F0 Contour Manipulation — User Guide

Flip, expand, contract, or flatten a detected F0 contour while preserving the source duration and channel count.

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

What this does

The script analyses one selected Sound, derives a mono F0 reference, and creates a new target PitchTier on a fixed 10 ms control grid. Voiced F0 values can then be mirrored, expanded or contracted around a robust median-F0 centre, or replaced by a constant target. The resulting target contour is applied with Praat Manipulation and overlap-add resynthesis.

For multichannel input, pitch is analysed once from a mono reference. Each original channel is then resynthesized separately with the same target PitchTier and written back to the corresponding output channel. The original channel count is therefore preserved, although all channels share the same target F0 contour.

Quick start

  1. In Praat, select exactly one Sound object containing usable voiced or periodic material.
  2. Run flip or expand the F0 contours.praat.
  3. Choose a Preset, or leave Custom and select the desired Method.
  4. Set the pitch-analysis range so that Min_pitch and Max_pitch bracket the source F0.
  5. For Expand/Contract, set Expansion_factor. For Flatten, use Flatten_target_hz = 0 to use the detected median F0, or enter a fixed target frequency.
  6. Enable or disable Draw_visualization and Play_result, then click OK.

Methods

MethodTransformationMeaning
Flip F0 contournewF0 = centre² / sourceF0Mirrors log-frequency around the median-F0 centre. An interval above the centre becomes the same interval below it, and vice versa.
Expand/Contract F0newF0 = centre × (sourceF0 / centre)^factorScales interval distance from the median in logarithmic pitch space. factor > 1 expands the contour; 0 < factor < 1 contracts it; factor = 1 leaves voiced F0 unchanged.
Flatten F0newF0 = targetPitchReplaces every detected voiced control point with one constant F0. A target of 0 in the form means the detected median F0 is used.

Only times at which the pitch analysis returns a usable voiced F0 receive target points. The script does not invent F0 values for unvoiced regions.

Presets

PresetMethod / override
CustomUses the Method and parameter values currently entered in the form.
Flip (Mirror pitch)Sets Method to Flip.
Expand (More expressive)Sets Method to Expand/Contract and Expansion_factor = 1.5.
Contract (Less expressive)Sets Method to Expand/Contract and Expansion_factor = 0.5.
Flatten (Monotone)Sets Method to Flatten and Flatten_target_hz = 0, so the detected median is used.
Exaggerate (Strong expansion)Sets Method to Expand/Contract and Expansion_factor = 2.0.
Subtle ExpansionSets Method to Expand/Contract and Expansion_factor = 1.2.
High Voice FlattenSets Method to Flatten and Flatten_target_hz = 200 Hz.
Low Voice FlattenSets Method to Flatten and Flatten_target_hz = 100 Hz.

Presets override only the method-specific fields listed above. The pitch range, visualization and playback settings remain as entered by the user.

Parameters

ParameterDefaultDescription
PresetCustomSelects one of the built-in method configurations.
MethodFlip F0 contourChooses Flip, Expand/Contract, or Flatten when Preset is Custom.
Expansion_factor1.3Log-frequency interval scaling for Expand/Contract. Values above 1 expand; values between 0 and 1 contract.
Flatten_target_hz0Constant F0 for Flatten. 0 uses the detected median F0.
Min_pitch70 HzLower bound for Praat pitch analysis.
Max_pitch400 HzUpper bound for Praat pitch analysis. It must be above Min_pitch and below Nyquist.
Draw_visualizationYesDraws source/output waveforms, F0 comparison and summary information.
Play_resultYesPlays the processed Sound after completion.

Processing

  1. A mono analysis reference is created when the input has more than one channel.
  2. Praat pitch analysis runs at 10 ms with the user-supplied Min_pitch and Max_pitch.
  3. The reference centre is the median detected F0. If no usable pitch is detected, the script stops.
  4. A target PitchTier is sampled on a fixed 10 ms grid over the Sound's real xmin to xmax. Only voiced analysis points are transformed.
  5. Target F0 is constrained to 20 Hz through 0.45 × sample rate for sampling safety.
  6. Each original channel is converted to a Manipulation object, receives the same target PitchTier, and is resynthesized with Get resynthesis (overlap-add).
  7. The output is created directly at the original sample rate and with the original time domain and channel count.

Visualization

When Draw_visualization is enabled, the script draws:

The processed F0 shown in the plot is measured again from a mono display copy of the final output; it is therefore an analysis of the resynthesized result, not merely a drawing of the target PitchTier.

Output behavior

PropertyBehavior
Object name<source>_F0_<presetName>; for Custom, the suffix is _F0_Custom.
Duration / time domainPreserved from the input Sound.
Sample ratePreserved from the input Sound.
ChannelsOriginal channel count preserved. All channels use the same target F0 contour derived from the mono analysis reference.
Peak handlingAttenuate-only safety: if the absolute output peak exceeds 0.99, the Sound is scaled down to 0.99. Quieter outputs are not amplified.
Intermediate objectsRemoved automatically.