8-Channel I Ching: Form & Speed — User Guide

Generates eight independent chance-based variations of one source. Six binary line throws per variation control slice reversal and form a binary code that maps to playback speed; optional Cage-inspired chance operations add silence, boundary jitter, pitch shifts, and variable slice counts.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.5.1 (2026) Category: Algorithmic Composition / Spatial Audio License: MIT License Repo: Praat AudioTools
Contents:

What this does

The script creates eight independently generated transformations of the selected Sound. For each channel it throws six binary line states, reads those states both as a Yin/Yang reversal pattern and as a six-bit numerical code, reforms the source from slices, applies a hexagram-code-derived speed factor with Praat's overlap-add Lengthen, and finally routes the eight working channels into the selected output format.

What is the I Ching relationship here?

The six generated binary lines are displayed as a hexagram and are also mapped to the corresponding King Wen number. The audio algorithm does not use the King Wen number to calculate speed. Speed is driven by the separate binary code of the six lines. The line throws are fair 0/1 random choices; this is a compositional chance procedure based on hexagram structure, not a full reconstruction of a traditional divination method.

Quick start

  1. Select exactly one Sound in Praat.
  2. Run 8-channel_I_Ching.praat.
  3. Choose a Preset. Custom uses the values shown in the form; the named presets replace deviation and speed bias.
  4. Use Random_seed = 0 for a new unpredictable result, or a positive integer for reproducibility.
  5. Leave the optional Cage-inspired operations off for the basic six-slice form/speed process, or enable them selectively.
  6. Choose the required Output_format.
  7. Enable Draw_visualization and Play_result as needed.
Default behaviour: Custom preset, deviation 0.20, bias 0, six slices, no optional Cage extensions, 44.1 kHz output resampling, 5 ms slice crossfade, and one eight-channel octophonic output.

Hexagrams & chance

Six line throws

For each output channel ch: line[1] ... line[6] = independent random integers in {0,1} 0 = Yin (broken line) 1 = Yang (solid line) Lines are counted from the bottom: line 1 = least-significant bit line 6 = most-significant bit

Binary code and King Wen identity

binary_code = line1 + 2 * line2 + 4 * line3 + 8 * line4 + 16 * line5 + 32 * line6 Range: 0 ... 63 King Wen number: looked up separately from a 64-entry table range: 1 ... 64
Important distinction: the binary code is an implementation coordinate used for speed mapping. The King Wen number identifies the corresponding hexagram. They are not interchangeable, and the speed is not derived from canonical hexagram numbering.

Repeated hexagrams

The eight hexagrams are generated independently, so they are not forced to be unique. The Info report explicitly notes repeated pairs when they occur.

Seed behaviour

A positive Random_seed calls Praat's predictable seeded generator before any chance decisions. Seed 0 initializes the generator safely and unpredictably. The same positive seed and the same settings reproduce the script's sequence of hexagram throws and optional random operations.

Form transformation

Standard six-slice mode

With Variable_slice_count off, the source is divided into six equal temporal regions. Slice s uses line s. A Yin line reverses that slice; a Yang line leaves it forward. The slices remain in their original slice order.

source duration = D slice duration = D / 6 slice 1 ↔ line 1 slice 2 ↔ line 2 ... slice 6 ↔ line 6 Yin (0): reverse the slice Yang (1): leave the slice forward

The processed slices are joined with Concatenate with overlap. The requested Slice_crossfade is limited to at most 40% of the shortest valid slice. If there is only one valid slice or the overlap is zero, ordinary concatenation is used.

Variable slice count

When enabled, a separate chance draw chooses a slice count from 4 through 12. The six hexagram line states are then cycled across the slices:

line index for slice s = ((s - 1) mod 6) + 1

The one-to-one relationship between six lines and six slices therefore applies only when the slice count is six.

Multichannel sources

Source slices retain the source channels during slicing and reversal. After recombination, a multichannel result is converted to mono before the channel-specific speed stage. This conversion is an ordinary channel average; there is no cancellation-safe strongest-channel fallback in this script.

Speed mapping

Active speed range

nominal minimum = 1 + Speed_bias - Deviation_range nominal maximum = 1 + Speed_bias + Deviation_range The script then establishes a usable range and maps all 64 binary codes linearly across it. speed = sMin + (sMax - sMin) * binary_code / 63

The resulting speedFactor is converted to a Praat time-scaling factor:

Lengthen factor = 1 / speedFactor speedFactor > 1 → shorter / faster speedFactor < 1 → longer / slower

Lengthen (overlap-add) uses the user-set Min_pitch and Max_pitch. This is intended to change duration while retaining pitch approximately; suitability depends on the source and the pitch range supplied.

Presets

PresetDeviationBiasResulting script range
CustomForm valueForm valueComputed from the entered values
Subtle0.0500.95–1.05×
Moderate0.2000.80–1.20×
Extreme0.5000.50–1.50×
Chaos1.0000.10–2.00×
Slow Drift0.20-0.150.65–1.05×
Fast Drift0.20+0.150.95–1.35×
Micro-variations0.0200.98–1.02×
Bias does not guarantee one-sided motion. Slow Drift still reaches 1.05× and Fast Drift starts at 0.95×, so both presets can produce channels on both sides of 1.0.

Sampling frequency

After the speed stage, every working channel is resampled with precision 50. With Override_sampling_frequency on, the target is Target_sampling_frequency; otherwise the source sampling frequency is used.

Optional chance extensions

Silence by chance — 4'33" homage

Each channel receives a separate six-bit chance throw. The channel is replaced by silence when:

silence_throw / 63 ≤ Silence_probability

Because the throw has 64 discrete states, the effective probability is quantized. The Info report prints the exact number of qualifying states and the actual percentage for the chosen threshold.

Jittered slice boundaries

When enabled, each slice start and end is independently displaced by up to Boundary_jitter × nominal_slice_duration. The parameter is clamped to 0–0.45. Boundaries are then constrained to the source domain.

This can omit source material, overlap source regions, and create unequal slice lengths. It is not a time-bracket system: after extraction, the slices are still joined consecutively.

Indeterminate pitch shift on Yin slices

Only reversed Yin slices are eligible. For each such slice a fresh six-bit draw determines a shift value across:

Pitch_shift_centre - Pitch_shift_spread ... Pitch_shift_centre + Pitch_shift_spread

The value is passed to Praat's Shift pitch (PSOLA) using Min_pitch and Max_pitch. This is a pitch shift; it is not pitch inversion around an axis.

Variable slice count

A separate chance operation chooses 4–12 slices. The six primary line states are cycled when the number of slices differs from six.

Output formats

Because the eight speed factors create different durations, all eight working channels are explicitly zero-padded to the duration of the longest channel before output routing.

Stage 1: shared gain

The largest peak across the eight working channels is measured, and one shared gain is applied to every channel so that the largest reaches 0.95. Relative levels between channels are therefore preserved.

Output formatObjectsRoutingFinal normalization
8 channels — octophonic1 × 8-channelout1–out8 = Ch1–Ch8Shared-gain stage only
4 stereo pairs4 × stereoCh1|Ch2, Ch3|Ch4, Ch5|Ch6, Ch7|Ch8Shared-gain stage only
2 quad groups2 × 4-channelCh1–Ch4 and Ch5–Ch8Shared-gain stage only
4-channel fold-down1 × 4-channel1=Ch1+Ch5, 2=Ch2+Ch6, 3=Ch3+Ch7, 4=Ch4+Ch8Finished object peak-scaled to 0.95
Stereo mix1 × stereoL = odd channels; R = even channelsFinished object peak-scaled to 0.95

Preview playback

For a single output object, Play_result plays that object. For the multi-object stem formats (4 stereo pairs and 2 quad groups), the script creates a temporary stereo monitor mix with odd channels on the left and even channels on the right, plays that monitor, then removes it. The monitor is not one of the returned output objects.

Parameters

ParameterDefaultActual role
PresetCustomNamed presets replace deviation and bias; Custom uses the form values.
Deviation_range0.20Half-width of the nominal speed range. Negative values are clamped to 0.
Speed_bias0.0Moves the centre of the nominal speed range.
Random_seed00 = unpredictable; positive integer = reproducible chance sequence.
Min_pitch75 HzLower pitch argument for overlap-add and optional PSOLA shift; must be below Max_pitch.
Max_pitch600 HzUpper pitch argument.
Override_sampling_frequencyonChooses target resampling rate instead of restoring the source rate.
Target_sampling_frequency44100 HzResampling target when override is on.
Slice_crossfade0.005 sRequested slice overlap; capped to 40% of the shortest valid slice.
Silence_by_chance_4_33offEnables an independent chance silence decision per channel.
Silence_probability0.05Chance threshold, clamped to 0–1 and realized on 64 discrete states.
Jittered_slice_boundariesoffRandomizes extraction boundaries; does not create timeline gaps.
Boundary_jitter0.15Maximum boundary displacement as a fraction of nominal slice length; clamped to 0–0.45.
Indeterminate_pitch_shiftoffApplies a separately drawn PSOLA shift to each Yin slice.
Pitch_shift_centre-0.5Centre of the optional shift range passed to Praat.
Pitch_shift_spread0.4Half-width of that range; negative values are clamped to 0.
Variable_slice_countoffChooses 4–12 slices by a separate chance draw.
Output_format8-channel octophonicSelects the routing/output-object layout described above.
Draw_visualizationonDraws the current 8 × 8 analysis/process figure.
Play_resultonPlays the output or, for multi-object stem formats, the temporary stereo monitor.

Visualization

The v0.5.1 figure is an analysis/process display and is independent of the chosen output format because it reads the eight working channels before cleanup.

Panel A — Hexagram grid • 8 hexagrams in a 2 × 4 arrangement • blue solid = Yang, red broken = Yin • separate King Wen number (KW) and binary code • speed factor per channel • SILENT marker when the chance gate silenced a channel Panel B — Speed factors • one horizontal bar per channel • blue = faster than 1.0 • orange = slower than 1.0 • grey = silent channel • dotted reference at 1.0 • axis expands to the active speed range Panel C — Yin / Yang balance • red = Yin count • blue = Yang count • counts shown inside the bars • reference line at 3 / 3 Panel D — Channel examples • overlays working Ch1 and Ch2 • these are two of the eight variations • they are not left/right channels of a stereo mix Panel E — Summary • preset, source, deviation, bias, speed range, seed • active chance extensions • output format, object count, channel count, routing
How to read the figure: the King Wen label identifies the hexagram; the adjacent binary code is the number that actually determines speed. This distinction is intentional and avoids treating binary code 0–63 as canonical I Ching numbering.

Implementation notes & edge cases

Interpretive scope: the script uses I Ching hexagram structure and King Wen identification as a compositional framework. Claims about musical character, philosophical meaning, or perceptual effect are not calculated by the algorithm itself.