Pitch Correction — User Guide

Scale-aware pitch quantization with adjustable correction strength, optional transposition, a natural stylization preset, and a flat Robot / Monotone mode.

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

What this does

Pitch Correction analyzes the F0 contour of one selected Sound, chooses the nearest allowed note in a user-selected scale, and builds a corrected PitchTier. Correction strength is applied in log-frequency space, so partial correction represents a proportional movement in musical interval rather than a linear change in Hz.

Core signal path: mono pitch analysis → scale-note target selection → log-frequency interpolation by Strength → optional semitone transposition of the target → synthesis-safe pitch limiting → per-channel Praat Manipulation resynthesis.

The pitch analysis is performed on a mono reference. For multichannel input, the same corrected PitchTier is then applied independently to every original channel, preserving the original channel count.

Quick start

  1. Select exactly one Sound object in Praat.
  2. Run Pitch_Correction.praat.
  3. Choose a preset: Custom, Natural Correction, Hard Auto-Tune, or Robot / Monotone.
  4. Choose the musical root and scale.
  5. Optionally set Transpose_semitones.
  6. For Custom, set Strength_percent. A value of 0 keeps the original pitch trajectory; 100 moves each point fully to its target.
  7. Set the pitch-analysis time step and F0 range to suit the source.
  8. Choose whether to draw the visualization and play the result.
Source material: The correction stage depends on reliable F0 analysis and is therefore most predictable on monophonic pitched material such as voice or solo instruments. If no usable voiced pitch is detected in the selected analysis range, the script stops without creating an output.

Presets

Presets modify only the internal correction behavior shown below. Root, scale, transpose, pitch-analysis settings, visualization, and playback remain as chosen in the form.

PresetStrengthStylizationBehavior
CustomUses Strength_percentNoneDirect scale quantization with user-controlled strength.
Natural Correction60%Stylize: 2.0 Hz on the working tierThe stylized tier is used when choosing target notes; final interpolation still begins from the original F0 point.
Hard Auto-Tune100%NoneEach voiced point moves fully to the nearest allowed scale note, plus any requested transposition.
Robot / Monotone100%NoneComputes the geometric mean of the source PitchTier, quantizes that single reference to the selected scale, and uses the resulting pitch as one flat target across all voiced points.
Natural Correction is not a separate vibrato-removal stage. Its 2 Hz PitchTier stylization influences which scale note is chosen. The final 60% correction is still interpolated from the original, unstylized F0 toward that target.

Scales and quantization

The selected root rotates a 12-note pitch-class mask. The script supports ten scale types:

ScaleIntervals from root (semitones)
Chromatic0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Major (Ionian)0, 2, 4, 5, 7, 9, 11
Minor (Natural)0, 2, 3, 5, 7, 8, 10
Minor (Harmonic)0, 2, 3, 5, 7, 8, 11
Pentatonic Major0, 2, 4, 7, 9
Pentatonic Minor0, 3, 5, 7, 10
Dorian0, 2, 3, 5, 7, 9, 10
Phrygian0, 1, 3, 5, 7, 8, 10
Lydian0, 2, 4, 6, 7, 9, 11
Mixolydian0, 2, 4, 5, 7, 9, 10

Nearest-note selection

For each voiced point, the working F0 is converted to a floating MIDI value. The script searches nearby MIDI notes and selects the nearest note whose pitch class belongs to the chosen scale. The search covers ±6 semitones around the rounded MIDI note, which is sufficient to find a member of every available scale.

Scale target
workF0 → floating MIDI → nearest allowed scale MIDI → target F0

If Transpose_semitones ≠ 0:
target F0 ← target F0 × 2^(Transpose_semitones/12)

Transposition therefore acts on the chosen target note. With nonzero transpose, the final target is a transposed version of the selected scale tone; it is not re-quantized to the original scale afterward.

Parameters

ParameterDefaultDescription
PresetCustomSelects one of four correction behaviors.
Root_NoteCRoot pitch class for the scale mask.
Scale_TypeMajor (Ionian)Allowed pitch classes for quantization.
Transpose_semitones0Integer semitone transposition applied to the selected target note.
Strength_percent100Custom correction strength. Valid range 0–100. Natural, Hard, and Robot presets replace this internally with their preset values.
Pitch_time_step0.01 sTime step used by Praat Manipulation/pitch analysis.
Min_pitch75 HzLower analysis bound; must be positive.
Max_pitch600 HzUpper analysis bound; must exceed Min_pitch and remain below 45% of the source sample rate.
Draw_visualizationYesDraw the correction summary in the Picture window.
Play_resultYesPlay the final Sound after processing.

Processing pipeline

  1. Input validation. Exactly one Sound is required. Duration, strength, pitch-analysis range, and Nyquist-related limits are checked.
  2. Mono analysis reference. Multichannel input is converted to mono for F0 analysis only; mono input is copied.
  3. Original PitchTier. A Manipulation object is created and its PitchTier is retained unchanged for correction calculations and visualization.
  4. Optional Natural stylization. A copy of the tier is stylized at 2 Hz and used only for target-note selection.
  5. Target calculation. Each voiced point is quantized to the nearest allowed scale note. Robot mode instead calculates one flat scale-quantized target from the geometric mean of all valid original PitchTier points.
  6. Strength interpolation. The original F0 is moved toward the target in log-frequency space.
  7. Synthesis safety. Final target points are limited independently of the analysis range to 20 Hz through 0.45 × sample rate.
  8. Per-channel resynthesis. Each original channel receives the same corrected PitchTier in its own Praat Manipulation object and is resynthesized with overlap-add.
  9. Channel reconstruction. The processed channels are rebuilt into a Sound with the original channel count and source time domain.
  10. Peak safety. If the final absolute peak exceeds 0.95, the output is scaled down to 0.95. Quieter output is not raised.

Correction strength

orig_c = 1200 × log2(original F0)
target_c = 1200 × log2(target F0)
final_c = orig_c + (target_c − orig_c) × Strength/100
final F0 = 2^(final_c/1200)

This makes the interpolation musically uniform: 50% means halfway through the interval in cents, not halfway through the numeric Hz difference.

Output behavior

Analysis bounds vs synthesis bounds: Min_pitch and Max_pitch control F0 analysis. They are not the final correction limits. Corrected targets use a separate synthesis-safe range of 20 Hz to 45% of the sampling frequency.

Visualization

When Draw_visualization is enabled, the Picture window shows:

The pitch plot is decimated to at most 500 stored display positions. It is based on the original and generated PitchTier values used by the processor; it is not a separate re-analysis of the final resynthesized Sound.