Thermodynamic Transform — User Guide
Thermodynamic audio transformation with AI state discovery. Analyzes acoustic structure → discovers phase regimes via machine learning → applies regime-dependent spectral transforms (Crystal/Fluid/Gas/Plasma). Powered by Python (numpy, scipy, scikit-learn, soundfile).
What this does
This script implements a Thermodynamic Transform — an AI-powered audio transformation engine that analyzes acoustic structure, discovers thermodynamic phase regimes via machine learning, and applies regime-dependent transformations to individual audio events. The result is a sound that has been "thermodynamically processed" based on its own intrinsic structure.
🔥 What is Thermodynamic Audio Transformation?
Drawing an analogy from thermodynamics, this model treats audio as a system with four phase regimes:
- Crystal — ordered, stable, predictable (low entropy)
- Fluid — flowing, continuous, moderate entropy
- Gas — dispersed, chaotic, high entropy
- Plasma — ionized, extreme, maximum entropy
Machine learning (clustering, predictive modeling, or PCA) discovers which regions of the audio correspond to each regime, then a deterministic state machine applies transformations: crystals duplicate, fluids swap, gases drift, plasmas evaporate.
Key Features:
- 6 Preset Strategies — Gentle Crystallization to Convection Flow, plus Custom
- Multi-Stage Analysis — Pitch, HNR, intensity, formants + spectral features (flatness, flux, centroid)
- 3 AI Modes — Unsupervised clustering, Predictive instability, Learned entropy (PCA)
- Thermodynamic Fields — Entropy S, Order O, Temperature T fields constructed from acoustic features
- State Machine — Hysteresis, memory, energy budget controls regime transitions
- Event Segmentation — Novelty-based segmentation into 200ms-3s events
- Regime-Dependent Relocation — Crystal (duplicate), Fluid (swap), Gas (drift), Plasma (evaporate)
- Click-Free Reconstruction — Equal-power crossfades + post-splice smoothing
- Comprehensive Visualization — 6-panel display with waveforms, spectrograms, regime timeline, intensity comparison
Technical Implementation: (1) Feature Extraction: Praat extracts pitch, HNR, intensity, formants + Python computes spectral features. (2) Thermodynamic Fields: S, O, T constructed from features. (3) AI Analysis: Clustering/predictive modeling discovers regimes. (4) State Machine: Hysteresis, memory, energy budget. (5) Event Segmentation: Novelty-based detection. (6) Relocation: Regime-dependent reordering. (7) Reconstruction: Crossfaded concatenation.
Quick start
- In Praat, select exactly one Sound object (any duration, any content).
- Run script… → select
ThermodynamicTransform.praat. - Choose Preset (2-7 for specific strategies, 1 for custom).
- Set thermodynamic controls (thermo intensity, memory, convection, preserve duration).
- Select AI mode and AI strength.
- Set seed for reproducibility.
- Enable Draw_visualization for analysis display.
- Click OK — engine extracts features, runs Python analysis, transforms, creates "source_thermo".
Thermodynamic & AI Theory
The Four Thermodynamic Regimes
❄️ Crystal — Low Entropy, Ordered
Acoustic signature: Stable pitch, high harmonicity, low spectral flux
Transformation: At intensity ≥ 0.3, duplicate the lowest-entropy Crystal event
💧 Fluid — Moderate Entropy, Flowing
Acoustic signature: Continuous change, moderate flux, connected gestures
Transformation: Swap adjacent Fluid events when first has higher entropy
💨 Gas — High Entropy, Dispersed
Acoustic signature: Chaotic, noisy, high flux, unstable pitch
Transformation: Displace events proportionally to entropy magnitude, in direction of entropy gradient
⚡ Plasma — Maximum Entropy, Extreme
Acoustic signature: Maximum instability, extreme values
Transformation: Evaporate top X% highest-entropy Plasma events, then anchor remaining to structural positions
Thermodynamic Field Construction
AI Modes
🧠 Three Machine Learning Approaches
| Mode | Description | Algorithm |
|---|---|---|
| A — Unsupervised clustering | GMM on full feature space → 6 clusters → sorted by mean entropy → mapped to 4 regimes | Gaussian Mixture Model |
| B — Predictive instability | Ridge regression predicts future entropy from past context → clusters on predictions | Ridge Regression + GMM |
| C — Learned entropy (PCA) | PCA reduces dimension, local variance in latent space becomes learned entropy measure | PCA + GMM |
AI_strength blends AI-discovered regimes with physics-based fields:
State Machine Dynamics
Event Segmentation
Regime-Dependent Relocation
Preset Strategies
Preset 2: Gentle Crystallization
❄️ Subtle, Ordered
Thermo intensity: 0.3 | Memory: 0.7 | Convection: 0.0
AI mode: A | AI strength: 0.4
Character: Gentle transformation emphasizing Crystal regime, high memory for stability
Use on: Delicate material, preservation of structure
Preset 3: Balanced Flow
💧 Balanced, Fluid
Thermo intensity: 0.5 | Memory: 0.5 | Convection: 0.0
AI mode: A | AI strength: 0.5
Character: Balanced across regimes, moderate memory, standard AI influence
Use on: General purpose, exploration
Preset 4: Volatile Atmosphere
💨 Chaotic, Gaseous
Thermo intensity: 0.7 | Memory: 0.3 | Convection: 0.0
AI mode: B | AI strength: 0.6
Character: Higher intensity, low memory → more volatile, Gas regime emphasized
Use on: Experimental, chaotic textures
Preset 5: Deep Plasma
⚡ Extreme Transformation
Thermo intensity: 0.85 | Memory: 0.2 | Convection: 0.0
AI mode: C | AI strength: 0.7
Character: High intensity, low memory → Plasma regime dominates, many evaporations
Use on: Radical transformation, sound destruction
Preset 6: AI Explorer
🤖 AI-Driven Discovery
Thermo intensity: 0.6 | Memory: 0.4 | Convection: 0.0
AI mode: A | AI strength: 0.9
Character: High AI strength — let the machine learning dominate regime discovery
Use on: Exploring AI's interpretation of your sound
Preset 7: Convection Flow
🌊 Convection Currents
Thermo intensity: 0.6 | Memory: 0.3 | Convection: 0.7
AI mode: B | AI strength: 0.5
Character: Strong convection bias — high-entropy events rise, low-entropy sink
Use on: Creating directional flow, layered textures
Parameters & Controls
Thermodynamic Controls
| Parameter | Default | Description |
|---|---|---|
| Thermo_intensity | 0.6 | Overall transformation strength (0-1) |
| Memory | 0.5 | State machine inertia/hysteresis (0-1) — higher = slower transitions |
| Convection | 0.0 | Global re-sort bias (0-1) — high entropy rises, low entropy sinks |
| Preserve_duration | 1 | Maintain original duration (pad/trim output) |
AI Layer
| Parameter | Default | Description |
|---|---|---|
| AI_mode | A | A=Unsupervised clustering, B=Predictive instability, C=Learned entropy |
| AI_strength | 0.5 | Blend between physics-based and AI-discovered regimes (0-1) |
Reproducibility
| Parameter | Default | Description |
|---|---|---|
| Seed | 42 | Random seed for deterministic results |
Output
| Parameter | Default | Description |
|---|---|---|
| Draw_visualization | 1 | Generate 6-panel analysis display |
| Play_result | 1 | Audition after processing |
Visualization & Analysis
6-Panel Display
Reading the Regime Timeline
- Blue (Crystal): Ordered, stable regions — these will be preserved or duplicated
- Green (Fluid): Flowing, continuous regions — adjacent events may swap
- Orange (Gas): Chaotic, dispersed regions — events will drift
- Red (Plasma): Extreme, maximum entropy regions — events may evaporate
- The timeline shows how the AI and physics-based fields have classified each moment
- Watch for transitions — each color change is a regime boundary
Interpreting Summary Statistics
- Regime distribution: Percentage of time spent in each regime
- Transitions: Number of regime changes — high = more dynamic transformation
- Mean entropy S: Average of entropy field (0-1)
- Mean temperature T: Average of temperature field
- Events: Number of segmented events
- Relocated: Events that changed position in order
- Evaporated: Events removed entirely (Plasma regime)
- Duplicated: Events copied (Crystal regime)
Applications
Electroacoustic Composition
Use case: Creating complex, evolving textures from source material
Technique: Volatile Atmosphere or Deep Plasma presets on varied sources
Workflow:
- Select a 20-60 second source with diverse textures
- Run with Volatile Atmosphere preset (Gas emphasis)
- Examine regime timeline to understand classification
- Export transformed sound and use as movement in larger work
- Layer multiple transformations with different seeds
Sound Design for Media
Use case: Creating evolving backgrounds, transitions, or abstract textures
Technique: AI Explorer or Convection Flow on appropriate sources
Applications:
- Ambient backgrounds: Gentle Crystallization on pads — subtle, ordered evolution
- Tension cues: Volatile Atmosphere on drones — chaotic gas-like transformations
- Transitions: Convection Flow on risers — creates directional flow
Music Production
Use case: Creating variations of loops, stems, or phrases
Technique: Balanced Flow with different seeds
Examples:
- Drum loops: Gas regime will displace hits, creating new rhythms
- Melodic phrases: Crystal regime duplicates stable notes, creating drones
- Vocal samples: Fluid regime swaps phonemes, creating new words
Research & Education
Use case: Studying machine learning applications to audio, thermodynamic analogies
Technique: Compare AI modes on same source, examine regime classifications
Learning outcomes:
- Understand how clustering can discover acoustic states
- See how predictive models differ from descriptive clustering
- Explore the thermodynamic analogy and its musical implications
- Observe how AI strength blends learned and physics-based fields
Practical Workflow Examples
🎬 Film Scene: Evolving Tension
Goal: Create 60-second tension cue from 30-second drone
Settings:
- Source: 30-second low drone
- Preset: Volatile Atmosphere
- Custom: thermo_intensity=0.8, memory=0.2
- AI mode: B (predictive) — emphasizes instability
Result: Drone evolves through gas-like states, creating evolving tension
🎚️ Electronic Music: Glitch Variation
Goal: Create glitch variation of drum loop
Settings:
- Source: 8-second drum loop
- Preset: Deep Plasma
- Custom: convection=0.5 (adds directional flow)
Result: Hits evaporate, relocate, duplicate — glitchy, unpredictable texture
🎙️ Voice Processing: Choral Effect
Goal: Create choral texture from solo voice
Settings:
- Source: 10-second vocal phrase
- Preset: AI Explorer
- AI mode: C (PCA) — learns entropy from latent space
- AI_strength=0.9 (let AI dominate)
Result: Voice segmented into events, reordered based on AI-discovered regimes — creates choral-like polyphony
Troubleshooting Common Issues
Cause: Python not installed, or packages missing
Solution: Install Python and required packages: pip install numpy soundfile scipy scikit-learn
Cause: Python startup overhead + complex computations
Solution: First run will be slow; subsequent runs faster. For long files, consider shorter duration.
Cause: Crossfade insufficient or splice detection missed
Solution: Increase XFADE_SEC in Python script, or reduce thermo_intensity
Cause: thermo_intensity too low, or preserve_duration masking changes
Solution: Increase thermo_intensity, examine regime timeline to see if classification occurred
Cause: Feature extraction failed or source too homogeneous
Solution: Check source has variety; adjust hop_sec in script for finer resolution
Advanced Techniques
In the Python script, modify EVENT_MIN_DUR and EVENT_MAX_DUR (currently 0.200 and 3.000) for different segmentation scales.
Adjust weights in construct_fields() to emphasize different acoustic features — e.g., more weight on flux for turbulence-sensitive fields.
Modify thresh_heat and thresh_cool arrays in thermodynamic_state_machine() to change regime transition boundaries.
The script preserves multichannel audio throughout processing — each event extracts all channels, and reconstruction maintains multichannel format.