8-Channel I Ching Form & Speed — User Guide

Algorithmic spatial composition: generates 8 unique audio transformations using I Ching hexagrams as algorithmic rules, creating complex stereo spatialization through form manipulation and speed variations.

Author: Shai Cohen Version: 2.0 (8-Channel) License: MIT License Category: Algorithmic Composition & Spatial Audio
Contents:

What this does

This script implements algorithmic audio transformation using I Ching hexagrams — a unique compositional system that generates 8 parallel audio transformations based on randomly generated I Ching hexagrams. The process: (1) Hexagram Generation: Randomly generates 8 different I Ching hexagrams (6-line binary patterns). (2) Form Manipulation: For each channel, slices the audio into 6 equal segments, reversing segments corresponding to Yin (broken) lines. (3) Speed Variation: Calculates a speed factor from the hexagram's numerical value (0-63), applying time-stretching to each channel. (4) Spatial Combination: Combines the 8 transformed channels into a stereo output using Praat's channel combination algorithm. (5) Visual Display: Draws all 8 hexagrams in a grid layout showing their structure and calculated speed factors.

Key Features:

What is I Ching algorithmic composition? Traditional composition: human decisions, musical rules. I Ching composition: using ancient Chinese divination system's mathematical structure as generative rules. Advantages: (1) Ancient wisdom: 3000-year-old system as modern algorithmic source. (2) Balanced randomness: Structured randomness (64 possible hexagrams). (3) Dual parameters: Each hexagram controls both form (Yin=reverse) and speed (value=tempo). (4) Philosophical depth: Connects audio processing to I Ching's cosmological concepts. (5) Unpredictable but structured: Random within defined system. Use cases: Experimental music (algorithmic composition), sound design (generative textures), installation art (I Ching-inspired systems), education (teaching algorithmic art), spiritual/meditative audio (connecting to ancient systems).

Technical Implementation: The script creates 8 parallel processing pipelines: (1) Hexagram Calculation: Generates 6 random bits (0=Yin, 1=Yang), calculates value (0-63), maps to speed factor (1.0 ± deviation_range). (2) Form Processing: Splits audio into 6 equal slices, reverses slices where corresponding line=Yin (0), concatenates. (3) Speed Processing: Uses Praat's Lengthen (overlap-add) for time-stretching based on hexagram-derived speed factor. (4) Spatialization: Combines 8 mono channels into stereo using Praat's default channel mapping. (5) Visualization: Draws hexagram grid using Praat's picture window with Yin (broken) and Yang (solid) lines. Key insight: Each hexagram creates a unique "audio DNA" that transforms both the temporal structure (reversals) and temporal rate (speed) of the source material.

Quick start

  1. In Praat, select exactly one Sound object (any audio file).
  2. Run script…8channel_iching_form_speed.praat.
  3. Set Deviation_range (default 0.20 = ±20% speed variation).
  4. Set Random_seed (0 for truly random, >0 for reproducible results).
  5. Set Target_sampling_frequency if resampling needed (default 44100 Hz).
  6. Click OK — watch hexagram visualization appear in picture window.
  7. Script processes 8 channels in parallel (monitors progress in console).
  8. Final stereo output named "originalname_8ch_IChing_FormSpeed" appears and plays.
  9. Examine picture window to see which hexagrams were generated for each channel.
Quick tip: Use speech or melodic audio to hear form reversal effects clearly. The picture window shows all 8 hexagrams — solid lines = Yang (forward), broken lines = Yin (reversed). Each channel's speed factor is shown below its hexagram (e.g., "1.15x" = 15% faster). Deviation_range = 0.20 gives speed range 0.8x to 1.2x (20% slower to 20% faster). For reproducible results, set Random_seed to any positive integer. Processing creates 8 intermediate mono channels then combines to stereo — check Objects window to see them before final combination. Listen for how different reversals and speeds create complex spatial interplay. The output is always stereo even from mono input.
Important: ONE SOUND ONLY — Script fails with 0 or 2+ sounds selected. Form reversal based on Yin lines — Yin (0/broken) = reversed segment, Yang (1/solid) = forward segment. Speed calculation maps hexagram value (0-63) to speed range (1.0 ± deviation_range). Time-stretching uses overlap-add — preserves pitch, changes duration only. All channels forced to mono before processing — stereo sources lose stereo image in individual channels. Picture window required — Script draws visualization; ensure Praat picture window is available. Processing time scales with audio length — 5-minute file × 8 channels may take several minutes. Randomness — Each run produces different hexagrams unless seed set.

I Ching System

☯ The I Ching (Book of Changes)

Ancient Chinese divination text — over 3000 years old

64 Hexagrams — 6-line patterns of broken (Yin) and solid (Yang) lines

Binary system — Yin = 0, Yang = 1 (pre-dates binary mathematics)

Cosmological philosophy — Represents dynamic balance of opposites

Algorithmic structure — Mathematical foundation for generative art

Hexagram Structure and Generation

HEXAGRAM GENERATION ALGORITHM: For each channel (1 to 8): Generate 6 random bits: l1, l2, l3, l4, l5, l6 ∈ {0, 1} Where: 0 = Yin (broken line), 1 = Yang (solid line) Example hexagram: 1 0 1 1 0 1 Line 1: Yang (solid) = 1 Line 2: Yin (broken) = 0 Line 3: Yang (solid) = 1 Line 4: Yang (solid) = 1 Line 5: Yin (broken) = 0 Line 6: Yang (solid) = 1 NUMERICAL VALUE CALCULATION: Binary weighted sum (lines read bottom to top in I Ching tradition): hex_value = l1 + (l2×2) + (l3×4) + (l4×8) + (l5×16) + (l6×32) Range: 0 (all Yin) to 63 (all Yang) Example calculation for 1 0 1 1 0 1: hex_value = 1 + (0×2) + (1×4) + (1×8) + (0×16) + (1×32) = 1 + 0 + 4 + 8 + 0 + 32 = 45 NORMALIZATION: normalized_hex = hex_value / 63 Range: 0.0 to 1.0 SPEED MAPPING: speed_factor = 1.0 + ((normalized_hex × (deviation_range × 2)) - deviation_range) Example with deviation_range = 0.20: • hex_value = 0 → speed = 0.80x (20% slower) • hex_value = 31.5 → speed = 1.00x (normal) • hex_value = 63 → speed = 1.20x (20% faster)

I Ching Philosophical Concepts in Audio

I Ching ConceptAudio ImplementationEffect on SoundPhilosophical Meaning
Yin (阴)Segment reversalTime inversion, retrogradeReceptive, yielding, moon
Yang (阳)Segment forwardNormal temporal flowCreative, active, sun
Hexagram (卦)6-segment patternOverall form structureSituation, moment in time
Change (易)Speed variationTemporal dilation/compressionConstant flux, transformation
Balance (平衡)8 channels combinedSpatial stereo fieldHarmony of opposites

Hexagram Display and Interpretation

VISUAL REPRESENTATION IN PRAAT PICTURE WINDOW: Grid Layout (2 rows × 4 columns): Channels 1-4: Top row Channels 5-8: Bottom row For each hexagram: • Solid line (Yang): Continuous horizontal line • Broken line (Yin): Two segments with gap in middle • Label: "Ch X (speed_factorx)" Example display for hexagram 1 0 1 1 0 1: Line 6 (top): ─────────────── (Yang) Line 5: ─────── ──────── (Yin - broken) Line 4: ─────────────── (Yang) Line 3: ─────────────── (Yang) Line 2: ─────── ──────── (Yin - broken) Line 1 (bottom): ───────────── (Yang) INTERPRETING THE VISUALIZATION: • More solid lines: More forward segments • More broken lines: More reversed segments • Speed factor: Higher = faster playback • Channel position: Spatial assignment in final mix

Randomness and Seed Control

RANDOM SEED BEHAVIOR: If Random_seed = 0: • Truly random hexagrams each run • Different results every execution • Based on system random generator If Random_seed > 0: • Deterministic pseudorandom sequence • Same seed → same hexagrams → same audio result • Enables reproducible compositions • Useful for archiving specific results EXAMPLE WITH SEED = 42: First run (seed 42): Generates specific 8 hexagrams Second run (seed 42): Generates identical 8 hexagrams Third run (seed 43): Generates different 8 hexagrams TECHNICAL IMPLEMENTATION: Uses Praat's random functions with seed control Each channel's hexagram independent but from same seed sequence Speed factors derived deterministically from hexagram values

Form Manipulation

🎵 Hexagram-Driven Audio Slicing

Segment Division: Audio divided into 6 equal temporal slices

Yin/Yang Mapping: Each slice mapped to corresponding hexagram line

Reversal Logic: Yin lines (0) → reverse slice, Yang lines (1) → forward slice

Recombination: Processed slices concatenated into new temporal form

Slicing Algorithm

SLICING PROCESS FOR EACH CHANNEL: Given: original_duration = D seconds hexagram_lines = [l1, l2, l3, l4, l5, l6] where lᵢ ∈ {0, 1} STEP 1: Calculate slice duration slice_duration = D / 6 STEP 2: Process each of 6 slices For slice s = 1 to 6: start_time = (s - 1) × slice_duration end_time = s × slice_duration Clamp end_time ≤ D (for last slice) If (end_time - start_time) > 0.001 seconds: Extract slice: [start_time, end_time] If hexagram_line[s] = 0 (Yin): Reverse slice (time inversion) Store processed slice STEP 3: Concatenate slices Select all 6 processed slices Concatenate (maintains slice order) Result: reformed audio with some segments reversed EXAMPLE WITH HEXAGRAM 1 0 1 1 0 1: Slice 1 (line 1 = 1/Yang): Forward Slice 2 (line 2 = 0/Yin): Reversed Slice 3 (line 3 = 1/Yang): Forward Slice 4 (line 4 = 1/Yang): Forward Slice 5 (line 5 = 0/Yin): Reversed Slice 6 (line 6 = 1/Yang): Forward

Reversal Effects on Different Audio Types

Audio TypeForward SegmentReversed (Yin) SegmentPerceptual EffectMusical Result
SpeechNormal speechBackwards speechUncanny, mysteriousLinguistic deconstruction
MelodyForward phraseRetrograde melodyMusical palindromeSerialist technique
PercussionNormal attack-decayReverse attack (swell)Unnatural envelopesRhythmic disruption
AmbientNatural evolutionTime-reversed textureDreamlike, surrealSpatial disorientation
NoiseForward noiseReversed noiseSubtle differenceMinimal transformation

Form Transformation Examples

Example 1: All Yang (hexagram 1 1 1 1 1 1)
  • Value: 63
  • Speed: Maximum (1 + deviation_range)
  • Form: All segments forward (no reversals)
  • Result: Original form, sped up
  • Character: Forward, accelerated version
Example 2: All Yin (hexagram 0 0 0 0 0 0)
  • Value: 0
  • Speed: Minimum (1 - deviation_range)
  • Form: All segments reversed
  • Result: Completely reversed, slowed down
  • Character: Retrograde, decelerated version
Example 3: Alternating (hexagram 1 0 1 0 1 0)
  • Value: 21
  • Speed: ~1.0 (near normal)
  • Form: Forward, reverse, forward, reverse, forward, reverse
  • Result: Ping-pong alternation
  • Character: Rhythmic alternation between normal and reversed
Example 4: Checkerboard (hexagram 0 1 0 1 0 1)
  • Value: 42
  • Speed: ~1.13x (with deviation_range=0.20)
  • Form: Reverse, forward, reverse, forward, reverse, forward
  • Result: Opposite alternation pattern
  • Character: Different rhythmic feel from alternating

Perceptual Effects of Form Manipulation

PSYCHOACOUSTIC EFFECTS: 1. TEMPORAL DISLOCATION: • Reversed speech loses linguistic meaning • Retains prosodic contours (rhythm, intonation) • Creates "speech-like" but unintelligible sound 2. MUSICAL PALINDROMES: • Forward → reverse segments create symmetry • Musical phrases heard normally then in retrograde • Classical compositional technique (Bach, Webern) 3. ENVELOPE TRANSFORMATION: • Natural attacks become decays • Decays become attacks (reverse swell) • Changes perceptual "direction" of sounds 4. RHYTHMIC DISRUPTION: • Forward rhythms interrupted by reversed patterns • Creates complex polyrhythmic relationships • Especially noticeable in percussive material 5. SPATIAL IMPLICATION: • Different channels have different reversal patterns • Creates perceived spatial movement • Forward/reverse contrast enhances channel separation

Speed Variation

⏱️ Hexagram-Value-Driven Time Stretching

Value Mapping: Hexagram numerical value (0-63) mapped to speed factor

Range Control: Deviation_range parameter sets maximum speed variation

Pitch Preservation: Overlap-add algorithm changes speed without pitch shift

Temporal Transformation: Each channel plays at unique speed relative to original

Speed Calculation Algorithm

SPEED FACTOR CALCULATION: Given: hexagram_value = v ∈ [0, 63] (from 6 binary lines) deviation_range = r ∈ (0, 1] (e.g., 0.20 for ±20%) STEP 1: Normalize to [0, 1] normalized = v / 63 STEP 2: Map to speed range [1-r, 1+r] speed_factor = 1.0 + ((normalized × (r × 2)) - r) MATHEMATICALLY: • v = 0 → speed = 1 - r (slowest) • v = 31.5 → speed = 1.0 (original speed) • v = 63 → speed = 1 + r (fastest) EXAMPLE WITH r = 0.20: • Hexagram 0 (all Yin): speed = 0.80x (20% slower) • Hexagram 31.5 (balanced): speed = 1.00x (normal) • Hexagram 63 (all Yang): speed = 1.20x (20% faster) INTERPRETATION: • Yin-heavy hexagrams → slower speeds (contemplative) • Yang-heavy hexagrams → faster speeds (energetic) • Balanced hexagrams → near-normal speeds (stable)

Time-Stretching Implementation

PRAAT'S LENGTHEN (OVERLAP-ADD) ALGORITHM: Parameters used: • Minimum pitch: 75 Hz • Maximum pitch: 600 Hz • Time scaling factor: 1/speed_factor PROCESS: 1. Original duration: D seconds 2. Target duration: D_target = D / speed_factor 3. Time scaling factor = D_target / D = 1/speed_factor EXAMPLE (speed_factor = 1.2): Original duration: 10.0 seconds Target duration: 10.0 / 1.2 = 8.333 seconds Time scaling factor: 8.333 / 10.0 = 0.8333 Result: 20% faster, pitch preserved ALGORITHM CHARACTERISTICS: • Overlap-add (PSOLA-based) time scaling • Preserves pitch and formant structure • Works best on monophonic, pitched material • May produce artifacts on noisy/percussive sounds • Higher quality than simple resampling

Speed Factor Distribution

Hexagram CategoryValue RangeSpeed Range (r=0.20)Duration ChangePerceptual Character
All Yin (000000)00.80x+25% longerSlow, stretched, contemplative
Yin-dominant1-200.80-0.94x+6-25% longerSlowed, relaxed
Balanced21-420.94-1.06x-6% to +6%Near-normal, stable
Yang-dominant43-621.06-1.20x-17% to -6% shorterSped up, energetic
All Yang (111111)631.20x-17% shorterFast, compressed, urgent

Interaction Between Form and Speed

COMBINED EFFECTS: Form (reversals) and Speed (time-stretch) interact: 1. REVERSAL THEN SPEED: • First: Audio sliced and some segments reversed • Then: Entire reformed audio time-stretched • Result: Reversed segments also time-stretched Example: Yin segment reversed then sped up 1.2x Original: [A B C] (3 seconds) Reversed: [C B A] (3 seconds) Sped up: [C B A] compressed to 2.5 seconds Each reversed element faster 2. SPEED EFFECT ON REVERSAL PERCEPTION: • Slower speeds: Reversed segments more noticeable • Faster speeds: Reversed segments blur together 3. FORM-SPEED CORRELATION (by design): • All Yin (000000): All reversed + slowest speed • All Yang (111111): All forward + fastest speed • Creates philosophical correlation: Yin = receptive, slow, reversed Yang = active, fast, forward

Deviation Range Parameter

Choosing Deviation_range values:
  • 0.05 (±5%): Subtle variations, good for musical material
  • 0.10 (±10%): Noticeable but musical, default for many applications
  • 0.20 (±20%): Significant variations, creates clear tempo differences
  • 0.30 (±30%): Extreme variations, dramatic tempo contrasts
  • 0.50 (±50%): Maximum practical range, half-speed to double-speed
Effect on 8-channel spatialization:
  • Small deviation (0.05-0.10): Channels closely synchronized, subtle phasing
  • Medium deviation (0.15-0.25): Clear tempo differences, rhythmic complexity
  • Large deviation (0.30-0.50): Drastic tempo variations, potentially chaotic

Spatial Composition

🎧 8-Channel to Stereo Spatialization

Channel Generation: 8 independently processed mono channels

Spatial Combination: Praat's Combine to stereo algorithm

Default Mapping: Channels assigned to stereo field automatically

Spatial Complexity: Different forms and speeds create moving sound field

Channel-to-Stereo Mapping

PRAAT'S COMBINE TO STEREO ALGORITHM: Given 8 mono channels: Ch1, Ch2, ..., Ch8 Praat's default behavior: • First channel(s) assigned to left • Last channel(s) assigned to right • Middle channels distributed across stereo field • Exact mapping depends on Praat version and algorithm TYPICAL MAPPING (approximate): Ch1 → Mostly left Ch2 → Left-center Ch3 → Center-left Ch4 → Center Ch5 → Center-right Ch6 → Right-center Ch7 → Mostly right Ch8 → Far right RESULTING STEREO FIELD: • Different hexagrams in different spatial positions • Different speeds in different positions • Creates perceived movement as faster/slower elements play • Forward/reversed segments appear from different directions

Spatial Effects of Hexagram Variations

Spatial EffectCaused ByPerceptual ResultExample Scenario
Temporal phasingDifferent speed factorsSounds move around stereo fieldFast channel left, slow channel right
Directional reversalDifferent reversal patternsSounds "approach" from different directionsForward segment left, reversed segment right
Rhythmic complexityCombination of all patternsPolyrhythmic spatial patternsMultiple tempi from multiple positions
Spectral spreadingDifferent time-stretching artifactsDifferent spectral characters in spaceClean sound left, artifact-rich sound right
Dynamic movementInteraction of all factorsEvolving, moving soundscapeSounds appear to rotate or move through space

Visual-Spatial Correlation

PICTURE WINDOW LAYOUT CORRELATION: The visual grid (2×4) suggests spatial arrangement: Top row (Channels 1-4): • Typically mapped to left side of stereo field • Position in row suggests left-to-right placement Bottom row (Channels 5-8): • Typically mapped to right side of stereo field • Position in row suggests left-to-right placement VISUAL-SPATIAL READING: Looking at picture window gives clue to spatialization: Top-left hexagram (Ch1) → Far left in stereo Top-right hexagram (Ch4) → Center-left in stereo Bottom-left hexagram (Ch5) → Center-right in stereo Bottom-right hexagram (Ch8) → Far right in stereo INTERPRETING THE DISPLAY: • Hexagram patterns visible → know which reversals where • Speed factors shown → know relative tempi • Grid position → approximate stereo placement • Complete picture of 8-channel spatial composition

Spatial Perception Guidelines

Listening for spatial effects:
  • Headphones: Best for hearing precise channel placement
  • Stereo speakers: Good for overall spatial field perception
  • Close listening: Focus on individual channel characteristics
  • Distance listening: Hear overall spatial movement and interaction
  • Multiple listens: First pass for overall effect, then focus on specific channels
Enhancing spatial effects:
  • Post-process in DAW: Export and apply additional panning/effects
  • Multi-speaker setup: Extract individual channels for speaker array
  • Binaural processing: Apply HRTF to enhance 3D perception
  • Automation: Create piece where spatialization evolves over time

Creative Applications

Algorithmic Composition

🎵 I Ching-Inspired Music

Goal: Create compositions using I Ching as generative system

Workflow:

  1. Record or create source musical material
  2. Process with different Random_seed values
  3. Select most interesting results
  4. Further process or arrange in DAW
  5. Create series based on different hexagram sets

Example: Piano piece transformed into 8-channel I Ching spatial composition

Sound Design and Installation

🏛️ Multi-Channel Sound Installation

Goal: Create evolving sound for gallery or public space

Workflow:

  1. Use field recordings or environmental sounds
  2. Process with moderate deviation_range (0.15-0.25)
  3. Extract individual channels for multi-speaker setup
  4. Install in space with speakers corresponding to hexagram positions
  5. Add visual display of hexagrams being generated

Example: 8-speaker installation where each speaker plays different hexagram transformation

Educational Tool

🏫 Teaching Algorithmic Art Concepts

Goal: Demonstrate algorithmic composition and I Ching as creative system

Workflow:

  1. Students record short speech or musical phrase
  2. Process with script, observe hexagram visualization
  3. Compare different seeds and deviation ranges
  4. Discuss I Ching philosophy in algorithmic context
  5. Create compositions using multiple processed versions

Learning outcomes: Algorithmic thinking, I Ching philosophy, audio processing, spatial composition

Spiritual/Meditative Audio

☯️ I Ching Meditation Soundscapes

Goal: Create meditative audio experiences based on I Ching wisdom

Workflow:

  1. Use calming source material (singing bowls, nature sounds, chanting)
  2. Process with small deviation_range (0.05-0.10) for subtle variations
  3. Consult I Ching for specific hexagrams of interest
  4. Manually set hexagrams (modify script) for desired transformations
  5. Create series corresponding to different I Ching concepts

Example: "Hexagram 1: The Creative" - all Yang, fast, forward transformation

Advanced Creative Techniques

Serial Processing:
  1. Process source with script → Result A
  2. Use Result A as new source → Result B
  3. Repeat multiple times
  4. Creates deeply transformed, complex results
  5. Example: Speech → I Ching → Result as source → I Ching again
Hybrid Source Material:
  • Process different sources with same hexagram set
  • Mix results
  • Creates unified transformation of disparate materials
  • Example: Process speech, music, and field recordings with same 8 hexagrams
Parameter Evolution:
  • Create piece where deviation_range changes over time
  • Start with small variations, increase to large, return to small
  • Creates journey through parameter space
  • Example: 10-minute piece where deviation_range sweeps 0.05 → 0.30 → 0.05

Troubleshooting Common Issues

Problem: Result is too chaotic/unmusical
Causes: Large deviation_range, complex source material, many reversals
Solutions: Decrease deviation_range (0.05-0.15), use simpler source, check hexagrams for reversal density
Problem: Time-stretching artifacts unpleasant
Causes: Noisy/percussive source material, extreme speed factors
Solutions: Use pitched/musical sources, reduce deviation_range, try different source material
Problem: Spatial image unclear/muddled
Causes: Similar hexagrams across channels, small speed differences
Solutions: Use different Random_seed, increase deviation_range, check hexagram visualization for diversity
Problem: Processing takes too long
Causes: Long source audio, Praat's overlap-add algorithm complexity
Solutions: Use shorter source (1-2 minutes), pre-cut to length, use faster computer

Performance Optimization

ScenarioSource LengthDeviation RangeProcessing TimeResult Character
Quick test15-30 seconds0.10-0.1530-60 secondsClear transformation, fast processing
Standard composition1-2 minutes0.15-0.252-5 minutesSubstantial material, good variation
Installation piece3-5 minutes0.10-0.205-15 minutesLong-form, evolving
Extreme processing5-10 minutes0.25-0.4015-30+ minutesMaximum transformation, long processing