Temporal Turing Morph — User Guide
Applies a 1D reaction-diffusion (Turing) process to a sequence of audio segments, using the emergent stripe pattern to creatively reorder them in time. Unlike granular synthesis (ms-scale grains), this operates at the EVENT scale (5ms–2000ms).
What this does
This script implements a Temporal Turing Morph — a creative reordering engine that applies a 1D reaction-diffusion (Turing) process to a sequence of audio segments. The emergent stripe pattern from the Turing instability becomes the reordering logic, creating novel temporal structures based on mathematical pattern formation.
🧪 What is a Turing Reaction-Diffusion Process?
Alan Turing's 1952 paper on morphogenesis proposed that interacting chemicals could form stable patterns (stripes, spots) through reaction-diffusion dynamics. The 1D Gierer-Meinhardt model used here:
When D_i >> D_a, the system spontaneously forms periodic stripe patterns. In this tool, the 1D "space" is the sequence of audio segments, and the emergent stripes determine how segments are reordered.
Key Features:
- 6 Preset Strategies — Temporal Stutter to Tectonic Rupture, plus Custom
- Event-Scale Operation — Segments from 5ms to 2000ms (grains to phrases)
- Gierer-Meinhardt 1D R-D — Fully implemented with explicit Euler integration
- 3 Reorder Modes — Sort (Turing rank), Displace (Turing shift), StripeRev (palindrome within stripes)
- Arc Modes — Expand-Collapse, Collapse-Regrow, Pulse — shape reaction rate over iterations
- Drift & Rupture — Moving hotspot and stochastic burst injection for complex dynamics
- Morph Blend — Interpolate between original and Turing order (0-1)
- Energy Seeding — RMS envelope seeds the activator so pattern "grows out of" the audio
- Comprehensive Visualization — 6-panel display with activator stripe, permutation map, waveforms, energy evolution
Technical Implementation: (1) Segmentation: Divide source into N fixed-length segments. (2) R-D Initialization: Flat+noise or energy-seeded. (3) Iteration: Explicit Euler with reflective boundaries, arc-shaped reaction rate, drift bias, rupture events. (4) Permutation: Compute from final activator pattern (sort, displace, or striperev). (5) Morph Blend: Interpolate with identity, resolve duplicates. (6) Assembly: Apply cosine crossfade, concatenate in final order.
Quick start
- In Praat, select exactly one Sound object (minimum 50 ms, any content).
- Run script… → select
Temporal_Turing_Morph.praat. - Choose Preset (2-7 for specific strategies, 1 for custom).
- Set chunk duration (ms) — determines segment size and count.
- Configure R-D parameters (diffusion, reaction, inhibition, iterations).
- Select reorder mode and adjust max displacement if using Displace mode.
- Set morph amount (0 = original order, 1 = full Turing order).
- Enable Draw_visualization for analysis display.
- Click OK — engine segments, runs R-D, computes permutation, reassembles.
Turing Reaction-Diffusion Theory
The Gierer-Meinhardt Model
📈 1D Reaction-Diffusion Equations
Turing instability condition: D_i / D_a must be sufficiently large (typically > 10) for periodic stripe patterns to emerge spontaneously from noise.
Discrete Implementation
Arc Modes — Shaping Reaction Rate
📊 Temporal Dramaturgy
The reaction rate r varies over iterations according to arc_mode:
| Mode | Description | r(t) profile |
|---|---|---|
| Off | Constant r throughout | r(t) = r_base |
| Expand-Collapse | Rises to peak at 65%, sharp drop after | r(t) = r_base × (1 - arc_strength + arc_strength × f(t)) where f(t) increases to 1 at 65%, then drops rapidly |
| Collapse-Regrow | U-shaped, minimum at midpoint | r(t) = r_base × (1 - arc_strength + arc_strength × (1 - 4·t·(1-t))) |
| Pulse | Two sinusoidal cycles of tension/release | r(t) = r_base × (0.5 + 0.5·cos(4π·t)) |
Arc_strength controls the depth of modulation (0 = constant, 1 = full modulation).
Drift & Rupture
Reorder Modes
| Mode | Description | Musical Effect |
|---|---|---|
| Sort (Turing rank) | Output segments sorted by ascending Turing activator value | Clusters of similar "energy" — rhythmic crystallization, repeating blocks |
| Displace (Turing shift) | Each segment shifts forward/back by amount proportional to (A[i] - mean) | Local smearing, memory erosion — Turing high spots pull segments forward, low spots push them back |
| StripeRev | Within each contiguous Turing stripe (high or low band), internal segment order is reversed | Palindromic micro-structures, retrograde pockets inside forward motion |
Morph Blend & Duplicate Resolution
Preset Strategies
Preset 2: Temporal Stutter
⏱️ Frozen Stripe Pattern
Chunk: 20 ms | Diffusion: 2.5 | Reaction: 0.35 | Inhibition: 0.30
Iterations: 50 | Reorder: Sort | Seed: Flat+noise
Character: Short chunks, high diffusion → frozen stripe pattern, stutter-like repetition
Use on: Percussion, glitch textures, rhythmic material
Preset 3: Phrase Scrambler
🔄 Mid-Level Reordering
Chunk: 250 ms | Diffusion: 1.5 | Reaction: 0.60 | Inhibition: 0.30
Iterations: 7 | Reorder: Sort | Seed: Energy-seeded
Character: Medium chunks, volatile reaction — scrambles phrases based on energy
Use on: Speech, instrumental phrases, melodic material
Preset 4: Memory Erosion
🌊 Gradual Displacement
Chunk: 400 ms | Diffusion: 1.2 | Reaction: 0.25 | Inhibition: 0.40
Iterations: 20 | Reorder: Displace | Seed: Energy-seeded
Morph: 0.75 | Max displace: 8
Character: Long chunks, displacement mode — segments shift gradually, eroding original order
Use on: Ambient, drone, long-form textures
Preset 5: Rhythmic Crystal
💎 Tight Stripe Clusters
Chunk: 50 ms | Diffusion: 0.05 | Reaction: 0.15 | Inhibition: 0.85
Iterations: 80 | Reorder: Sort | Seed: Flat+noise
Character: High inhibition → very tight stripes, sorted into crystalline clusters
Use on: Rhythmic patterns, crystallized textures
Preset 6: Narrative Arc
📈 Expand then Collapse
Chunk: 120 ms | Diffusion: 1.2 | Reaction: 0.30 | Inhibition: 0.25
Iterations: 40 | Reorder: Sort | Seed: Energy-seeded
Arc: Expand-Collapse (strength=0.9)
Character: Reaction rate expands then collapses, creating narrative tension arc
Use on: Narrative structures, dramatic builds
Preset 7: Tectonic Rupture
🌋 Drift + Burst Events
Chunk: 80 ms | Diffusion: 1.5 | Reaction: 0.25 | Inhibition: 0.30
Iterations: 35 | Reorder: Displace | Seed: Energy-seeded
Drift: 1.2 | Rupture prob: 0.12
Character: Drifting hotspot plus stochastic bursts — creates sudden ruptures in pattern
Use on: Experimental, chaotic textures, tectonic shifts
Parameters & Controls
Segment Parameters
| Parameter | Default | Description |
|---|---|---|
| Chunk_duration_ms | 80.0 | Length of each segment (5-2000 ms) |
Reaction-Diffusion Parameters
| Parameter | Default | Description |
|---|---|---|
| Diffusion_rate | 1.0 | Scales both D_a (0.08×) and D_i (4.0×) — larger = faster diffusion |
| Reaction_rate | 0.20 | Base reaction rate r (activator self-enhancement) |
| Inhibition_strength | 0.30 | Inhibition strength s (how strongly inhibitor suppresses activator) |
| Iterations | 25 | Number of R-D time steps (1-200) |
| Pattern_density | 0.05 | Initial noise amplitude for Flat+noise seed mode |
Reorder Parameters
| Parameter | Default | Description |
|---|---|---|
| Reorder_mode | Sort | Sort (Turing rank), Displace (Turing shift), or StripeRev |
| Max_displacement_segments | 10 | Maximum shift in Displace mode (segments) |
| Morph_amount | 1.0 | 0 = original order, 1 = full Turing order |
Seed Mode
| Parameter | Default | Description |
|---|---|---|
| Seed_mode | Flat+noise | Flat+noise (pure mathematical) or Energy-seeded (RMS envelope) |
Arc & Dramaturgy Parameters
| Parameter | Default | Description |
|---|---|---|
| Arc_mode | Off | Off, Expand-Collapse, Collapse-Regrow, Pulse |
| Arc_strength | 0.8 | Depth of arc modulation (0-1) |
| Drift_strength | 0.0 | Intensity of moving hotspot (0-3) |
| Rupture_prob | 0.0 | Probability of burst event per iteration (0-0.5) |
Output Parameters
| Parameter | Default | Description |
|---|---|---|
| Crossfade_ms | 5.0 | Cosine fade duration between segments |
| Normalize_output | 1 | Scale output to peak 0.99 |
| Draw_visualization | 1 | Generate 6-panel analysis display |
| Play_result | 1 | Audition after processing |
Visualization & Analysis
6-Panel Display
Reading the Activator Stripe
- Vertical bars: Height = activator value A[i] — higher values indicate "hotter" segments in Turing space
- Color gradient: Blue = low, orange = high — visualizes the pattern
- Mean line: Segments above/below mean form "stripes" — contiguous runs on same side
- Stripe structure: The pattern of highs and lows determines reordering (e.g., in StripeRev mode, each contiguous run is reversed internally)
Reading the Permutation Map
- Each tick represents one segment in the output
- Horizontal position: Original segment index
- Vertical position: Output position (row)
- Deviation from diagonal: How much reordering occurred — large deviations = radical restructuring
- Clusters: Groups of ticks near same vertical region indicate segments that stayed together in output
- Color: Same as activator stripe — helps trace which segments moved where
Applications
Electroacoustic Composition
Use case: Creating novel temporal structures from existing material
Technique: Narrative Arc or Memory Erosion presets on varied sources
Workflow:
- Select a 20-60 second recording with clear segmentation potential
- Adjust chunk duration to get 20-50 segments
- Apply Narrative Arc preset for dramatic shape
- Listen to how the Turing pattern creates tension arc
- Export and use as movement in larger work
Rhythmic & Glitch Effects
Use case: Creating stutter, glitch, or crystallized rhythms
Technique: Temporal Stutter or Rhythmic Crystal presets on percussive material
Settings:
- Stutter: Temporal Stutter (20ms chunks, Sort mode) — creates repeating micro-patterns
- Glitch: Tectonic Rupture with drift + rupture — creates chaotic burst textures
- Crystallized rhythms: Rhythmic Crystal (50ms, high inhibition) — tight stripe clusters
Sound Design for Media
Use case: Creating evolving textures, transitions, ruptures
Technique: Tectonic Rupture or Memory Erosion on appropriate sources
Applications:
- Horror/thriller: Tectonic Rupture with rupture_prob=0.2 — sudden bursts of energy
- Sci-fi: Memory Erosion with Displace mode — gradual temporal drift
- Transitions: Narrative Arc — builds to peak then collapses
Research & Education
Use case: Demonstrating Turing patterns, reaction-diffusion, morphogenesis
Technique: Enable visualization, compare presets on simple test signals
Learning outcomes:
- See how Turing instability creates periodic stripe patterns
- Understand relationship between diffusion ratio and pattern formation
- Observe how arc modes shape evolution over time
- Hear how mathematical patterns translate to temporal structures
Practical Workflow Examples
🎬 Film Scene: Tension Buildup
Goal: Create 45-second tension cue from 30-second drone
Settings:
- Source: 30-second low drone
- Preset: Narrative Arc
- Custom: chunk=150 ms, iterations=60, arc_strength=1.0
- Reorder: Sort (Turing rank)
Result: Turing pattern expands then collapses, creating tension arc
🎚️ Electronic Music: Glitch Breakdown
Goal: Create glitchy breakdown from 8-bar drum loop
Settings:
- Source: 8-bar drum loop
- Preset: Tectonic Rupture
- Custom: chunk=30 ms, rupture_prob=0.25, drift_strength=2.0
Result: Chaotic glitch texture with sudden burst events
🎙️ Voice Processing: Temporal Displacement
Goal: Create "memory erosion" effect on spoken phrase
Settings:
- Source: 10-second spoken phrase
- Preset: Memory Erosion
- Custom: morph_amount=0.6 (partial reordering)
Result: Segments gradually shift, creating sense of temporal distortion
Troubleshooting Common Issues
Cause: Diffusion ratio too low (D_i/D_a < 10), or iterations too few
Solution: Increase diffusion_rate, increase iterations, check inhibition_strength
Cause: reaction_rate too high, inhibition_strength too low
Solution: Reduce reaction_rate, increase inhibition_strength
Cause: Crossfade too short or not applied
Solution: Increase crossfade_ms (10-20 ms), ensure crossfade applied
Cause: chunk_duration_ms too large for source duration
Solution: Reduce chunk_duration_ms, ensure at least 2 segments
Cause: morph_amount causing many conflicts
Solution: Reduce morph_amount, or accept that duplicates are resolved deterministically
Advanced Techniques
Modify the Gierer-Meinhardt equations in the script to use different kinetics (e.g., FitzHugh-Nagumo, Brusselator) for different pattern types.
For stereo sources, the script converts to mono. To preserve stereo, modify to process each channel separately with same R-D pattern (or different seeds).
The script uses fixed chunk duration. For variable segmentation, pre-segment using TextGrid and modify extraction accordingly.
Use Energy-seeded mode to have the RMS envelope influence initial pattern. For even more control, modify script to accept external activation vector.