Adaptive Pitch Shifter – User Guide
Adaptive pitch transformation driven by amplitude, detected pitch contour, a sinusoidal LFO, or a combined amplitude/LFO signal.
What this does
The script modifies the pitch tier of a Praat Manipulation object. At each voiced pitch-tier point, it derives a bipolar modulation signal, optionally smooths that signal, combines it with a base pitch multiplier, writes the resulting frequency back to the pitch tier, and resynthesizes the sound.
The modulation source can follow the sound's measured intensity, its detected pitch contour, a sine-wave LFO, or the average of amplitude modulation and the LFO. The source-dependent modulation is centred around zero, so Base_pitch_shift acts as the centre of the pitch multiplier.
Quick start
- Select exactly one Sound object in Praat.
- Run
Adaptive_Pitch_Shifter.praat. - Choose Custom or one of the six named presets.
- Set the processing, quality, visualization, and playback options.
- Click OK. The output Sound remains selected when processing finishes.
Presets
The menu contains Custom plus six named presets. A named preset overwrites only Base_pitch_shift, Modulation_amount, Modulation_source, LFO_frequency, and Smoothing_factor. The other form settings remain as entered by the user.
| Preset | Base | Amount | Source | LFO | Smoothing |
|---|---|---|---|---|---|
| Custom | form value | form value | form value | form value | form value |
| Subtle Wobble | 1.00 | 0.15 | Amplitude | 4.0 Hz | 0.20 |
| Robot Voice | 0.80 | 0.80 | Time-based LFO | 8.0 Hz | 0.05 |
| Harmonic Shimmer | 1.50 | 0.30 | Pitch Contour | 2.0 Hz | 0.30 |
| Deep Bass Mod | 0.50 | 1.00 | Combined | 1.5 Hz | 0.15 |
| Vibrato Effect | 1.00 | 0.08 | Time-based LFO | 5.5 Hz | 0.40 |
| Extreme Warp | 1.20 | 1.50 | Combined | 10.0 Hz | 0.00 |
LFO_frequency is used only by Time-based LFO and Combined. A stored LFO value therefore has no effect when the selected source is Amplitude or Pitch Contour.
Parameters
Pitch and modulation controls
| Parameter | Default | Current behavior |
|---|---|---|
| Preset | Custom | Selects manual control or applies one of the six parameter sets listed above. |
| Base_pitch_shift | 1.0 | Positive multiplier that forms the centre of the pitch-shift calculation. For example, 0.5 corresponds to one octave down and 2.0 to one octave up before modulation and safety limiting. |
| Modulation_amount | 0.5 | Positive amount added to or subtracted from the base multiplier according to the modulation signal. |
| Modulation_source | Amplitude | Chooses Amplitude, Pitch Contour, Time-based LFO, or Combined modulation. |
| LFO_frequency | 3.0 Hz | Frequency of the sine LFO. Used only by Time-based LFO and Combined. |
| Smoothing_factor | 0.1 | One-pole memory coefficient for the modulation signal; valid range 0–1. A value of 0 follows the raw modulation point by point. Increasing values retain more of the preceding modulation state. |
Processing and output controls
| Parameter | Default | Current behavior |
|---|---|---|
| Apply_formant_preservation | Yes | Yes selects Praat's Get resynthesis (LPC), a speech-oriented spectral-envelope/formant-preserving resynthesis path. No selects Get resynthesis (overlap-add). |
| Add_stereo_width | No | If the resynthesized output is mono, duplicates it to stereo and modifies the right channel with a 12 ms delayed component. If the resynthesized output already has more than one channel, this branch is skipped. |
| Output_gain | 1.0 | Final linear amplitude multiplier applied after resynthesis and optional widening. No peak normalization or limiter is applied afterwards. |
| Draw_visualization | Yes | Draws the analysis/processing summary in the Picture window when pitch points were stored. |
| Play_result | Yes | Plays the finished output after processing. |
Quality
Quality directly sets the analysis time step and pitch bounds used by the Manipulation analysis. The same time step and pitch floor are also used by the amplitude-envelope analysis; Pitch Contour additionally uses the corresponding pitch ceiling.
| Quality | Time step | Pitch floor | Pitch ceiling |
|---|---|---|---|
| Fast | 0.010 s | 75 Hz | 600 Hz |
| Standard | 0.005 s | 75 Hz | 600 Hz |
| High Quality | 0.001 s | 50 Hz | 800 Hz |
Modulation
The script computes a raw bipolar modulation value m at each voiced pitch-tier point.
Amplitude
Praat Intensity is measured across the input using the current quality time step and pitch floor. The script takes the minimum and maximum measured Intensity values over the sound and maps the value at each voiced point to approximately −1…+1:
normalized = clamp((Intensity(t) - Intensity_min) /
(Intensity_max - Intensity_min), 0, 1)
m_raw = 2 * normalized - 1
The Intensity object is in Praat's dB SPL scale. If the measured range collapses to a single value, the modulation at that point remains zero.
Pitch Contour
A separate Pitch analysis is measured over the input. Its detected minimum and maximum frequencies define the adaptive range:
normalized = clamp((Pitch(t) - Pitch_min) /
(Pitch_max - Pitch_min), 0, 1)
m_raw = 2 * normalized - 1
If the detected pitch range collapses to a single value, the modulation at that point remains zero.
Time-based LFO
m_raw = sin(2 * pi * LFO_frequency * time)
The sine wave is bipolar, so the base pitch multiplier is its centre.
Combined
Combined modulation averages the bipolar amplitude signal and the sine LFO:
m_raw = (amplitude_modulation + lfo) / 2
Smoothing
The first available modulation point is used directly. Each later voiced point is smoothed with a one-pole recurrence:
m = m_raw * (1 - Smoothing_factor)
+ previous_m * Smoothing_factor
The smoothing is applied to the modulation state before it is combined with the base pitch shift.
Pitch transformation
For each voiced pitch-tier point, the script converts the smoothed modulation into a multiplicative pitch factor:
pitchMultiplier = Base_pitch_shift
+ m * Modulation_amount
pitchMultiplier = max(0.05, pitchMultiplier)
newFrequency = originalFrequency * pitchMultiplier
newFrequency = clamp(newFrequency, 20, 2000) Hz
The 0.05 multiplier floor prevents a non-positive multiplier under strong negative modulation. The final 20–2000 Hz bounds are safety limits on written pitch-tier frequencies; they do not change the analysis bounds selected by Quality.
Resynthesis & stereo
Resynthesis path
| Apply_formant_preservation | Praat command | Behavior |
|---|---|---|
| Yes | Get resynthesis (LPC) | Uses LPC-based resynthesis so the changed pitch source is combined with a speech-oriented spectral-envelope model derived from the original signal. |
| No | Get resynthesis (overlap-add) | Uses Praat's overlap-add resynthesis from the original sound, pulses, and modified pitch tier. |
The script changes the pitch tier only; it does not add or modify a DurationTier.
Stereo width
When Add_stereo_width is enabled and the resynthesized Sound is mono, the mono result is duplicated to two channels. The left channel remains unchanged. The right channel becomes:
right = 0.85 * current
+ 0.15 * left delayed by 12 ms
The delay is converted to samples with the input sampling frequency. This widening stage is applied before Output_gain.
Visualization
When Draw_visualization is enabled, the script samples pitch/modulation points across the entire file for display. At most about 500 points are retained, using a regular stride through the complete pitch tier; this decimation affects only the visualization, not the pitch transformation.
The Picture output contains:
- Input waveform.
- Shifted waveform; for multichannel output, channels 1 and 2 are drawn separately.
- Pitch contour comparison on one shared frequency scale: original in grey and shifted in blue.
- Modulation signal using the actual displayed modulation range with a zero reference line.
- Output spectrogram; channel 1 is used when the output has more than one channel, and the upper frequency is
min(5000 Hz, Nyquist). - Summary strip with preset, base shift, source, amount, smoothing, pitch-point count, resynthesis path, stereo-width state, and LFO frequency when applicable.
The input and output waveform panels are drawn with their own automatic amplitude ranges, so their plotted heights are not a shared amplitude comparison.
Outputs
- Output object: one resynthesized Sound, left selected at the end of the script.
- Name pattern:
<source>_shifted_<preset-name>. - Preset suffixes: Custom, Subtle Wobble, Robot Voice, Harmonic Shimmer, Deep Bass, Vibrato, or Extreme Warp.
- Duration: pitch is modified without changing the DurationTier.
- Final level: the samples are multiplied by
Output_gain; there is no subsequent normalization. - Playback: controlled by
Play_result. - Picture output: controlled by
Draw_visualization.
The Info window reports the source, selected preset and modulation source, base shift, modulation amount, LFO frequency when applicable, creation progress, selected resynthesis method, output name, and final gain.