Temporal Turing Morph — User Guide

Reorders fixed-duration audio events with a 1D activator–inhibitor reaction–diffusion simulation. The final spatial activator pattern becomes a permutation controller, with Sort, Displace, and StripeRev reordering, a monotonic morph between identity and the target order, optional energy seeding, arc/drift/rupture shaping, and multichannel-preserving reassembly.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.3 (2026) License: MIT License Repo: GitHub
Contents:

What this does

Temporal Turing Morph divides one selected Sound into event-scale segments, runs a one-dimensional reaction–diffusion simulation across the segment index axis, converts the final activator state into a segment permutation, then concatenates the original multichannel segments in that order.

Important conceptual distinction: the implemented activator–inhibitor kinetics are inspired by Turing-style reaction–diffusion pattern formation, but they do not form a canonical Turing bifurcation. The spatial structure used for reordering is seeded by the initial perturbation and per-iteration stochastic term, then shaped by diffusion and the optional arc, drift, and rupture controls.
selected Sound → fixed-time segmentation → optional RMS energy seed → 1D activator–inhibitor evolution → final activator pattern A[i] → Sort / Displace / StripeRev target order → monotonic morph from identity → cosine edge taper per segment → sequential concatenation → optional target peak 0.99

Arc, drift, and rupture operate inside the simulation. They change the single final permutation; they do not animate an expand/collapse/drift gesture along the output audio timeline.

Quick start

  1. Select exactly one Sound of at least 50 ms.
  2. Run Temporal_Turing_Morph.praat.
  3. Choose Custom or one of the six named presets.
  4. Set Chunk_duration_ms to define the event scale.
  5. Choose Sort, Displace, or StripeRev.
  6. Set Morph_amount from 0 for identity order to 1 for the complete target permutation.
  7. Choose Flat + noise or Energy-seeded initialization.
  8. Optionally set Arc, Drift, Rupture, and Random_seed.
  9. Run. The result is named <source>_TemporalTuring.

Reaction–diffusion model

For each segment index i, the script evolves activator A and inhibitor I:

dA/dt = D_a × Lap1D(A) + r × A × (1 - A / K) - s × A × I dI/dt = D_i × Lap1D(I) + r × A - s × I

The fixed saturation ceiling is K = 5. Diffusion coefficients are:

D_a = 0.08 × Diffusion_rate D_i = 4.00 × Diffusion_rate

The ratio D_i / D_a is therefore always 50 for this implementation.

Reflective boundaries

The 1D Laplacian uses reflected endpoint values and:

Lap1D(A[i]) = A[i-1] - 2A[i] + A[i+1]

Explicit Euler step

The time step is chosen from a fixed worst-case diffusion ceiling and the current Drift_strength:

dt = 0.85 / ( 4 × 20 × (1 + Drift_strength) )

This keeps the same stable step sizing across the allowed Diffusion_rate range while allowing Diffusion_rate itself to scale the effective diffusion per iteration.

Per-iteration perturbation

Every activator cell also receives a small Gaussian stochastic term of fixed standard deviation 0.02 on every iteration. A and I are clamped to 0…5 after the Euler update, before any rupture injection.

Segmentation & channel handling

The requested chunk duration is internally clamped to 5…2000 ms. Segment count is:

N = ceiling( sourceDuration / chunkDuration )

The complete source is covered. The final segment may therefore be shorter than Chunk_duration_ms.

500-segment cap

If the requested chunk would create more than 500 segments, the script enlarges the effective chunk duration to:

effectiveChunk = sourceDuration / 500

so that all source material is still retained in exactly 500 segments.

Channels

The processing copy preserves the source channel count. Stereo and multichannel inputs are not folded to mono for synthesis. Every extracted segment keeps all original channels, and reordering applies the same segment permutation to every channel.

Energy seeding uses Praat's RMS measurement directly on each multichannel segment, producing one scalar RMS value per segment.

A private processing copy is shifted to time 0 when necessary. The user's original Sound and its original time domain remain unchanged.

Seed modes

Flat + noise

A[i] = 0.5 + Initial_perturbation × Gaussian(0,1)

Energy-seeded

Each segment RMS is divided by the maximum segment RMS and then perturbed:

A[i] = segmentRMS[i] / maxSegmentRMS + Initial_perturbation × Gaussian(0,1)

Negative initial activator values are clamped to zero. In both modes the inhibitor is initialized to the same value as the activator:

I[i] = A[i]

Arc, drift & rupture

Arc modes

Arc_mode modifies the reaction rate across simulation iterations:

r(iter) = Reaction_rate × ( 1 - Arc_strength + Arc_strength × arcFactor(iter) )
ModearcFactor
OffConstant 1.
Expand-CollapseLinear rise to 1 at 65% of the simulation, followed by a steeper fall with a minimum factor of 0.05.
Collapse-RegrowU-shaped 1 − 4t(1−t), with a 0.05 floor.
Pulse0.5 + 0.5 cos(4πt), giving two cosine cycles.

The resulting reaction rate itself is clamped to a minimum of 0.001.

Drift

Drift_strength creates a Gaussian-shaped multiplier that travels from the first to the last segment over the simulation:

localBias[i] = 1 + Drift_strength × exp( -(i - center)^2 / spread^2 ) spread = max(N / 4, 2)

This multiplier acts on the diffusion terms for both activator and inhibitor. It does not directly add activator energy.

Rupture

On each iteration, Rupture_prob is the probability of one rupture event. A random segment center is chosen and activator energy is added within ±4 segments:

burst(distance) = 2.5 × exp( -0.5 × distance^2 )

Rupture is injected after the normal 0…5 clamp and can therefore temporarily raise the activator above the saturation ceiling until later iterations reshape it.

Reorder modes

Sort — R-D rank

Segments are sorted by ascending final activator value. Output slot 1 receives the segment with the smallest A value, and so on.

Displace — R-D shift

Each original segment receives a target position:

shift[i] = round( (A[i] - mean(A)) / maxDeviationFromMean × Max_displacement_segments ) targetPosition[i] = i + shift[i]

The segments are then sorted by targetPosition. The normalization by the largest actual deviation from the mean keeps the absolute shift within the requested Max_displacement_segments.

StripeRev — band palindrome

The script labels contiguous runs according to whether their activator is above the final mean. Every run is then reversed internally, while the sequence of runs remains in original order.

Morph amount

Morph_amount is clamped to 0…1.

ValueOrder
0Identity: original segment order.
1Complete target R-D permutation.
BetweenA proportional prefix of adjacent swaps needed to transform identity into the target permutation.

For intermediate values the script first derives the adjacent-transposition sequence corresponding to the target order, then applies:

numberOfAppliedSwaps = round( Morph_amount × totalRequiredSwaps )

The result is always a valid permutation. Increasing Morph_amount increases the number of target-building swaps rather than interpolating and rounding segment indices.

Edge taper & assembly

Before reassembly, each segment can receive an independent cosine fade-in and fade-out. Taper duration is limited to 40% of that segment's actual duration:

effectiveTaper = min( Edge_taper_ms / 1000, 0.40 × segmentDuration )

The taper stage is skipped when the requested duration is 0.5 ms or less.

Edge_taper_ms is not a crossfade duration. Segments are concatenated sequentially with no overlap. The taper simply attenuates the edges of each segment before the butt join.

Because every source segment appears exactly once in the final permutation and tapering does not change duration, the reordered result preserves the source duration, subject only to normal sample-grid representation.

Presets

PresetChunkD / R / IIterSeedReorder / MorphArc / Drift / RuptureTaper
Temporal Stutter20 ms2.5 / 0.35 / 0.3050Flat + noiseSort / 1.0Off / 0 / 02 ms
Phrase Scrambler250 ms1.5 / 0.60 / 0.307EnergySort / 1.0Off / 0 / 012 ms
Memory Erosion400 ms1.2 / 0.25 / 0.4020EnergyDisplace / 0.75Off / 0 / 020 ms
Rhythmic Crystal50 ms0.05 / 0.15 / 0.8580Flat + noiseSort / 1.0Off / 0 / 03 ms
Narrative Arc120 ms1.2 / 0.30 / 0.2540EnergySort / 1.0Expand-Collapse 0.9 / 0 / 08 ms
Tectonic Rupture80 ms1.5 / 0.25 / 0.3035EnergyDisplace / 1.0Off / 1.2 / 0.126 ms

Named presets also set Initial_perturbation and Max_displacement_segments. They do not overwrite Random_seed, Normalize_output, Draw_visualization, or Play_result.

Parameters & effective limits

ParameterDefaultEffective behavior
Chunk_duration_ms80Clamped to 5…2000 ms; may be enlarged further to respect the 500-segment cap.
Diffusion_rate1.0Clamped to 0.001…5; scales Da and Di.
Reaction_rate0.20Clamped to 0.001…1.
Inhibition_strength0.30Clamped to 0.01…2.
Iterations25Clamped to 1…200.
Initial_perturbation0.05Gaussian seed amplitude, clamped to 0.001…0.5.
Reorder_modeSortSort, Displace, or StripeRev.
Max_displacement_segments10Used by Displace; clamped to 1…100.
Morph_amount1.0Clamped to 0…1.
Seed_modeFlat + noiseFlat stochastic seed or normalized segment RMS plus perturbation.
Edge_taper_ms5Negative values become 0; effective taper is at most 40% of each segment.
Arc_modeOffOff, Expand-Collapse, Collapse-Regrow, or Pulse.
Arc_strength0.8Clamped to 0…1.
Drift_strength0Moving diffusion multiplier, clamped to 0…3.
Rupture_prob0Probability per simulation iteration, clamped to 0…0.5.
Random_seed0Positive value = predictable simulation; zero or negative = safe unpredictable RNG.
Normalize_outputOnTarget Sinc70 peak scaling to 0.99 for non-silent output.
Draw_visualizationOnDraw the R-D/reordering analysis view.
Play_resultOnPlay the completed result.

Visualization

The v1.3 Picture view contains:

  1. Title bar — source, effective segment count/chunk size, iteration count, reorder mode and morph.
  2. Activator pattern — final A[i] values with a mean reference line.
  3. Permutation map — output position versus original segment index, with identity diagonal.
  4. Original waveform.
  5. Output waveform.
  6. Activator mean evolution across iterations, with an arc-profile overlay when Arc_mode is active.
  7. R-D parameter summary.

Activator color

The blue-to-orange bar colors progress by segment index. Bar height is the actual final activator value. Color itself does not encode activator magnitude.

Permutation map color

Map ticks use a blue-to-orange progression by output slot. Their coordinates carry the mapping: x = original segment, y = output position.

Waveform scale

The input and output waveform panels use separate amplitude scales based on their own peaks. They are not a shared-amplitude comparison.

Energy panel

The plotted curve is mean activator after each simulation iteration. The dotted reference is the mean after iteration 1. When active, the arc profile is rescaled into the same panel for visual reference; it is not plotted in physical reaction-rate units.

Output behavior