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).

Author: Shai Cohen Version: 1.0 (2025) Technique: 1D Turing Reaction-Diffusion Category: Temporal / Experimental / Composition Citation: Cohen, S. (2025). Praat AudioTools
Contents:

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:

dA/dt = D_a·∇²A + r·A·(1 - A/K) - s·A·I dI/dt = D_i·∇²I + r·A - s·I where: A = activator (self-enhancing) I = inhibitor (suppresses activator) D_i >> D_a = Turing instability condition

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:

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

  1. In Praat, select exactly one Sound object (minimum 50 ms, any content).
  2. Run script… → select Temporal_Turing_Morph.praat.
  3. Choose Preset (2-7 for specific strategies, 1 for custom).
  4. Set chunk duration (ms) — determines segment size and count.
  5. Configure R-D parameters (diffusion, reaction, inhibition, iterations).
  6. Select reorder mode and adjust max displacement if using Displace mode.
  7. Set morph amount (0 = original order, 1 = full Turing order).
  8. Enable Draw_visualization for analysis display.
  9. Click OK — engine segments, runs R-D, computes permutation, reassembles.
Quick tip: Start with Phrase Scrambler preset on a 10-20 second recording with clear phrasing. Enable visualization — you'll see the Turing activator stripe (blue-orange gradient), the permutation map (deviation from diagonal), and the energy evolution. Listen to how segments are reordered based on the mathematical pattern. The output appears as "source_TemporalTuring" in the Objects window.
Important: CHUNK DURATION determines segment count — must be small enough to give at least 2 segments. TURING INSTABILITY requires D_i >> D_a (the script sets D_i = 4.0 × diffusion_rate, D_a = 0.08 × diffusion_rate). STABILITY of explicit Euler is ensured by dtSafe = 0.85/(4.0×D_i). RUPTURE EVENTS inject bursts of activator energy, creating sudden changes in pattern — use with caution. MORPH BLEND interpolates between identity and Turing order; duplicate resolution ensures valid permutation.

Turing Reaction-Diffusion Theory

The Gierer-Meinhardt Model

📈 1D Reaction-Diffusion Equations

Activator: ∂A/∂t = D_a·∇²A + r·A·(1 - A/K) - s·A·I Inhibitor: ∂I/∂t = D_i·∇²I + r·A - s·I Where: ∇²A = discrete 1D Laplacian over segment index axis: ∇²A[i] = A[i-1] - 2·A[i] + A[i+1] (reflective boundaries) Parameters: D_a, D_i = diffusion rates (D_i >> D_a for Turing instability) r = reaction rate (activator self-enhancement) s = inhibition strength K = saturation ceiling (fixed at 5.0 in script)

Turing instability condition: D_i / D_a must be sufficiently large (typically > 10) for periodic stripe patterns to emerge spontaneously from noise.

Discrete Implementation

For N segments, vectors A[1..N], I[1..N] evolve via explicit Euler: For each iteration: 1. Pad arrays with reflective boundaries: A[0]=A[2], A[N+1]=A[N-1] 2. Compute Laplacian: L[i] = A[i-1] - 2·A[i] + A[i+1] 3. Update: dA[i] = D_a·L_act[i] + r·A[i]·(1 - A[i]/K) - s·A[i]·I[i] dI[i] = D_i·L_inh[i] + r·A[i] - s·I[i] 4. A[i] += dt·dA[i] + noise I[i] += dt·dI[i] 5. Clamp to [0, K] and enforce non-negativity

Arc Modes — Shaping Reaction Rate

📊 Temporal Dramaturgy

The reaction rate r varies over iterations according to arc_mode:

ModeDescriptionr(t) profile
OffConstant r throughoutr(t) = r_base
Expand-CollapseRises to peak at 65%, sharp drop afterr(t) = r_base × (1 - arc_strength + arc_strength × f(t)) where f(t) increases to 1 at 65%, then drops rapidly
Collapse-RegrowU-shaped, minimum at midpointr(t) = r_base × (1 - arc_strength + arc_strength × (1 - 4·t·(1-t)))
PulseTwo sinusoidal cycles of tension/releaser(t) = r_base × (0.5 + 0.5·cos(4π·t))

Arc_strength controls the depth of modulation (0 = constant, 1 = full modulation).

Drift & Rupture

Drift: A Gaussian hotspot moves across segment positions: bias[i] = 1 + drift_strength × exp(-(i - center)² / σ²) where center moves linearly from segment 1 to N over iterations. Rupture: Stochastic bursts of activator energy: With probability rupture_prob per iteration: pick random center, inject burst = rupture_strength × exp(-dist²/2) into activator at nearby positions (distance ≤ 4)

Reorder Modes

ModeDescriptionMusical Effect
Sort (Turing rank)Output segments sorted by ascending Turing activator valueClusters 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
StripeRevWithin each contiguous Turing stripe (high or low band), internal segment order is reversedPalindromic micro-structures, retrograde pockets inside forward motion

Morph Blend & Duplicate Resolution

blended[j] = round((1-morph) × j + morph × turingOrder[j]) Duplicate resolution (first-come-first-served): 1. Place unique indices first 2. Fill remaining slots with unused indices in order This ensures final permutation is valid (bijection 1..N → 1..N).

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

ParameterDefaultDescription
Chunk_duration_ms80.0Length of each segment (5-2000 ms)

Reaction-Diffusion Parameters

ParameterDefaultDescription
Diffusion_rate1.0Scales both D_a (0.08×) and D_i (4.0×) — larger = faster diffusion
Reaction_rate0.20Base reaction rate r (activator self-enhancement)
Inhibition_strength0.30Inhibition strength s (how strongly inhibitor suppresses activator)
Iterations25Number of R-D time steps (1-200)
Pattern_density0.05Initial noise amplitude for Flat+noise seed mode

Reorder Parameters

ParameterDefaultDescription
Reorder_modeSortSort (Turing rank), Displace (Turing shift), or StripeRev
Max_displacement_segments10Maximum shift in Displace mode (segments)
Morph_amount1.00 = original order, 1 = full Turing order

Seed Mode

ParameterDefaultDescription
Seed_modeFlat+noiseFlat+noise (pure mathematical) or Energy-seeded (RMS envelope)

Arc & Dramaturgy Parameters

ParameterDefaultDescription
Arc_modeOffOff, Expand-Collapse, Collapse-Regrow, Pulse
Arc_strength0.8Depth of arc modulation (0-1)
Drift_strength0.0Intensity of moving hotspot (0-3)
Rupture_prob0.0Probability of burst event per iteration (0-0.5)

Output Parameters

ParameterDefaultDescription
Crossfade_ms5.0Cosine fade duration between segments
Normalize_output1Scale output to peak 0.99
Draw_visualization1Generate 6-panel analysis display
Play_result1Audition after processing

Visualization & Analysis

6-Panel Display

Temporal Turing Morph Visualization: Panel 1: TITLE • Script name, source name, segment count, chunk size, iterations, reorder mode, morph amount Panel 2: TURING ACTIVATOR STRIPE • X-axis: Segment index (1 to N) • Y-axis: Activator value A(i) • Vertical bars colored blue→orange gradient (low→high) • Dotted line = mean activator value • Title: "1D Turing activator (stripe structure → reordering)" Panel 3: PERMUTATION MAP • X-axis: Original segment index • Y-axis: Output position • Dotted diagonal = identity • Colored ticks (same gradient) show mapping from original segment to output position • Title: "Permutation map (diagonal = identity, deviation = Turing reorder)" Panel 4: INPUT WAVEFORM • Original waveform with amplitude scale • Title: "Original: filename" Panel 5: OUTPUT WAVEFORM • Reordered waveform in green • Title: "output_filename" • X-axis: Time (s) Panel 6: ACTIVATOR ENERGY EVOLUTION • X-axis: Iteration (1 to iterations) • Y-axis: Mean activator value • Color gradient from blue (early) to orange (late) • Gold dotted line = initial energy • Faint gold line = arc profile (if arc_mode active) • Title: "Activator energy (gold = arc profile, color = iteration progress)" Panel 7: R-D PARAMETER SUMMARY • Diffusion rates, reaction/inhibition, dt, iterations, segment count • Chunk size, morph amount, arc mode & strength, drift, rupture probability • Reorder mode

Reading the Activator Stripe

What the stripes tell you:
  • 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

What the ticks mean:
  • 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:

Rhythmic & Glitch Effects

Use case: Creating stutter, glitch, or crystallized rhythms

Technique: Temporal Stutter or Rhythmic Crystal presets on percussive material

Settings:

Sound Design for Media

Use case: Creating evolving textures, transitions, ruptures

Technique: Tectonic Rupture or Memory Erosion on appropriate sources

Applications:

Research & Education

Use case: Demonstrating Turing patterns, reaction-diffusion, morphogenesis

Technique: Enable visualization, compare presets on simple test signals

Learning outcomes:

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

Problem: No pattern formation (activator remains flat)
Cause: Diffusion ratio too low (D_i/D_a < 10), or iterations too few
Solution: Increase diffusion_rate, increase iterations, check inhibition_strength
Problem: Pattern too chaotic/random
Cause: reaction_rate too high, inhibition_strength too low
Solution: Reduce reaction_rate, increase inhibition_strength
Problem: Output has clicks at segment boundaries
Cause: Crossfade too short or not applied
Solution: Increase crossfade_ms (10-20 ms), ensure crossfade applied
Problem: Fewer segments than expected
Cause: chunk_duration_ms too large for source duration
Solution: Reduce chunk_duration_ms, ensure at least 2 segments
Problem: Duplicate resolution creating unexpected order
Cause: morph_amount causing many conflicts
Solution: Reduce morph_amount, or accept that duplicates are resolved deterministically

Advanced Techniques

Custom reaction-diffusion parameters:

Modify the Gierer-Meinhardt equations in the script to use different kinetics (e.g., FitzHugh-Nagumo, Brusselator) for different pattern types.

Multi-channel processing:

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).

Time-varying chunk size:

The script uses fixed chunk duration. For variable segmentation, pre-segment using TextGrid and modify extraction accordingly.

Externally seeded patterns:

Use Energy-seeded mode to have the RMS envelope influence initial pattern. For even more control, modify script to accept external activation vector.