Pitch Correction — User Guide
Scale-aware pitch quantization with adjustable correction strength, optional transposition, a natural stylization preset, and a flat Robot / Monotone mode.
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.
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
- Select exactly one Sound object in Praat.
- Run
Pitch_Correction.praat. - Choose a preset: Custom, Natural Correction, Hard Auto-Tune, or Robot / Monotone.
- Choose the musical root and scale.
- Optionally set Transpose_semitones.
- For Custom, set Strength_percent. A value of 0 keeps the original pitch trajectory; 100 moves each point fully to its target.
- Set the pitch-analysis time step and F0 range to suit the source.
- Choose whether to draw the visualization and play the result.
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.
| Preset | Strength | Stylization | Behavior |
|---|---|---|---|
| Custom | Uses Strength_percent | None | Direct scale quantization with user-controlled strength. |
| Natural Correction | 60% | Stylize: 2.0 Hz on the working tier | The stylized tier is used when choosing target notes; final interpolation still begins from the original F0 point. |
| Hard Auto-Tune | 100% | None | Each voiced point moves fully to the nearest allowed scale note, plus any requested transposition. |
| Robot / Monotone | 100% | None | Computes 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. |
Scales and quantization
The selected root rotates a 12-note pitch-class mask. The script supports ten scale types:
| Scale | Intervals from root (semitones) |
|---|---|
| Chromatic | 0, 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 Major | 0, 2, 4, 7, 9 |
| Pentatonic Minor | 0, 3, 5, 7, 10 |
| Dorian | 0, 2, 3, 5, 7, 9, 10 |
| Phrygian | 0, 1, 3, 5, 7, 8, 10 |
| Lydian | 0, 2, 4, 6, 7, 9, 11 |
| Mixolydian | 0, 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.
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
| Parameter | Default | Description |
|---|---|---|
| Preset | Custom | Selects one of four correction behaviors. |
| Root_Note | C | Root pitch class for the scale mask. |
| Scale_Type | Major (Ionian) | Allowed pitch classes for quantization. |
| Transpose_semitones | 0 | Integer semitone transposition applied to the selected target note. |
| Strength_percent | 100 | Custom correction strength. Valid range 0–100. Natural, Hard, and Robot presets replace this internally with their preset values. |
| Pitch_time_step | 0.01 s | Time step used by Praat Manipulation/pitch analysis. |
| Min_pitch | 75 Hz | Lower analysis bound; must be positive. |
| Max_pitch | 600 Hz | Upper analysis bound; must exceed Min_pitch and remain below 45% of the source sample rate. |
| Draw_visualization | Yes | Draw the correction summary in the Picture window. |
| Play_result | Yes | Play the final Sound after processing. |
Processing pipeline
- Input validation. Exactly one Sound is required. Duration, strength, pitch-analysis range, and Nyquist-related limits are checked.
- Mono analysis reference. Multichannel input is converted to mono for F0 analysis only; mono input is copied.
- Original PitchTier. A Manipulation object is created and its PitchTier is retained unchanged for correction calculations and visualization.
- Optional Natural stylization. A copy of the tier is stylized at 2 Hz and used only for target-note selection.
- 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.
- Strength interpolation. The original F0 is moved toward the target in log-frequency space.
- Synthesis safety. Final target points are limited independently of the analysis range to 20 Hz through
0.45 × sample rate. - Per-channel resynthesis. Each original channel receives the same corrected PitchTier in its own Praat Manipulation object and is resynthesized with overlap-add.
- Channel reconstruction. The processed channels are rebuilt into a Sound with the original channel count and source time domain.
- 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
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
- Name:
<source>_<root><scale>_<preset>, for example a C-major Natural run uses the corresponding root, scale, and preset labels. - Channels: original channel count preserved.
- Duration and time domain: preserved, including nonzero Sound start times.
- Sample rate: preserved.
- Unvoiced material: no new PitchTier points are created where the analysis provides no voiced F0; overlap-add resynthesis retains the non-pitched portions of the source.
- Peak handling: attenuation-only ceiling at 0.95; this is not target normalization.
- Randomness: none.
Visualization
When Draw_visualization is enabled, the Picture window shows:
- Pitch correction panel — original F0 in grey, corrected F0 in blue, and horizontal pitch-grid lines for chromatic notes. Green grid lines indicate notes belonging to the selected scale.
- Original waveform and corrected waveform in separate lower panels.
- Scale pattern — a 12-cell chromatic row beginning from the chosen root; in-scale pitch classes are highlighted.
- Run summary — preset, key, strength, Natural stylization amount, transpose, pitch-analysis settings, pitch-point counts, output RMS, duration, and sample rate.
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.