Chaotic Prosody Manipulation — User Guide

Creative PSOLA prosody transformation in which a newly generated F0 trajectory controls pitch while a Lorenz-derived envelope controls amplitude. The same control trajectories are applied across all channels while each channel is resynthesized independently.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.7 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

Chaotic Prosody Manipulation creates a new prosodic trajectory for a selected Sound. It first estimates the source's mean fundamental frequency, generates a replacement F0 contour, resynthesizes every channel with that same target pitch, then applies a Lorenz-derived amplitude multiplier, optional fade-out, Dry/Wet mixing, and attenuation-only peak safety.

Core idea: the source supplies the voice or sound material and a measured mean F0; the script supplies a new time-varying pitch target and amplitude trajectory. The resulting motion can be deterministic and chaotic (Logistic mode) or stochastic and mean-reverting (OU mode).

The generated F0 contour replaces the voiced pitch contour used by Praat's Manipulation resynthesis. It is therefore a global prosodic redesign around the measured mean F0 rather than a small modulation added to the original intonation.

Processing pipeline

Signal flow

Selected Sound ↓ zero-based working copy ↓ mean-F0 analysis (75–600 Hz) ↓ new global PitchTier at the effective control rate ↓ per-channel Praat Manipulation / overlap-add resynthesis ↓ Lorenz-derived step-held amplitude envelope ↓ optional fade-out ↓ Dry/Wet mix with the original working copy ↓ attenuation-only Safety peak ↓ restore original start time

The effective control rate is:

effective_rate = min(requested Control rate, 1000 Hz, sample_rate / 4)

This rate drives the pitch target and establishes the control interval used for Lorenz AM. If the requested rate is excessive, the script reports the clamped value in the Info window.

Pitch generation

Mean-F0 analysis

The script analyzes pitch from 75 to 600 Hz and uses the mean voiced F0 as the center of the new trajectory. For multichannel material it first analyzes a mono conversion. If that produces no valid mean F0, it tests individual channels in order and uses the first channel that yields a valid pitch estimate. If no channel yields a usable F0, the fallback center is 150 Hz.

The generated target itself is clamped to a broader safety range:

20 Hz ≤ target F0 ≤ min(1200 Hz, 0.8 × Nyquist)

Mode 1 — Logistic chaos

The deterministic mode iterates the logistic map from x = 0.5:

x[n+1] = r × x[n] × (1 − x[n])

The state is mapped multiplicatively around the measured mean F0:

factor = 1 + depth × (2x − 1)
target_F0 = mean_F0 × factor

Logistic r controls the map's behavior; Logistic depth controls how far the generated F0 can move around the measured center before safety clamping. Because no random numbers are used in this mode, identical input and settings produce the same target trajectory.

Mode 2 — Ornstein–Uhlenbeck drift

The stochastic mode generates a mean-reverting F0 path around the measured mean. For OU theta > 0, the script uses the exact discrete-time mean-reverting update rather than a simple Euler step:

decay = exp(−theta × dt)
variance = (1 − exp(−2 × theta × dt)) / (2 × theta)
F0[n+1] = mean_F0 + (F0[n] − mean_F0) × decay + sigma × sqrt(variance) × N(0,1)

When OU theta = 0, the update becomes a Brownian increment sigma × sqrt(dt) × N(0,1). OU sigma sets the stochastic spread.

Random seed applies only to OU mode. A positive seed makes the OU trajectory reproducible. A seed of 0 uses Praat's unpredictable random state. Logistic mode is deterministic and does not use the random seed.

Per-channel PSOLA resynthesis

One global target PitchTier is created, then each source channel is extracted and resynthesized independently with Praat's Manipulation → overlap-add process. This preserves the input channel count while ensuring that every channel follows the same generated F0 trajectory.

Lorenz-derived amplitude control

After pitch resynthesis, the wet signal can be multiplied by a deterministic amplitude trajectory generated from the Lorenz system:

dx/dt = sigma × (y − x)
dy/dt = x × (rho − z) − y
dz/dt = x × y − beta × z

The state begins at x = y = z = 1. The script integrates the system with an RK2 midpoint method. Integration is subdivided so that each numerical substep is no longer than approximately 5 ms, independently of the user control rate.

From Lorenz Z to amplitude

z_norm = clamp((z − 20) / 30, 0, 1)
smoothed = smoothing × previous + (1 − smoothing) × z_norm
AM = max(0, 1 + Lorenz_scale × (smoothed − 0.5))

AM smoothing is therefore a one-pole smoothing coefficient: values closer to 1 produce slower, smoother amplitude movement. The AM values are calculated at control rate and held constant between control updates when applied to the audio.

Lorenz scale = 0 gives a unity Lorenz multiplier. If visualization is also off, the Lorenz integration itself is skipped. The separate Fade-out control can still shape the wet signal at the end.

Fade-out

If Fadeout duration is greater than zero, a linear multiplier is applied over the end of the wet path. The requested duration is automatically limited to the Sound duration.

Dry/Wet mix and output safety

After pitch and amplitude processing, the wet path is mixed with the untouched zero-based working copy:

output = wet × (Dry/Wet / 100) + dry × (1 − Dry/Wet / 100)

Exact 0% bypass

At Dry/Wet = 0%, the output object is copied directly from the original working Sound. No wet signal, fade, or safety attenuation enters the final audio.

Safety peak

Safety peak is an attenuation ceiling, not target normalization. When the mixed output peak exceeds the requested value, the entire result is scaled downward just enough to meet the ceiling. If the signal is already below the threshold, its level is left unchanged. A value of 0 disables this safety stage.

Presets

Presets set the principal pitch/chaos and Lorenz-character parameters. Controls not listed for a preset retain the values currently entered in the form, including Control rate, Fade-out, Dry/Wet, Safety peak, visualization, and playback.

PresetPitchPitch settingsLorenz / AM settings
CustomForm selectionUses all values entered in the formUses all values entered in the form
Gentle ChaosLogisticr = 3.70; depth = 0.15scale = 0.30; smoothing = 0.92
Classic LorenzLogisticr = 3.90; depth = 0.25sigma = 10; rho = 28; beta = 2.667; scale = 0.50; smoothing = 0.85
Wild LogisticLogisticr = 3.99; depth = 0.50scale = 0.70; smoothing = 0.75
Stochastic DriftOUtheta = 1.00; sigma = 30.0scale = 0.40; smoothing = 0.90
Extreme ButterflyLogisticr = 3.95; depth = 0.45sigma = 12; rho = 35; scale = 0.80; smoothing = 0.70; beta retains the entered value

Parameters

ParameterDefaultImplemented behavior
PresetCustomSelects one of five parameter sets or leaves all form values unchanged.
Pitch modeLogisticDeterministic logistic F0 target or stochastic OU target.
Control rate100 HzRequested trajectory update rate; effectively limited to 1000 Hz and sample_rate/4.
Logistic r3.9Logistic-map coefficient; validated to >0 and ≤4.
Logistic depth0.35Multiplicative F0 excursion around the measured mean; must be ≥0.
OU theta1.5Mean-reversion rate; 0 changes the process to Brownian drift.
OU sigma20Stochastic F0 spread.
Random seed0OU only. 0 = unpredictable; positive value = repeatable trajectory.
Lorenz sigma / rho / beta10 / 28 / 2.667Parameters of the Lorenz control system; each must be >0.
Lorenz scale0.6Depth of AM around unity; 0 disables Lorenz AM.
AM smoothing0.85One-pole smoothing coefficient in the range 0…1.
Fadeout duration0.5 sLinear end fade applied to the wet path; automatically limited to total duration.
Dry/Wet100%Linear wet/dry blend; 0% is exact audio bypass.
Safety peak0.99Downward-only peak ceiling; 0 disables it.
Draw visualizationOnDraws the AudioTools process figure.
Play resultOnPlays the finished Sound.

Channels, duration, and timing

Visualization

The v0.7 figure shows the actual control trajectories used by the processor together with measured input/output waveforms.

Input and Output

The first two panels show mono display copies of the original and processed Sound. These copies are for visualization only; the audio result itself retains its original channel count.

Target F0

The pitch panel plots the generated target stored for display, with the measured mean F0 shown as a dotted reference line. It represents the replacement pitch trajectory sent to the channel-by-channel Manipulation resynthesis.

Lorenz XY projection

The lower-left panel draws the stored X/Y trajectory of the Lorenz control system. It visualizes the controller state; it is not a spectrum or an audio measurement.

AM multiplier

The lower-right panel shows the amplitude multiplier derived from Lorenz Z, including the end fade when Fade-out is active. A dotted line at 1 marks unity gain.

Summary

The summary strip reports the active pitch mode and its main parameters, the Lorenz parameters, AM scale, Dry/Wet, duration, and channel count.