Cellular Automata Synthesis — User Guide
Algorithmic audio generation: maps cellular automata (1D elementary rules, Game of Life, Brian's Brain) to sound—each active cell triggers a sine oscillator, creating evolving rhythmic/textural patterns from computational emergence.
What this does
This script implements cellular automata synthesis — a technique that translates the discrete, grid‑based evolution of cellular automata into audio. Three CA families are supported: (1) Elementary CA (1D): Wolfram's 256 rules (e.g., Rule 30, 90, 110), where each cell's state depends on its left/center/right neighbors. (2) Game of Life (2D): Conway's classic rule (B3/S23) for birth/survival. (3) Brian's Brain (2D): A three‑state cyclic CA that produces moving gliders and chaotic patterns. Each CA generation becomes a time segment; every active ("live") cell in that generation triggers a sine‑wave oscillator whose frequency is determined by the cell's position. The result is a dense, evolving texture of pitched impulses that reflects the CA's emergent complexity.
Key Features:
- Three CA Families — Elementary (1D), Game of Life (2D), Brian's Brain (2D)
- Five Built‑in Presets — Rule 30 Classic, Rule 110 Complex, Rule 90 Symmetric, Game of Life Dense, Brian's Brain Chaotic
- Custom Parameter Control — Grid size, rule number, segment duration, pitch mapping
- Ultra‑Fast Processing — Chunked formula generation for large grids/long durations
- Visual‑Audio Mapping — Cell position → frequency, cell activation → oscillator trigger
- Real‑time Evolution — CA computed entirely in‑memory before audio generation
Technical Implementation: (1) CA Initialization: Elementary CA starts with a single center cell alive; 2D CAs use random initial densities. (2) Evolution: Each generation computed and stored in arrays. (3) Audio mapping: For each generation (time segment), each active cell adds a term to a massive additive‑synthesis formula: if x ≥ t_start and x < t_end then amp × sin(2π × freq × (x + global_offset)) .... (4) Chunked processing: To avoid Praat's formula‑length limits, the audio is built in chunks of 20 segments. (5) Final assembly: Chunks concatenated, peak‑normalized, and played. The method is "brute force" additive synthesis but optimized via formula chunking, making even large grids (40×40) and long durations tractable.
Quick start
- In Praat, ensure no objects are selected.
- Run script… →
cellular_automata_synthesis.praat. - Choose a Preset (Rule 30 Classic, Rule 110 Complex, etc.) or select Custom.
- If Custom, adjust parameters: Grid_size, Rule_type, Rule_number (for Elementary CA), Segment_duration, Base_frequency, Frequency_spread.
- Set Play_after to yes/no (auto‑play when done).
- Click OK — script computes CA, generates audio, and outputs "ca_presetName".
- Watch the Info window for progress; final sound appears in Objects list.
Cellular Automata Theory
Elementary Cellular Automata (1D)
🔢 Wolfram's 256 Rules
Rule definition: Each cell's next state depends on its current neighborhood of three cells (left, center, right).
2D Cellular Automata
Wolfram's Classes
Audio Mapping Strategy
Complete Processing Pipeline
Cellular Automata Types
Type 1: Elementary CA (1D)
📏 One‑Dimensional, Nearest‑Neighbor
Grid: 1 × grid_size (a single row of cells)
States: 0 (dead) or 1 (alive)
Neighborhood: Left, Center, Right (3 cells)
Rule specification: Wolfram rule number (0–255)
Initial condition: Single live cell at center
Sonic character: Each generation = time segment; each cell = frequency slot. Produces evolving melodic/rhythmic patterns that move across the frequency spectrum. Complexity varies dramatically with rule number.
Type 2: Game of Life (2D)
🎮 Conway's Classic (B3/S23)
Grid: grid_size × grid_size (square)
States: 0 (dead) or 1 (alive)
Neighborhood: Moore (8 surrounding cells)
Rule: Birth if 3 neighbors, Survive if 2 or 3 neighbors
Initial condition: Random ≈30% alive (density 0.3)
Sonic character: Clusters of activity create "clouds" of sound that evolve slowly. Stable patterns (still lifes), oscillators (blinkers), and spaceships produce repeating motifs. Sparse patterns yield isolated notes; dense patterns create dense textures.
Type 3: Brian's Brain (2D)
🧠 Three‑State Cyclic CA
Grid: grid_size × grid_size (square)
States: 0 (dead), 1 (alive), 2 (dying)
Neighborhood: Moore (8 surrounding cells)
Rule: Dead→alive if exactly 2 alive neighbors; Alive→dying; Dying→dead
Initial condition: Random mix: 30% alive, 20% dying, 50% dead
Sonic character: Moving gliders and sparks create rhythmic, pulsing patterns. The three‑state cycle produces natural "attack‑decay" envelopes. More chaotic and active than Game of Life, with faster evolution.
Comparison Table
| Feature | Elementary CA | Game of Life | Brian's Brain |
|---|---|---|---|
| Dimensions | 1D (row) | 2D (grid) | 2D (grid) |
| States | 2 (0,1) | 2 (0,1) | 3 (0,1,2) |
| Neighbors | 3 (left, center, right) | 8 (Moore) | 8 (Moore) |
| Rule complexity | Simple (3‑bit lookup) | Moderate (birth/survival counts) | Moderate (cyclic conditions) |
| Emergent behavior | Chaos, fractals, computation | Still lifes, oscillators, spaceships | Gliders, sparks, waves |
| Sonic density | Medium (grid_size cells/gen) | Variable (clusters) | High (many gliders) |
| Temporal evolution | Fast (each gen = segment) | Slow (patterns evolve gradually) | Fast (cyclic movement) |
| Best for | Melodic/rhythmic patterns | Textural clouds, ambient | Rhythmic pulses, glitch |
Preset Patterns
Preset 1: Rule 30 Classic
🌀 Wolfram's "Random" Rule
Parameters:
- Duration: 8.0 s
- Grid size: 32 cells
- Rule type: Elementary_CA
- Rule number: 30
- Segment duration: 0.1 s
- Base frequency: 150 Hz
- Frequency spread: 200 Hz
CA behavior: Class III (chaotic). Produces asymmetric, seemingly random patterns that are actually deterministic. Used by Wolfram as a pseudorandom generator. The left side remains orderly, right side chaotic.
Sonic character: Chaotic texture with occasional ordered runs. Sounds like digital rain or granular synthesis. Good for unpredictable backgrounds.
Preset 2: Rule 110 Complex
⚙️ Turing‑Complete Complexity
Parameters:
- Duration: 10.0 s
- Grid size: 40 cells
- Rule type: Elementary_CA
- Rule number: 110
- Segment duration: 0.08 s
- Base frequency: 120 Hz
- Frequency spread: 250 Hz
CA behavior: Class IV (complex). The simplest known Turing‑complete system. Produces localized structures (gliders) that interact in complex ways. More structured than Rule 30.
Sonic character: Evolving melodic patterns with repeating motifs. Sounds almost like algorithmic composition—structured yet unpredictable. Longer duration reveals more complexity.
Preset 3: Rule 90 Symmetric
🔄 Fractal Symmetry
Parameters:
- Duration: 8.0 s
- Grid size: 32 cells
- Rule type: Elementary_CA
- Rule number: 90
- Segment duration: 0.1 s
- Base frequency: 180 Hz
- Frequency spread: 180 Hz
CA behavior: Class II (periodic) but produces Sierpinski triangle fractal patterns. Linear rule (XOR of neighbors). Perfectly symmetric around center.
Sonic character: Mirror‑image patterns across frequency spectrum. Creates harmonious, almost tonal clusters. Less chaotic than Rule 30, more geometric.
Preset 4: Game of Life Dense
🌌 Clustered Emergence
Parameters:
- Duration: 12.0 s
- Grid size: 24×24
- Rule type: Game_of_Life
- Rule number: (not used)
- Segment duration: 0.15 s
- Base frequency: 100 Hz
- Frequency spread: 300 Hz
CA behavior: Conway's Game of Life with moderately dense initial population (30%). Evolves into stable clusters, oscillators, and occasional gliders.
Sonic character: Cloud‑like textures that slowly transform. Clusters create dense chordal masses; isolated gliders produce moving melodies. Long, evolving ambient soundscape.
Preset 5: Brian's Brain Chaotic
⚡ Cyclic Glider Storms
Parameters:
- Duration: 10.0 s
- Grid size: 28×28
- Rule type: Brian_Brain
- Rule number: (not used)
- Segment duration: 0.12 s
- Base frequency: 130 Hz
- Frequency spread: 200 Hz
CA behavior: Three‑state cyclic CA with many gliders and sparks. Constantly moving patterns that never settle.
Sonic character: Rhythmic, pulsing textures with clear attacks (alive state) and decays (dying state). Sounds like digital insect swarms or complex rhythmic sequences.
Parameters & Mapping
Core Parameters
🎛️ User‑Adjustable Settings
| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
| Duration | real | 8.0 | 1.0‑60.0 | Total audio length (seconds) |
| Grid_size | integer | 32 | 8‑100 | Number of cells (1D: length, 2D: width & height) |
| Rule_type | choice | Elementary_CA | 1‑3 | Type of CA (Elementary, Game_of_Life, Brian_Brain) |
| Rule_number | integer | 30 | 0‑255 | Elementary CA rule (0‑255), ignored for 2D CAs |
| Segment_duration | real | 0.1 | 0.02‑1.0 | Duration of each CA generation (seconds) |
| Base_frequency | real | 150 | 20‑1000 | Lowest frequency (Hz) for cell mapping |
| Frequency_spread | real | 200 | 0‑1000 | Frequency range added to base (Hz) |
| Play_after | boolean | 1 | 0/1 | Auto‑play generated sound |
Derived Values
| Value | Calculation | Typical Range | Description |
|---|---|---|---|
| total_segments | duration / segment_duration | 10‑500 | Number of CA generations |
| chunk_segments | 20 (fixed) | 20 | Segments per audio chunk |
| num_chunks | ceil(total_segments / chunk_segments) | 1‑25 | Audio chunks to generate |
| sample_rate | 44100 (fixed) | 44100 | Audio sampling rate |
Frequency Mapping Details
Amplitude Normalization
Envelope Shapes
Elementary CA: Uses raised‑cosine (Hanning) window to avoid clicks:
2D CAs (Game of Life, Brian's Brain): No envelope (square window) — each oscillator simply turns on/off at generation boundaries. This creates more percussive, rhythmic results.
Sonic Applications
Algorithmic Composition
🎼 Generative Music Engine
Technique: Use Rule 110 (Turing‑complete) as a "composition machine". Each generation becomes a measure; cell positions map to notes in a scale.
Mapping refinement: Quantize frequencies to equal‑tempered scale:
Result: Evolving melodies and harmonies that follow complex CA logic but stay within musical scales.
Rhythmic Pattern Generation
Use case: Create complex, polyrhythmic percussion
Technique: Use Elementary CA with short segment_duration (0.05 s) and map cell positions to different drum sounds (e.g., low cells = kick, middle = snare, high = hi‑hat).
Example: Rule 30 with grid_size=16, segment_duration=0.05 creates a 20 Hz "clock" with chaotic but deterministic rhythms.
Ambient Textures & Soundscapes
Use case: Evolving background pads for film/games
Technique: Game of Life with large grid_size (40×40), long segment_duration (0.2 s), low base_frequency (80 Hz), moderate frequency_spread (150 Hz).
Post‑processing: Add reverb, slow filter sweeps, stereo widening.
Result: Living, breathing textures that subtly change over minutes.
Experimental Sound Design
Glitch/IDM: Brian's Brain with small grid (16×16), very short segments (0.03 s), wide frequency spread (500 Hz). Creates stuttering, granular‑like textures.
Sci‑fi interfaces: Rule 90 (symmetric) with medium grid, mapped to synthetic bell‑like tones (additive harmonics).
Bio‑mimetic sounds: Game of Life patterns that resemble insect swarms, bird flocks, or cellular processes.
Educational Demonstrations
Hearing Wolfram's classes:
- Class I: Rule 0 or 255 → silence or constant drone
- Class II: Rule 4 or 108 → repeating loops
- Class III: Rule 30 or 90 → chaotic textures
- Class IV: Rule 110 → structured complexity
Visual‑audio correlation: Students can watch CA evolution online while listening to the sonic result, building intuition for emergent behavior.
Practical Workflow Examples
🎬 Sci‑fi Computer Interface
Goal: Complex, "thinking" machine sounds
Settings:
- Rule_type: Elementary_CA
- Rule_number: 110
- Grid_size: 24
- Segment_duration: 0.07 s
- Base_frequency: 300 Hz (bright)
- Frequency_spread: 400 Hz
Post‑process: Band‑pass filter (800‑2000 Hz), bit‑crush slightly, pan randomly.
🎵 Generative Ambient Album
Goal: 60‑minute evolving soundscape
Procedure:
- Generate 12× 5‑minute segments with varying parameters
- Rule types: Alternate Elementary (rules 30,90,110,184) and Game of Life
- Slowly drift base_frequency from 60 Hz to 120 Hz across album
- Cross‑fade segments with 30‑second overlaps
- Master with gentle compression and reverb
🔬 Cellular Biology Sonification
Goal: Sonify actual cell‑growth data
Adaptation: Replace random initialization with real binary data (e.g., microscope images thresholded). Use Game of Life rule to simulate growth, map cell density to amplitude, cell type to frequency.
Result: Audible representation of biological processes.
Optimization & Advanced Techniques
Chunked Formula Generation
Problem: Praat's formula interpreter has practical limits on formula length. A grid_size=40, total_segments=100, average 20 active cells/segment → 80,000 oscillator terms = formula too long.
Solution: Split into chunks of 20 segments:
Memory Management for 2D CAs
Issue: Game of Life and Brian's Brain store entire history in ca_history[segment, i, j]. For grid_size=40, total_segments=100 → 40×40×100 = 160,000 integers.
Optimization options:
- Smaller grids: Use grid_size ≤ 30 for long durations
- Shorter durations: Keep total_segments ≤ 200
- Bit‑packing: Store states as bits (0/1) rather than integers (future enhancement)
- On‑the‑fly generation: Don't store history, generate audio while evolving (more complex)
Performance Tips
- Reduce grid_size: Halving grid_size reduces cells 4× (2D) or 2× (1D)
- Increase segment_duration: Fewer segments = fewer generations to compute
- Use Elementary CA: Much faster than 2D CAs (no neighborhood loops)
- Lower frequency_spread: Simpler sine calculations (marginal gain)
- Disable Play_after: If just generating for later use
Extending the System
Additional CA rules:
- Seeds (B2): Simple explosive rule
- HighLife (B36/S23): Game of Life variant with replicators
- Wireworld: Four‑state CA for simulating circuits
- Langton's ant: Simple Turing machine that builds complex paths
Advanced audio mappings:
- FM synthesis: Use cell state as modulation index
- Granular synthesis: Each active cell triggers a grain from a sample
- Spatial audio: Map grid position to panning (left‑right) and depth
- Filter banks: Each cell controls a band‑pass filter on a noise source
Troubleshooting
Cause: Too many cells/generations (e.g., grid_size=50, duration=30, segment_duration=0.05 → 600 generations)
Solution: Reduce grid_size, increase segment_duration, use Elementary CA instead of 2D
Cause: CA rule leads to quick extinction (e.g., Rule 0) or initialization too sparse
Solution: Try different rule (30,90,110), increase initial density for 2D CAs
Cause: Square‑window oscillators (2D CAs) creating discontinuities
Solution: Add envelope to 2D terms, or use longer segment_duration
Cause: chunk_segments=20 still produces too many terms
Solution: Reduce chunk_segments to 10 in script code