Chaotic Prosody Manipulation — User Guide

Mathematical chaos applied to speech melody: replaces natural pitch contours with logistic maps and Lorenz attractors, creating unpredictable yet structured prosodic patterns driven by deterministic nonlinear systems.

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

What this does

This script implements chaotic prosody manipulation — replacing natural speech intonation with mathematically generated pitch contours derived from nonlinear dynamical systems. Using two complementary chaotic systems (logistic map for pitch, Lorenz attractor for amplitude), it creates unpredictable yet structured melodic patterns that exhibit the fascinating behavior of deterministic chaos: sensitive dependence on initial conditions, bounded unpredictability, and complex emergent patterns.

Key Features:

What is chaotic prosody? Traditional prosody manipulation uses rule-based or random variations of pitch and amplitude. Chaotic prosody uses deterministic nonlinear systems that exhibit complex, unpredictable behavior from simple mathematical rules. Unlike random processes, chaotic systems are completely deterministic—the same initial conditions always produce the same output—yet they appear random due to extreme sensitivity to initial conditions. This creates prosodic patterns that are both structured and unpredictable, mimicking some qualities of emotional or excited speech.

Technical Implementation: (1) Pitch extraction: Analyzes original F0 contour to establish baseline. (2) Pitch replacement: Generates new pitch contour using either logistic map chaos or Ornstein-Uhlenbeck process. (3) Amplitude modulation: Creates chaotic envelope using Lorenz attractor dynamics. (4) Numerical integration: Uses Runge-Kutta methods for accurate simulation. (5) Resynthesis: Applies new prosodic contours using overlap-add synthesis. (6) Smoothing: Applies digital filters to prevent artifacts.

Quick start

  1. In Praat, select exactly one Sound object (preferably speech).
  2. Run script…chaotic_prosody_manipulation.praat.
  3. Choose Pitch Modulation mode:
    • Logistic chaos: Complex, deterministic pitch patterns
    • Mean-reverting Brownian: More natural, stochastic variation
  4. Set control_rate (50-200 Hz) for temporal resolution.
  5. Adjust Logistic parameters for pitch chaos character.
  6. Set Lorenz parameters for amplitude modulation character.
  7. Adjust fadeout_duration for smooth ending.
  8. Click OK — effect applied, result named "originalname_chaotic".
  9. Check Info window for processing summary and parameters.
Quick tip: Start with Logistic chaos for experimental, complex pitch patterns. Use Mean-reverting Brownian for more natural-sounding variations. control_rate = 100 Hz works well for most speech. logistic_r = 3.9 produces rich chaos, while r = 3.0-3.5 creates simpler patterns. Lorenz parameters at default values produce classic chaotic behavior. The effect works best on clear speech with stable pitch—results may be unpredictable on noisy or unvoiced material.
Important: This is destructive processing — original pitch and amplitude contours are permanently replaced. Extreme parameter values may produce unnatural or artifact-laden results. Very high control_rate (>200 Hz) increases processing time significantly. The logistic map becomes unstable at r > 4.0. Lorenz system can escape bounds with extreme parameters. Processing time depends on audio duration and control rate—long files may take considerable time.

Chaos Theory Fundamentals

Deterministic Chaos Principles

What Makes a System Chaotic?

Three key properties of chaotic systems:

1. SENSITIVE DEPENDENCE ON INITIAL CONDITIONS - Tiny differences in starting values lead to completely different outcomes - The "butterfly effect" - a butterfly flapping its wings can change the weather - Makes long-term prediction impossible 2. DETERMINISTIC YET UNPREDICTABLE - The equations are completely deterministic (no randomness) - But the behavior appears random and unpredictable - Same initial conditions → same outcome every time 3. BOUNDED STRANGE ATTRACTORS - The system never repeats exactly - But stays within certain bounds - Creates complex, fractal-like patterns

🎲 Chaos vs Randomness

Random systems: Truly unpredictable, no underlying pattern

Chaotic systems: Appear random but have hidden deterministic structure

Key difference: Chaotic systems can be exactly reproduced from the same starting point, while random systems cannot

Applications to Prosody

Why Chaos for Speech Melody?

Natural prosody already exhibits chaotic characteristics:

Emotional speech patterns:

Neutral speech: Regular, predictable pitch contours
Excited speech: Complex, unpredictable variations
Chaotic systems: Can model the complexity of emotional prosody

Research findings:
- Emotional speech shows higher complexity measures
- Chaotic models can synthesize believable emotional contours
- Nonlinear dynamics appear in natural speech production

Chaotic prosody manipulation artificially induces this complexity

Numerical Methods

Accurate Simulation Requirements

Chaotic systems require careful numerical integration:

ORDINARY EULER METHOD (unstable for chaos): x_{n+1} = x_n + f(x_n) × dt - Simple but inaccurate - Can diverge or produce artifacts RUNGE-KUTTA 2 (MIDPOINT METHOD): k1 = f(x_n) × dt k2 = f(x_n + k1/2) × dt x_{n+1} = x_n + k2 - More accurate, stable for chaotic systems - Used in this script for Lorenz integration CONTROL RATE CONSIDERATIONS: dt = 1 / control_rate Smaller dt = more accurate but slower Larger dt = faster but potential instability

Dynamical Systems

Pitch Modulation Systems

🎵 Pitch Generation Algorithms

Mode 1: Logistic Chaos (Multiplicative)

Logistic Map Equation: x_{n+1} = r × x_n × (1 - x_n) Where: x ∈ [0,1] (state variable) r ∈ [0,4] (control parameter) Pitch Conversion: factor = 1 + depth × (2x - 1) f0 = f0_base × factor Behavior by r value: r < 3.0: Stable fixed points r = 3.0-3.57: Periodic oscillations r > 3.57: Chaotic behavior r = 3.9: Rich chaos (default)

Mode 2: Mean-Reverting Brownian (OU Process)

Ornstein-Uhlenbeck Process: df0 = θ × (μ - f0) × dt + σ × √dt × N(0,1) Where: f0 = current pitch (Hz) μ = mean pitch (f0_base) θ = mean reversion strength σ = volatility parameter dt = time step Properties: - Mean-reverting: tends toward base F0 - Random walk with restoring force - More natural-sounding than pure chaos - Bounded variation around mean

Amplitude Modulation System

Lorenz Attractor Dynamics

The Lorenz system models atmospheric convection:

LORENZ EQUATIONS: dx/dt = σ × (y - x) dy/dt = x × (ρ - z) - y dz/dt = x × y - β × z Where: x, y, z = state variables σ = Prandtl number (10.0 default) ρ = Rayleigh number (28.0 default) β = geometric parameter (2.667 default) AMPLITUDE MODULATION: z_normalized = (z - 20) / 30 → [0,1] range am_value = 0.5 + scale × (z_normalized - 0.5) output = input × am_value The famous "butterfly" attractor creates complex, non-repeating amplitude patterns

Lorenz System Behavior

Classic Lorenz parameter sets:

Standard chaos (default):
σ=10.0, ρ=28.0, β=2.667 → Classic butterfly attractor

Intermittent chaos:
σ=10.0, ρ=166.0, β=8/3 → Bursts of chaos between periodic motion

Stable fixed points:
σ=10.0, ρ=14.0, β=8/3 → Non-chaotic, converges to points

Amplitude effects:
Higher ρ = more intense modulation
Higher σ = faster oscillations
Higher β = different attractor shape

Complete Processing Pipeline

SETUP: Select Sound object Extract duration, sampling rate, F0 mean PITCH PROCESSING: STEP 1: Extract original pitch contour To Pitch: 0, 75, 600 f0_base = Get mean F0 STEP 2: Create Manipulation object To Manipulation: 0.01, 75, 600 STEP 3: Generate new pitch contour IF logistic_mode: x = 0.5 FOR each control point: x = r × x × (1 - x) factor = 1 + depth × (2x - 1) f0 = f0_base × factor ELSE: # OU process f0 = f0_base FOR each control point: noise = N(0,1) df0 = θ×(f0_base-f0)×dt + σ×√dt×noise f0 = f0 + df0 Clip to [50,500] Hz STEP 4: Replace pitch tier and resynthesize AMPLITUDE PROCESSING: STEP 1: Initialize Lorenz system x,y,z = 1.0 STEP 2: RK2 integration at control rate FOR each sample: IF at control point: Update Lorenz system z_normalized = (z - 20) / 30 → [0,1] Smooth with one-pole filter Apply fade-out near end STEP 3: Multiply sound by AM envelope FINALIZATION: Scale peak to 0.99 Play result Display processing summary

Parameters

Pitch Modulation Parameters

ParameterTypeRangeDefaultDescription
pitch_modeoptionmenu1-21Logistic chaos or OU process
control_ratepositive50-200100Control points per second
logistic_rreal3.0-4.03.9Logistic map control parameter
logistic_depthreal0.1-0.50.35Pitch variation depth
ou_thetareal0.5-3.01.5OU mean reversion strength
ou_sigmareal5.0-50.020.0OU process volatility

Amplitude Modulation Parameters

ParameterTypeRangeDefaultDescription
lorenz_sigmareal5.0-15.010.0Lorenz Prandtl number
lorenz_rhoreal15.0-40.028.0Lorenz Rayleigh number
lorenz_betareal1.0-4.02.667Lorenz geometric parameter
lorenz_scalereal0.3-0.90.6AM modulation depth
am_smoothingreal0.7-0.950.85One-pole smoothing factor

Fade Out Parameters

ParameterTypeRangeDefaultDescription
fadeout_durationreal0.1-2.00.5Fade-out time in seconds

Parameter Interactions

Key parameter relationships:

control_rate × duration: Determines number of control points
logistic_r > 3.57: Required for chaotic behavior
lorenz_rho > 24.74: Required for Lorenz chaos
ou_theta × dt: Controls mean reversion speed
lorenz_scale × am_smoothing: Trade-off between intensity and smoothness

Stability boundaries:
logistic_r > 4.0: Map escapes bounds
Very low control_rate: Numerical instability
Extreme Lorenz parameters: Unbounded growth

Applications

Experimental Vocal Processing

Use case: Creating alien or synthetic vocal characters

Technique: Use strong logistic chaos with intense Lorenz AM

Settings:

Result: Completely synthetic, alien-sounding vocal prosody

Emotional Speech Synthesis

Use case: Adding emotional complexity to neutral speech

Technique: Use moderate OU process with subtle Lorenz AM

Settings:

Result: Speech with added emotional color and complexity

Sound Design and Composition

Use case: Generating complex melodic patterns from speech

Technique: Use speech as raw material for chaotic transformation

Approaches:

Result: Musical materials derived from chaotic speech prosody

Psychoacoustic Research

Use case: Studying perception of chaotic vs natural prosody

Technique: Systematic parameter variation

Research applications:

Value: Controlled generation of prosodic stimuli

Practical Workflow Examples

👽 Alien Voice Effect

Goal: Create completely synthetic vocal character

Settings:

  • pitch_mode: 1 (Logistic)
  • logistic_r: 3.9, depth: 0.45
  • lorenz_scale: 0.75
  • control_rate: 120
  • Apply to short vocal phrases

Result: Unrecognizable, synthetic vocal prosody

🎭 Emotional Enhancement

Goal: Add emotional color to neutral speech

Settings:

  • pitch_mode: 2 (OU process)
  • ou_theta: 1.2, sigma: 18.0
  • lorenz_scale: 0.35
  • control_rate: 80
  • Apply to declarative sentences

Result: More expressive, emotionally colored speech

🎵 Musical Prosody

Goal: Create melodic patterns from speech

Settings:

  • pitch_mode: 1 (Logistic)
  • logistic_r: 3.7, depth: 0.3
  • lorenz_scale: 0.25 (minimal AM)
  • control_rate: 150
  • Apply to sustained vowels or syllables

Result: Speech-derived melodic materials

Advanced Techniques

Parameter automation:
  • Vary parameters over time for evolving effects
  • Gradually increase logistic_r from 3.0 to 3.9
  • Modulate lorenz_scale with envelope follower
  • Create macro-structure within chaotic micro-structure
Multi-layer processing:
  • Process different frequency bands separately
  • Apply different chaos parameters to formants
  • Combine logistic and OU processing
  • Create incredibly complex, multi-dimensional chaos

Troubleshooting Common Issues

Problem: Unnatural pitch jumps or artifacts
Cause: control_rate too low, extreme parameters, or poor source material
Solution: Increase control_rate, moderate parameters, use clean speech source
Problem: Amplitude modulation too extreme
Cause: lorenz_scale too high, insufficient smoothing
Solution: Reduce lorenz_scale, increase am_smoothing
Problem: Pitch escapes reasonable range
Cause: Extreme logistic parameters or OU volatility
Solution: Use pitch_mode 2 (OU process), reduce ou_sigma, check bounds
Problem: Processing too slow
Cause: High control_rate with long duration
Solution: Reduce control_rate, process shorter segments

Technical Deep Dive

Numerical Stability Analysis

Runge-Kutta Method for Lorenz System

The script uses second-order Runge-Kutta (RK2):

Given: dy/dt = f(t, y) RK2 (Midpoint Method): k1 = f(t_n, y_n) × dt k2 = f(t_n + dt/2, y_n + k1/2) × dt y_{n+1} = y_n + k2 For Lorenz system (vector form): Let Y = [x, y, z] f(Y) = [σ(y-x), x(ρ-z)-y, xy-βz] K1 = f(Y_n) × dt Y_mid = Y_n + K1/2 K2 = f(Y_mid) × dt Y_{n+1} = Y_n + K2 This method provides good accuracy for chaotic systems while being computationally efficient

Stability Conditions

Numerical stability requirements:

Logistic map: Always stable for r ≤ 4.0
OU process: Stable for any dt with proper clipping
Lorenz system: Requires small enough dt

Time step guidelines:
dt = 1/control_rate
For Lorenz: dt ≤ 0.01 recommended (control_rate ≥ 100)
Smaller dt = more accurate but slower
Larger dt = potential numerical instability

RK2 provides good balance of accuracy and speed

Computational Complexity

Processing Time Analysis

The algorithm scales with several factors:

Primary time factors: T ∝ duration × control_rate × complexity Where complexity includes: - Pitch contour generation - Lorenz system integration - Resynthesis process Memory usage: - Original sound: N samples - Manipulation objects: ~2×N - Temporary buffers: ~N - Total: ~4× original memory Optimization approaches: - Vectorized operations where possible - Efficient Praat object management - Control rate balancing

Theoretical Background

Chaos Theory in Speech Research

Academic context: The application of chaos theory to speech prosody builds on research in nonlinear dynamics and speech production. Studies have shown that vocal fold vibration exhibits nonlinear characteristics, and emotional speech shows increased complexity measures. This script operationalizes these theoretical concepts, providing a practical tool for exploring chaotic prosody in creative and research contexts. The mathematical foundations draw from classical chaos theory (Lorenz 1963, May 1976) and modern speech science research.

Psychoacoustic Considerations

Human perception of chaotic prosody:

Pitch perception: Humans are sensitive to F0 contours in speech
Chaos detection: Listeners can distinguish chaotic from random patterns
Emotional responses: Chaotic prosody often perceived as emotional or excited
Intelligibility: Moderate chaos may not affect word recognition
Musicality: Chaotic pitch can create interesting melodic patterns

The script allows systematic exploration of these perceptual boundaries