Phase-Space Composer — Attractor-Driven Event Montage — User Guide
Segments the input into acoustic events, extracts perceptual feature vectors, and drives event recomposition via a deterministic dynamical system (attractor) in the feature space. Attractors: Hopf (limit cycle), Lorenz, Rössler, Logistic Map.
What this does
This script implements a Phase-Space Composer — an attractor-driven event montage engine that segments audio into acoustic events, extracts perceptual feature vectors, and drives event recomposition via a deterministic dynamical system (attractor) in the feature space. Four attractors are available: Hopf (limit cycle), Lorenz, Rössler, and Logistic Map.
🌀 What is Phase-Space Composition?
This approach treats the acoustic feature space as a dynamical system:
- Events are segmented from the source (silence-based)
- 5 perceptual features extracted per event: spectral centroid, flatness, entropy, flux, RMS
- State space constructed from 2-5 dimensions of these features
- Attractor trajectory generated by a deterministic dynamical system (Hopf, Lorenz, Rössler, Logistic Map)
- Event mapping selects events whose features match the trajectory, with weighted distance, velocity alignment, and feedback coupling
The result is a composition whose temporal structure follows the dynamics of the chosen attractor.
Key Features:
- 4 Attractor Types — Hopf (limit cycle), Lorenz, Rössler, Logistic Map
- 5 Perceptual Features — centroid, flatness, entropy, flux, RMS
- 4 State Dimensions — 2D to 5D feature spaces
- 5 Weight Presets — Uniform, Brightness, Noisiness, Energy, Transient
- Advanced Mapping — weighted Euclidean distance, velocity alignment, feedback coupling, tabu anti-repetition, temperature softmax
- Deterministic Trajectories — RK4 integration for continuous attractors, delay embedding for logistic map
- Comprehensive Visualization — 5-panel display with waveforms, spectrograms, phase-space info, stats
Technical Implementation: (1) Event Segmentation: Silence-based detection. (2) Feature Extraction: Per-event spectral analysis → 5 features. (3) Normalization: Robust 0-1 scaling per dimension. (4) Trajectory Generation: RK4 integration for continuous attractors, delay embedding for logistic map. (5) Mapping: Weighted distance, velocity alignment, coupling, tabu, temperature. (6) Reconstruction: Concatenate events with crossfades.
Quick start
- In Praat, select exactly one Sound object (any duration, any content).
- Run script… → select
PhaseSpaceComposer.praat. - Choose Attractor_type (Hopf, Lorenz, Rössler, LogisticMap).
- Select state dimensions and weight preset.
- Set composition parameters (number of events, tabu length, temperature, seed).
- Adjust dynamics (velocity weight, coupling) if desired.
- Set audio parameters (crossfade, min event duration).
- Enable Draw_visualization for analysis display.
- Click OK — engine segments, extracts features, generates attractor trajectory, maps events, reconstructs.
Phase-Space Theory
Feature Space
Trajectory Generation
📈 RK4 Integration & Delay Embedding
Continuous attractors (Hopf, Lorenz, Rössler) integrated with 4th-order Runge-Kutta:
Logistic Map (1D chaos) lifted to D dimensions via time-delay embedding:
All trajectories are min-max normalized to [0,1] per dimension.
Trajectory → Event Mapping
🎯 Three Complementary Mechanisms
1. Weighted Euclidean Distance:
Dimension weights emphasize specific acoustic qualities.
2. Velocity/Direction Alignment (velocity_weight > 0):
Makes event selection follow attractor's direction of change.
3. Feedback Coupling (coupling > 0):
Trajectory bends toward chosen events — data–dynamics interaction.
Anti-repetition + Stochastic Selection:
- Tabu list: last N chosen events forbidden (unless pool empty)
- Temperature: 0 = greedy (closest), >0 = softmax over top K=ceil(temp×20) candidates
Attractor Types
Hopf (Limit Cycle)
🔄 Stable Periodic Orbit
Character: Smooth periodic cycles — repeating morphological patterns without exact repetition
Musical effect: Looping structures with subtle variation, cyclic forms
Lorenz
🦋 Strange Attractor
Character: Bounded chaos — structured recurrence with sensitive dependence
Musical effect: Familiar patterns returning in unpredictable ways, chaotic but organized
Rössler
🌀 Single-Scroll Chaos
Character: Smooth spiral divergence + sudden return — simpler than Lorenz, more regular
Musical effect: Gradual divergence then snap back — tension/release cycles
Logistic Map
📈 1D Chaos + Delay Embedding
Character: Bursts, intermittency, regime shifts — from the classic logistic map
Musical effect: Sudden changes, unpredictable transitions, bursts of activity
Parameters & Controls
Attractor Parameters
| Parameter | Default | Description |
|---|---|---|
| Attractor_type | Lorenz | Hopf, Lorenz, Rössler, LogisticMap |
State Space Parameters
| Parameter | Default | Description |
|---|---|---|
| State_dims | 3D | 2D, 3D, 4D, 5D feature spaces |
Distance Weighting
| Parameter | Default | Description |
|---|---|---|
| Weight_preset | Uniform | Uniform, Brightness, Noisiness, Energy, Transient |
Composition Parameters
| Parameter | Default | Description |
|---|---|---|
| Num_events_output | 300 | Number of events in output composition (10–2000) |
| Tabu_length | 12 | Anti-repetition window (1–500, clamped to < n_events) |
| Temperature | 0.15 | Stochastic selection (0 = greedy, 1 = very random) |
| Seed | 1234 | Random seed for reproducibility |
Dynamics Parameters
| Parameter | Default | Description |
|---|---|---|
| Velocity_weight | 0.0 | 0 = position only, 1 = direction only, blends both |
| Coupling | 0.0 | Feedback strength (events bend trajectory toward them) |
Audio Parameters
| Parameter | Default | Description |
|---|---|---|
| Crossfade_ms | 10 | Crossfade between events (ms) |
| Crossfade_jitter_ms | 1.5 | Random variation in crossfade |
| Min_event_duration_ms | 30 | Minimum event length (ms) |
Segmentation Parameters
| Parameter | Default | Description |
|---|---|---|
| Silence_threshold_dB | -25 | dB below which is silence |
| Min_silent_interval | 0.05 | Minimum silence for segmentation (s) |
| Min_sounding_interval | 0.03 | Minimum sounding interval (s) |
Output
| Parameter | Default | Description |
|---|---|---|
| Draw_visualization | 1 | Generate 5-panel analysis display |
| Play_result | 1 | Audition after processing |
| Debug | 0 | Write verbose debug log |
Visualization & Analysis
5-Panel Display
Reading the Phase-Space Info Panel
- Source events: Number of events detected in input
- Output steps: Number of events in composition (num_events_output)
- Unique used: How many distinct source events were selected
- Repetition rate: (output - unique)/output — higher = more repetition
- Trajectory speed: Mean step distance in feature space — how fast attractor moves
- Attractor description: Brief explanation of each attractor's musical character
Interpreting Event Boundaries
- Each red vertical line marks the start of a detected event
- Events are based on silence threshold and min durations
- The number of events determines the source material available to the attractor
Applications
Electroacoustic Composition
Use case: Creating compositions whose temporal structure follows attractor dynamics
Technique: Lorenz or Rössler attractors on varied source material
Workflow:
- Select a 20-60 second recording with diverse acoustic events
- Run with Lorenz attractor, 3D state, num_events=400
- Listen to how the chaotic but structured trajectory creates a narrative
- Export and use as movement in larger work
Algorithmic Composition
Use case: Generating new structures from existing material
Technique: Compare different attractors on same source
Examples:
- Hopf: Cyclic, repetitive structures
- Lorenz: Chaotic but structured narratives
- Rössler: Tension/release cycles
- Logistic: Bursts and regime shifts
Sound Design for Media
Use case: Creating evolving textures with specific dynamical characters
Technique: Weight presets to emphasize different acoustic qualities
Applications:
- Brightness focus: Weight preset "Brightness" emphasizes centroid
- Noisy textures: "Noisiness" emphasizes flatness and entropy
- Rhythmic focus: "Transient" emphasizes flux
Research & Education
Use case: Studying dynamical systems through auditory display
Technique: Enable debug mode, compare attractors on simple sources
Learning outcomes:
- Hear differences between periodic, chaotic, and intermittent dynamics
- Understand how phase space maps to perceptual features
- Explore effects of velocity weight and coupling
- Observe tabu and temperature effects on repetition
Practical Workflow Examples
🎬 Film Scene: Chaotic Narrative
Goal: Create 60-second cue representing chaotic psychological state
Settings:
- Source: 30-second ambient recording
- Attractor: Lorenz, 3D
- Velocity_weight=0.3, coupling=0.1
Result: Chaotic but structured event sequence — psychological turmoil
🎚️ Electronic Music: Cyclic Pad
Goal: Create evolving pad with cyclic variations
Settings:
- Source: 8-second synth pad
- Attractor: Hopf, 2D (centroid+flatness)
- num_events=200, temperature=0.1
Result: Smooth cyclic variations in brightness and noisiness
🎙️ Voice Processing: Bursting Speech
Goal: Create bursts of speech fragments
Settings:
- Source: 10-second spoken phrase
- Attractor: LogisticMap, 3D
- Temperature=0.25, tabu=8
Result: Intermittent bursts of speech, regime shifts
Troubleshooting Common Issues
Cause: Python not installed, or packages missing
Solution: Install Python and required packages: pip install numpy soundfile
Cause: Silence threshold too high/low, or source has no clear events
Solution: Adjust silence_threshold_dB, reduce min_event_duration_ms
Cause: Temperature too low, tabu too short, or attractor not exploring
Solution: Increase temperature, increase tabu, try different attractor
Cause: Crossfade too short or events too short
Solution: Increase crossfade_ms, increase min_event_duration_ms
Cause: Attractor settled into fixed point (rare)
Solution: Use different initial conditions (change seed), or different attractor
Advanced Techniques
Edit dimWeights$ in the Praat script to create custom weight combinations for specific perceptual focuses.
In the Python script, modify the attractor parameters (σ, ρ, β, a, b, c, r) to change the dynamics.
For LogisticMap, the embedding dimension D is set by state_dims — higher dimensions capture more history.
Script converts to mono for analysis; output preserves original channel count. For multichannel, modify reconstruction to handle each channel separately.