MFCC Transformer — User Guide

MFCC-derived control mapping for pitch, amplitude, and duration: spectral descriptors from the source drive five offline transformation strategies implemented with Praat Manipulation and overlap-add resynthesis.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 2.4.1 (2026) Application: Praat scripting language
Contents:

What this does

MFCC Transformer analyzes the changing spectral shape of a sound with Mel-Frequency Cepstral Coefficients (MFCCs), then uses selected coefficient trajectories as control signals for time-domain transformation. The MFCCs determine how pitch, amplitude, or local duration should change; the original audio remains the material that is resynthesized.

The tool offers five strategies. Direct Control maps three MFCC trajectories to pitch, amplitude, and duration. Reverse Control reads selected control trajectories backward in time. MFCC Dispersion Stretch converts the spread of the first six coefficients into a duration curve. Stable Moment Stretch lengthens regions where successive MFCC frames are similar. MFCC Control Scramble locally reorders coefficient frames before mapping them to pitch and duration.

MFCCs as compositional controllers. Praat represents MFCCs as cepstral coefficients derived from a MelSpectrogram. In this script the stored coefficient rows C1, C2, C3, and C1–C6 are treated as numerical descriptors. Their mappings are deliberately compositional: for example, C1 is assigned to pitch in Direct Control because the script chooses that mapping, not because C1 is inherently a pitch coefficient.

Signal flow

1. Copy the selected Sound and shift the working copy to t = 0 2. If the source has more than one channel, downmix the working copy to mono 3. Optional speed-mode downsampling: 22.05 kHz or 11.025 kHz 4. Analyze 12 MFCC coefficients (15 ms window, 5 ms time step) 5. Derive algorithm-specific control trajectories from the MFCC matrix 6. Create a Praat Manipulation object (10 ms step, pitch range 75–600 Hz) 7. Replace PitchTier and/or DurationTier; Direct Control also applies an AmplitudeTier by Formula 8. Resynthesize with overlap-add 9. If speed-mode downsampling occurred, resample back to the source sample rate 10. Apply the selected output-level mode 11. Restore the original Sound start time and name the output

The MFCC object is used for analysis and control generation. The script does not reconstruct a MelSpectrogram from altered MFCCs and does not synthesize a new spectral envelope directly from the coefficients.

Five algorithms

1. Direct Control

The first three stored MFCC trajectories are normalized independently across the file and mapped to three controls:

  • C1 → pitch factor. The detected source pitch is multiplied by a factor between the selected minimum and maximum. Resulting pitch targets are clamped to 50–800 Hz.
  • C2 → amplitude factor. A time-varying AmplitudeTier is evaluated directly in a Sound Formula. Custom mode uses 0.5–1.0; Direct presets can override this range.
  • C3 → duration factor. Values are written to the Manipulation DurationTier and therefore change local timing.

Pitch modulation is applied only where Praat has a defined pitch value in the Manipulation analysis. Duration and amplitude controls continue independently of that voiced/unvoiced decision.

2. Reverse Control

C1 and C3 are normalized, then read in reverse frame order while being applied to the source in forward time. Reversed C1 controls pitch and reversed C3 controls duration. The audio waveform itself is not reversed.

This mode does not use C2 for amplitude control.

3. MFCC Dispersion Stretch

For every MFCC frame, the script computes the mean of C1–C6 and then a spread descriptor:

dispersion = sqrt( Σ (Cj − mean(C1…C6))² ), j = 1…6

The descriptor is normalized over the file. Values below Dispersion threshold map between the minimum stretch factor and 1.0; values above the threshold map between 1.0 and Max stretch factor. The result controls only the DurationTier.

This is an artistic MFCC dispersion descriptor defined by the script, not a standardized acoustic “complexity” measure.

4. Stable Moment Stretch

The script calculates Euclidean frame-to-frame distance across C1–C6, normalizes those distances by the maximum observed distance, and identifies frames below a similarity threshold as stable candidates. Candidate regions are separated by a minimum gap.

At each accepted location, the DurationTier rises from 1.0 to 5.0×, remains at 5.0 for the selected source-time region, and returns to 1.0 with 10 ms transitions. This creates a local hold/stretch around stable MFCC moments; it does not freeze or repeat an MFCC spectral frame.

In Custom mode the similarity threshold is fixed at 0.30. The Sparse and Dense presets override it.

5. MFCC Control Scramble

For each output control frame, the script randomly chooses a source MFCC frame from a local window centered on the current frame. C1–C3 are copied from that selected frame and renormalized; C1 then controls pitch and C3 controls duration.

Control scramble is stochastic. The script exposes no random-seed parameter, so repeated runs with the same settings can produce different control trajectories and different audio.

Presets

There are 11 named presets plus Custom. A named preset selects its algorithm and overrides the parameters listed below; controls that are irrelevant to that algorithm do not participate in the result.

PresetAlgorithmOverrides
Direct: SubtleDirectPitch 0.9–1.1; amplitude 0.8–1.0; duration 0.95–1.05
Direct: Wide RangeDirectPitch 0.5–1.5; amplitude 0.3–1.0; duration 0.7–1.3
Direct: Pitch FocusDirectPitch 0.6–1.6; amplitude 0.9–1.0; duration 0.95–1.05
Reverse: ClassicReversePitch 0.7–1.3; duration 0.8–1.2
Reverse: DramaticReversePitch 0.5–1.5; duration 0.6–1.4
Dispersion Stretch: ModerateDispersionThreshold 0.50; stretch 0.7–2.0×
Dispersion Stretch: ExtremeDispersionThreshold 0.40; stretch 0.5–4.0×
Stable Stretch: SparseStableRegion 0.15 s; similarity threshold 0.20; minimum gap 0.15 s
Stable Stretch: DenseStableRegion 0.20 s; similarity threshold 0.40; minimum gap 0.10 s
Control Scramble: SubtleScrambleWindow 5 frames; pitch 0.8–1.2; duration 0.9–1.1
Control Scramble: WildScrambleWindow 30 frames; pitch 0.6–1.4; duration 0.7–1.3

Parameters

Custom algorithm controls

ControlDefaultUsed byMeaning
AlgorithmDirect ControlCustomSelects one of the five transformation strategies.
Pitch range0.6DirectCreates a pitch-factor range of 1−range to 1+range. Internally clamped to 0…0.95.
Duration range0.3DirectCreates a duration-factor range of 1−range to 1+range. Internally clamped to 0…0.95.
Dispersion threshold0.5Dispersion StretchSplit point on the normalized C1–C6 dispersion curve; internally constrained to approximately 0…1.
Max stretch factor2.0Dispersion StretchMaximum DurationTier factor; values below 1 are forced to 1. Custom minimum stretch is fixed at 0.5.
Stable hold duration0.2 sStable StretchLength, in source time, of each region held at a 5× duration factor.
Min stable gap0.1 sStable StretchMinimum separation used when selecting stable candidates.
Control scramble window10 framesScrambleLocal random-selection window; internally forced to at least one frame.

Performance

Speed modeWorking sample rateBehavior
Full QualitySource rateNo speed-mode resampling.
Balanced22.05 kHz when source rate is higherDownsamples before MFCC analysis/resynthesis, then returns the result to the original sample rate.
Fast11.025 kHz when source rate is higherSame workflow at the lower working rate.
Speed mode changes bandwidth as well as computation time. When downsampling occurs, frequencies above the working Nyquist limit are removed before transformation. Resampling the result back to the original sample rate does not restore that discarded high-frequency content.

Output level

ModeBehavior
Natural levelStores the raw post-resynthesis level. Peaks above 1.0 are allowed; the Info window warns when this occurs.
Safety ceiling (attenuate only)Default. If the final peak exceeds Ceiling_peak, the entire Sound is attenuated so the peak reaches the ceiling. Quieter outputs are untouched.
Peak normalizeFor any non-silent output, scales the peak to Ceiling_peak.

Ceiling peak defaults to 0.99 and must be greater than 0 and at most 1. The level stage runs after final resampling because both PSOLA and resampling can create peaks higher than the source peak.

If Natural level produces a stored peak above 1.0 and Play result is enabled, playback uses a temporary safely scaled copy. The stored output Sound remains at its natural level.

Input & output behavior

PropertyBehavior
SelectionExactly one Sound; minimum duration 0.1 s.
ChannelsThe processing path is explicitly mono. Any input with more than one channel is downmixed to mono before MFCC analysis and PSOLA resynthesis; the output is mono.
Sample rateFull Quality preserves the source rate. Balanced/Fast temporarily downsample only when the source rate exceeds their target rate, then resample the output back to the original rate.
Start timeThe private working copy is shifted to 0 for analysis. The original xmin is restored on the final output.
DurationMay change whenever a DurationTier is used. All five algorithms can affect duration except only to the extent specified by their control curve; Stable Moment Stretch deliberately creates local 5× regions.
Pitch-analysis domainPraat Manipulation is created with a 10 ms time step and a fixed 75–600 Hz pitch range. Pitch-target changes therefore depend on successful pitch analysis in that range.
Output name<source>_DirectControl, _Reversed, _MFCCDispersionStretch, _StableMomentStretch, or _MFCCControlScramble.
RandomnessOnly MFCC Control Scramble uses random selection. There is no seed control, so this mode is not repeatable run-to-run.

Visualization

When Draw visualization is enabled, the script draws an 8-inch Praat AudioTools page. The drawing is diagnostic; enabling or disabling it does not alter the audio processing.

The MFCC graph is an analysis/control display. It should not be read as a reconstructed spectrum or as a direct visualization of the output spectral envelope.

Further Reading