Pitch Shift (Semitones) — User Guide

Duration-preserving musical transposition by a fixed number of semitones, with interval presets, multichannel processing, peak protection, and visual comparison.

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

What this does

Pitch Shift (Semitones) transposes a selected Sound by a fixed musical interval while restoring the source duration. Positive values shift upward, negative values shift downward, and zero semitones produces an exact identity copy.

The non-zero path combines a temporary sampling-frequency override with Praat Manipulation resynthesis. The metadata change creates the requested pitch ratio and changes duration; a constant DurationTier then compensates for that duration change through overlap-add resynthesis. The result is finally resampled back to the source sampling frequency.

Core relation:
pitch ratio = 2^(semitones / 12)
temporary sample rate = source sample rate × pitch ratio

Quick start

  1. Select exactly one Sound object in Praat.
  2. Run Pitch_Shift_Semitones.praat.
  3. Choose an interval preset, or select Custom and enter a value in Semitones.
  4. Choose whether to draw the visualization and play the result.
  5. Click OK. The processed Sound remains selected when the script finishes.

Custom shifts are accepted from −48 to +48 semitones, subject to the temporary sampling-frequency and pitch-analysis safety checks described below.

Interval presets

The preset menu contains 15 fixed musical intervals plus Custom. A fixed preset overrides the numeric Semitones field.

PresetSemitonesOutput suffix
Minor 2nd+1m2
Major 2nd+2M2
Minor 3rd+3m3
Major 3rd+4M3
Perfect 4th+5P4
Tritone+6TT
Perfect 5th+7P5
Minor 6th+8m6
Major 6th+9M6
Minor 7th+10m7
Major 7th+11M7
Octave Up+128ve+
Octave Down−128ve-
Perfect 5th Down−7P5-
Major 3rd Down−4M3-
CustomUser valueNumeric value, with + for zero/positive values

Processing method

Non-zero shifts

  1. The requested semitone value is converted to the ratio 2^(ST/12).
  2. Each source channel is processed independently.
  3. The channel's sampling-frequency metadata is temporarily changed to fs × ratio. This creates the pitch shift but also changes the Sound duration.
  4. A Praat Manipulation object is created on the temporarily shifted Sound.
  5. A constant DurationTier with value equal to the pitch ratio is added at the actual start and end times of the shifted channel. Overlap-add resynthesis restores the original duration while retaining the transposition.
  6. The channel is resampled to the original source sampling frequency with precision 50.
  7. All processed channels are copied into a new Sound with the original time domain, sampling frequency, and channel count.

Adaptive Manipulation range

The base analysis range is 40 Hz to min(1200 Hz, 0.45 × source sample rate). Both bounds are multiplied by the pitch ratio because Manipulation is created after the temporary sampling-frequency override. The lower bound is not allowed below 20 Hz, and the upper bound is limited to 0.45 × temporary sample rate.

The script also rejects a requested shift if the temporary sampling frequency would fall outside 1000–384000 Hz, or if no valid Manipulation range remains.

Zero-semitone identity

If the requested shift is effectively zero, processing is bypassed completely. The script makes an exact copy of the source: there is no sampling-frequency override, Manipulation object, resampling, or peak scaling.

Parameters

ParameterDefaultMeaning
PresetCustomSelects one of the fixed musical intervals or uses the custom Semitones value.
Semitones0Custom transposition in semitones. Valid range: −48 to +48. Fractional values are allowed.
Draw_visualizationYesDraws the original/result comparison, spectrograms, interval ruler, and summary.
Play_resultYesPlays the final Sound after processing.

Output behavior

Visualization

When Draw_visualization is enabled, the Picture window uses one semantic direction color for the current state: blue for upward shifts, warm red for downward shifts, and a distinct neutral identity color for zero semitones.

For a zero-semitone run, both waveform panels show the same signal and the summary explicitly reports IDENTITY and PSOLA bypass.