Lorenz Deep Analog — User Guide

Chaos‑based audio synthesis: maps the Lorenz attractor's X‑axis to pitch and Z‑axis to timbre, creating evolving, organic, chaotic soundscapes with deterministic unpredictability.

Algorithm: Lorenz Attractor (1963) Implementation: Praat Script Category: Chaos Synthesis Version: 1.0 (2025) License: MIT License
Contents:

What this does

This script implements chaos‑based audio synthesis using the Lorenz attractor — a classic system of three coupled nonlinear differential equations discovered by meteorologist Edward Lorenz in 1963. The system exhibits deterministic chaos: sensitive dependence on initial conditions, non‑periodic trajectories, and the iconic butterfly‑shaped strange attractor. Here, the Lorenz equations are numerically integrated, and the resulting X‑coordinate modulates pitch while the Z‑coordinate influences timbral aspects, yielding a sound that is mathematically deterministic yet perceptually unpredictable and organic.

Key Features:

What is chaos synthesis? Traditional synthesis: oscillators, filters, envelopes with periodic or stochastic control. Chaos synthesis: uses deterministic nonlinear dynamical systems (chaotic equations) to generate control signals. Characteristics: (1) Deterministic: Same initial conditions produce same output. (2) Non‑periodic: Never exactly repeats, creates evolving textures. (3) Sensitive dependence: Tiny changes in parameters yield vastly different results. (4) Strange attractors: Trajectories converge to fractal‑like geometric shapes. (5) Organic quality: Sounds natural, fluid, alive — like wind, water, or insect swarms. The Lorenz attractor is particularly suitable because its three variables provide rich, continuous modulation that feels both intentional and unpredictable.

Technical Implementation: (1) Numerical integration: Euler method with fixed time‑step (chaos_speed). (2) Audio mapping: X‑value → instantaneous frequency via sin(2π·(base_pitch + X·mod_depth)·t). (3) Control‑rate processing: Simulation runs at 500 Hz, then resampled to 44.1 kHz. (4) Visualization: X‑Z plot updates in real‑time, showing the attractor's evolution. (5) Parameter groups: σ (Sigma) = 10.0 (Prandtl number), β (Beta) = 2.6667 (aspect ratio), ρ (Rho) = variable (Rayleigh number) — primary chaos control. The magic lies in ρ: below ≈24.74 the system settles to fixed points; above, it becomes chaotic. Higher ρ increases turbulence and expands the attractor's wings.

Quick start

  1. In Praat, ensure no objects are selected.
  2. Run script…lorenz_deep_analog.praat.
  3. Choose a Preset (Standard Butterfly, Deep Drone, Nervous Insect, or Unstable Giant).
  4. Or select Custom and adjust parameters manually.
  5. Enable Debug_mode to see parameter values in Info window.
  6. Click OK — script runs, draws attractor, generates and plays sound.
  7. Result appears in Objects list as "Sound Lorenz_Chaos".
Quick tip: Start with Standard Butterfly to hear the classic Lorenz behavior — medium pitch, slow evolution, recognizable butterfly pattern. Try Deep Drone for sub‑bass textures with very slow movement. Nervous Insect gives high‑pitched, fast‑changing buzzing. Unstable Giant (ρ=90) creates wild, expansive pitch sweeps. Enable Debug_mode to see exact parameter values. The visualization window shows the X‑Z plot — watch the red dot (current state) trace the butterfly wings. Sound is generated at control rate (500 Hz) then upsampled to 44.1 kHz — longer durations yield more attractor cycles.
Important: CHAOTIC SYSTEM — output is deterministic but unpredictable. Tiny parameter changes (<0.001 in chaos_speed) can dramatically alter the result. High ρ values (>50) expand the attractor, requiring adjusted visualization scales (script auto‑adjusts). Very fast chaos_speed (>0.02) may cause numerical instability. Very long durations (>60 s) increase computation time. The pitch formula uses X‑value directly — large X excursions cause wide pitch swings (may go ultrasonic or sub‑audio). The script automatically scales modulation depth based on ρ to keep audio range reasonable. Visualization draws every 2nd point for performance — for higher detail, modify the step variable.

Chaos Theory & Lorenz Equations

The Lorenz System

🔬 Original Equations (1963)

Differential form:

dx/dt = σ(y − x) dy/dt = x(ρ − z) − y dz/dt = xy − βz Where: x, y, z = state variables (evolving in time) σ (Sigma) = Prandtl number (fixed at 10.0) ρ (Rho) = Rayleigh number (primary chaos parameter) β (Beta) = aspect ratio (fixed at 8/3 ≈ 2.6667) In this script: chaos_speed acts as Δt (integration time‑step) lx, ly, lz are the discrete‑time approximations

Numerical Integration (Euler Method)

# Discrete‑time approximation (Euler forward) FOR each sample i (1 to total_samples): # Compute derivatives dx = sigma * (ly - lx) * chaos_speed dy = (lx * (rho - lz) - ly) * chaos_speed dz = (lx * ly - beta * lz) * chaos_speed # Update state lx = lx + dx ly = ly + dy lz = lz + dz # Store for audio/visualization val_x#[i] = lx val_z#[i] = lz END FOR Note: chaos_speed ≡ Δt (integration step size) Smaller Δt → more accurate but slower evolution Larger Δt → faster but risk numerical instability

Physics Interpretation

Original meteorological meaning:

🎯 Chaos Threshold

Critical ρ ≈ 24.74

  • ρ < 1: Origin stable (no motion)
  • 1 < ρ < 24.74: Two stable fixed points (steady convection)
  • ρ > 24.74: Chaotic regime (butterfly attractor)
  • ρ ≈ 28.0: Classic Lorenz parameter (Standard Butterfly preset)
  • ρ > 50: Highly turbulent, expanded wings
  • ρ > 100: Hyper‑chaotic, complex patterns

The Strange Attractor

Butterfly‑Wing Structure: Left Wing (x < 0) Right Wing (x > 0) │ │ Negative x Positive x Lower pitch modulation Higher pitch modulation │ │ Z grows slowly Z grows slowly │ │ ───────────┼───────────────────────────┼─────────── │ │ Spiral outward Spiral outward │ │ Cross to other wing Cross to other wing │ │ ───────────┼───────────────────────────┼─────────── │ │ Chaotic switching: system orbits one wing for unpredictable duration, then jumps to other wing. Fractal Properties: • Infinite complexity at any scale • Non‑integer Hausdorff dimension (~2.06) • Sensitive dependence: trajectories diverge exponentially

Audio Mapping Strategy

# Audio generation formula (applied after resampling) Formula: "0.5 * sin(2*pi * (base_pitch + (self * mod_depth)) * x)" Where: self = stored X‑value (lx) at that time base_pitch = fundamental frequency in Hz mod_depth = modulation depth (scales X's influence) x = audio sample time (seconds) Interpretation: Instantaneous frequency = base_pitch + (X * mod_depth) So X acts as a continuous pitch‑modulation signal. mod_depth is auto‑scaled based on ρ: if rho > 50 → mod_depth = 5 (reduced range) else → mod_depth = 10 (standard range) This prevents extreme pitch excursions at high ρ.

Complete Processing Pipeline

SETUP: Choose preset or custom parameters Set duration, base_pitch, chaos_speed, rho Enable debug_mode if desired INITIALIZATION: control_rate = 500 Hz (simulation rate) total_samples = duration × control_rate Create arrays val_x#[], val_z#[] for visualization Create Sound at control rate for X‑data storage SIMULATION LOOP: Initialize lx = ly = lz = 0.1 (small perturbation) FOR i = 1 to total_samples: Compute dx, dy, dz from Lorenz equations Update lx, ly, lz (Euler integration) Store lx in Sound sample i Store lx, lz in val_x#[i], val_z#[i] VISUALIZATION: Set viewport for graphics Draw axes: X (pitch) vs Z (timbre) Plot val_x# vs val_z# (draw every 2nd point) Mark final state with red circle AUDIO GENERATION: Copy control‑rate Sound to "Audio_Temp" Resample to 44100 Hz (high‑quality audio) Apply pitch‑modulation formula Rename to "Lorenz_Chaos" Play result CLEANUP: Remove temporary objects Leave final "Sound Lorenz_Chaos" selected

Preset Behaviors

Preset 1: Standard Butterfly (ρ = 28.0)

🦋 Classic Lorenz Attractor

Parameters:

  • Duration: 15.0 s
  • Base pitch: 200 Hz
  • Chaos speed: 0.005
  • Rho (ρ): 28.0
  • Visual scale: X: ±25, Z: 0‑50

Sonic character: Medium pitch, slow evolution, recognizable butterfly pattern. The sound gracefully orbits between two pitch centers (left/right wings), with smooth transitions and organic swells. Ideal for introducing chaos synthesis — predictable enough to follow, chaotic enough to stay interesting.

Visualization: Clear butterfly shape with balanced wings. System spends roughly equal time in each wing.

Preset 2: Deep Drone (ρ = 28.0)

🌀 Slow‑Evolving Bass Texture

Parameters:

  • Duration: 30.0 s
  • Base pitch: 60 Hz
  • Chaos speed: 0.001
  • Rho (ρ): 28.0
  • Visual scale: X: ±25, Z: 0‑50

Sonic character: Sub‑bass drone with glacial movement. Very slow chaos speed means the attractor evolves gradually, creating subtle pitch bends and timbral shifts over tens of seconds. Feels like tectonic plates shifting or deep ocean currents.

Visualization: Dense, slow‑drawn attractor — points are close together due to small integration step.

Preset 3: Nervous Insect (ρ = 28.0)

🐝 High‑Speed Buzzing

Parameters:

  • Duration: 10.0 s
  • Base pitch: 350 Hz
  • Chaos speed: 0.015
  • Rho (ρ): 28.0
  • Visual scale: X: ±25, Z: 0‑50

Sonic character: Fast, erratic buzzing reminiscent of insect swarms or electrical interference. High pitch + fast chaos speed creates rapid pitch jumps and nervous energy. The attractor switches wings frequently, producing staccato‑like transitions.

Visualization: Sparse, rapid trajectory — large jumps between points, attractor fills quickly.

Preset 4: Unstable Giant (ρ = 90.0)

🌪️ Turbulent Expanded Chaos

Parameters:

  • Duration: 20.0 s
  • Base pitch: 120 Hz
  • Chaos speed: 0.004
  • Rho (ρ): 90.0
  • Visual scale: X: ±50, Z: 0‑160 (auto‑expanded)

Sonic character: Wild, expansive pitch sweeps with turbulent behavior. High ρ expands the attractor wings dramatically, causing extreme X‑values that map to wide pitch excursions. The modulation depth is automatically reduced (mod_depth = 5) to keep audio range reasonable. Sounds like a unstable giant machine or atmospheric turbulence.

Visualization: Huge butterfly shape — wings extend to ±50 in X, up to 160 in Z.

Parameters & Mapping

Custom Parameters (When Preset = "Custom")

🎛️ User‑Adjustable Settings

ParameterTypeDefaultRangeDescription
Durationreal15.01.0‑300.0Length of generated sound (seconds)
Base_pitchreal20020‑2000Fundamental frequency (Hz)
Chaos_speedreal0.0050.0001‑0.05Integration step size Δt (larger = faster evolution)
Rhoreal28.010‑200Rayleigh number (chaos intensity)
Debug_modeboolean00/1Print parameters to Info window

Fixed Parameters (Not User‑Adjustable)

ParameterValueDescription
Sigma (σ)10.0Prandtl number (viscosity vs thermal diffusivity)
Beta (β)2.6667Aspect ratio (8/3)
Control_rate500 HzSimulation sampling rate
Audio_rate44100 HzOutput audio sampling rate
Initial conditions(0.1, 0.1, 0.1)Starting point (lx, ly, lz)

Parameter Interactions & Effects

Chaos_speed (Δt) behavior: • 0.001 → Very slow evolution (Deep Drone) • 0.005 → Medium speed (Standard Butterfly) • 0.015 → Fast, jumpy (Nervous Insect) • >0.02 → Risk of numerical instability Rho (ρ) effects: • ρ < 24.74 → System settles to fixed point (boring sound) • ρ = 28.0 → Classic chaotic regime • ρ = 40‑60 → More turbulent, larger wings • ρ > 80 → Highly expanded, extreme values • ρ > 100 → Hyper‑chaotic, complex patterns Base_pitch tuning: • 20‑80 Hz → Sub‑bass, felt more than heard • 80‑200 Hz → Bass fundamentals • 200‑500 Hz → Mid‑range, melodic potential • 500‑1000 Hz → Bright, present • >1000 Hz → Piercing, insect‑like Duration considerations: • Short (<10 s) → Quick glimpse of attractor • Medium (10‑30 s) → Several wing transitions • Long (>30 s) → Full attractor exploration

Automatic Scaling Rules

# Visualization scaling (auto‑adjusts for high ρ) if preset = 5 # Unstable Giant (ρ = 90.0) scale_min_x = -50 scale_max_x = 50 scale_max_z = 160 else scale_min_x = -25 scale_max_x = 25 scale_max_z = 50 endif # Modulation depth scaling (prevents extreme pitch) mod_depth = 10 if rho > 50 mod_depth = 5 # Reduce pitch modulation range endif Rationale: High ρ → larger X‑values → wider pitch swings Reducing mod_depth keeps audio in reasonable range Without this, ρ=90 could produce ultrasonic frequencies

Sonic Applications

Ambient Textures & Soundscapes

🌫️ Evolving Backgrounds

Technique: Use Deep Drone preset with extended duration (60+ seconds). Layer multiple instances with different base pitches (e.g., 60 Hz, 120 Hz, 180 Hz) for rich harmonic clouds.

Post‑processing: Add reverb (large hall), slow low‑pass filter modulation, subtle amplitude tremolo.

Result: Living, breathing atmospheric pads that never repeat exactly.

Experimental Music & Composition

Use case: Generative composition with chaotic control signals

Workflow:

Sound Design for Media

Sci‑fi effects: Nervous Insect preset for alien communications, robot chatter, electrical malfunctions.

Nature sounds: Deep Drone with very slow chaos_speed for earthquake rumbles, distant thunder.

Horror textures: Unstable Giant with pitch shifted down an octave for unsettling, unstable machinery.

Algorithmic Performance

Live manipulation: Map physical controllers to parameters:

Result: Performative control over chaotic system — deterministic enough to rehearse, unpredictable enough to surprise.

Scientific Sonification

Use case: Making chaos theory audible for education/research

Demonstrations:

Practical Workflow Examples

🎬 Sci‑fi Spaceship Interior

Goal: Complex, alive machinery hum

Settings:

  • Preset: Standard Butterfly
  • Base pitch: 180 Hz (fundamental)
  • Duration: 45 seconds
  • Post‑process: Band‑pass filter (150‑250 Hz), light distortion, stereo widener

Layering: Add second instance at 90 Hz (octave below) for weight.

🎵 Generative Melodic Patterns

Goal: Chaotic but tonal melodic material

Settings:

  • Preset: Custom
  • Base pitch: 440 Hz (A4)
  • Chaos speed: 0.003
  • Rho: 30.0
  • Post‑process: Quantize X‑values to nearest semitone (external script)

Result: Evolving melodies that hover around A major but introduce surprising intervals.

🔬 Chaos Education Demo

Goal: Demonstrate sensitive dependence on initial conditions

Procedure:

  1. Run script with ρ=28.0, chaos_speed=0.005, duration=10
  2. Note the resulting melody
  3. Change chaos_speed to 0.005001 (tiny change!)
  4. Run again — completely different melody emerges
  5. Students hear how deterministic chaos differs from randomness

Visualization

The X‑Z Plot

Why X vs Z (not X vs Y or Y vs Z)?

Plot Interpretation: Z (Timbre/Energy) ↑ │ 160 ──┼───• (Unstable Giant expands here) │ │ 50 ──┼───────┐ │ ╱ ╲ │ ╱ ╲ │ ╱ ╲ │ ╱ ╲ │ ╱ ╲ │ ╱ ╲ │╱ ╲ 0 ───┼───────────────┼──→ X (Pitch) -50 50 Left Wing Right Wing (Lower pitch) (Higher pitch) Trajectory Rules: 1. Spiral outward within a wing 2. Jump to other wing unpredictably 3. Higher Z = more energy = brighter timbre 4. Plot updates in real‑time during generation

Drawing Optimization

# Visualization draws every 2nd point for performance step = 2 for i from 2 to total_samples if (i mod step) = 0 curr_x = val_x#[i] curr_z = val_z#[i] Draw line: prev_x, prev_z, curr_x, curr_z prev_x = curr_x prev_z = curr_z endif endfor # To increase detail (slower): step = 1 # Draw every point # To decrease detail (faster): step = 5 # Draw every 5th point # Final state marked with red circle Colour: "Red" Paint circle (mm): "Red", lx, lz, 2

Color Coding

Scale Auto‑Adjustment

For high ρ (>50): Visualization scales expand automatically:

if preset = 5 # Unstable Giant (ρ=90) scale_min_x = -50 # Was -25 scale_max_x = 50 # Was 25 scale_max_z = 160 # Was 50 endif

This ensures the expanded attractor remains visible within the plot bounds.

Advanced Modifications

Custom Initial Conditions

To change starting point: Modify these lines in the script:

# Current initial conditions: lx = 0.1 ly = 0.1 lz = 0.1 # Alternative starting points: # lx = 0.01 # Tiny perturbation # lx = 5.0 # Start on right wing # lx = -5.0 # Start on left wing # lz = 25.0 # Start with high energy

Effect: Different starting points converge to the same attractor (transient period varies).

Additional Audio Mappings

Map Y to amplitude: Create tremolo/volume modulation:

# After audio generation, apply amplitude envelope Formula: "self * (0.5 + 0.5 * ly_normalized)" Where ly_normalized scales Y‑values to [0,1] range.

Map Z to filter cutoff: External processing with automation.

Multi‑Attractor Layering

Generate multiple Lorenz systems with different parameters:

# Script modification idea: for layer = 1 to 3 rho_layer = 28.0 + (layer-1)*10 base_pitch_layer = 100 * layer # Generate sound... # Mix all layers endfor

Creates rich, beating textures from interacting chaotic systems.

Exporting Control Data

Save X, Y, Z arrays to text file for use in other software (DAWs, Max/MSP, Pure Data):

# Add to end of script: writeFileLine: "lorenz_data.txt", "time,X,Y,Z" for i from 1 to total_samples time = (i-1)/control_rate appendFileLine: "lorenz_data.txt", time, ",", val_x#[i], ",", val_y#[i], ",", val_z#[i] endfor