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.
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.
Signal flow
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:
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.
| Preset | Algorithm | Overrides |
|---|---|---|
| Direct: Subtle | Direct | Pitch 0.9–1.1; amplitude 0.8–1.0; duration 0.95–1.05 |
| Direct: Wide Range | Direct | Pitch 0.5–1.5; amplitude 0.3–1.0; duration 0.7–1.3 |
| Direct: Pitch Focus | Direct | Pitch 0.6–1.6; amplitude 0.9–1.0; duration 0.95–1.05 |
| Reverse: Classic | Reverse | Pitch 0.7–1.3; duration 0.8–1.2 |
| Reverse: Dramatic | Reverse | Pitch 0.5–1.5; duration 0.6–1.4 |
| Dispersion Stretch: Moderate | Dispersion | Threshold 0.50; stretch 0.7–2.0× |
| Dispersion Stretch: Extreme | Dispersion | Threshold 0.40; stretch 0.5–4.0× |
| Stable Stretch: Sparse | Stable | Region 0.15 s; similarity threshold 0.20; minimum gap 0.15 s |
| Stable Stretch: Dense | Stable | Region 0.20 s; similarity threshold 0.40; minimum gap 0.10 s |
| Control Scramble: Subtle | Scramble | Window 5 frames; pitch 0.8–1.2; duration 0.9–1.1 |
| Control Scramble: Wild | Scramble | Window 30 frames; pitch 0.6–1.4; duration 0.7–1.3 |
Parameters
Custom algorithm controls
| Control | Default | Used by | Meaning |
|---|---|---|---|
| Algorithm | Direct Control | Custom | Selects one of the five transformation strategies. |
| Pitch range | 0.6 | Direct | Creates a pitch-factor range of 1−range to 1+range. Internally clamped to 0…0.95. |
| Duration range | 0.3 | Direct | Creates a duration-factor range of 1−range to 1+range. Internally clamped to 0…0.95. |
| Dispersion threshold | 0.5 | Dispersion Stretch | Split point on the normalized C1–C6 dispersion curve; internally constrained to approximately 0…1. |
| Max stretch factor | 2.0 | Dispersion Stretch | Maximum DurationTier factor; values below 1 are forced to 1. Custom minimum stretch is fixed at 0.5. |
| Stable hold duration | 0.2 s | Stable Stretch | Length, in source time, of each region held at a 5× duration factor. |
| Min stable gap | 0.1 s | Stable Stretch | Minimum separation used when selecting stable candidates. |
| Control scramble window | 10 frames | Scramble | Local random-selection window; internally forced to at least one frame. |
Performance
| Speed mode | Working sample rate | Behavior |
|---|---|---|
| Full Quality | Source rate | No speed-mode resampling. |
| Balanced | 22.05 kHz when source rate is higher | Downsamples before MFCC analysis/resynthesis, then returns the result to the original sample rate. |
| Fast | 11.025 kHz when source rate is higher | Same workflow at the lower working rate. |
Output level
| Mode | Behavior |
|---|---|
| Natural level | Stores 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 normalize | For 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
| Property | Behavior |
|---|---|
| Selection | Exactly one Sound; minimum duration 0.1 s. |
| Channels | The 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 rate | Full 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 time | The private working copy is shifted to 0 for analysis. The original xmin is restored on the final output. |
| Duration | May 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 domain | Praat 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. |
| Randomness | Only 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.
- Original / Transformed waveforms appear side by side.
- MFCC C1–C3 source features show the three raw coefficient trajectories used by Direct/Reverse/Scramble mappings.
- Direct, Reverse, and Scramble show the resulting PitchTier and DurationTier when those tiers contain points.
- Dispersion Stretch shows the normalized C1–C6 dispersion curve and its threshold.
- Stable Moment Stretch shows normalized frame distance; shaded regions indicate the accepted local stretch regions.
- The bottom summary strip reports speed mode, output-level action, processing time, MFCC frame count, and preset.
Further Reading
- Praat Manual: Sound: To MFCC... — the analysis command used by the script.
- Praat Manual: MelSpectrogram: To MFCC... — defines the discrete-cosine-transform relation used to obtain the cepstral coefficients.
- Praat Manual: Manipulation and Get resynthesis (overlap-add) — the pitch/duration resynthesis framework used here.
- Praat Manual: DurationTier — interpretation of the relative-duration factors used by all duration-changing modes.
- Davis, S. B., & Mermelstein, P. (1980). “Comparison of Parametric Representations for Monosyllabic Word Recognition in Continuously Spoken Sentences.” IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(4), 357–366. doi:10.1109/TASSP.1980.1163420.