Risset Mutations Generator — User Guide

Algorithmic composition inspired by Jean‑Claude Risset: generates evolving spectral textures through parameterized harmonic mutation, creating structured computer music from mathematical principles.

Author: Shai Cohen Affiliation: Department of Music, Bar‑Ilan University, Israel Version: Mark VIII (2025) License: MIT License Repo: https://github.com/ShaiCohen‑ops/Praat‑plugin_AudioTools
Contents:

What this does

This script implements Risset‑inspired algorithmic composition — generating structured computer music through parameterized spectral mutation. Inspired by Jean‑Claude Risset's pioneering work in computer music, the script creates evolving sound textures by scheduling multiple "events" (sine‑based voices) that mutate harmonically over time according to mathematical functions. Each event follows a unique trajectory in frequency‑amplitude space, creating complex emergent textures from simple sine wave foundations.

Key Features:

Who was Jean‑Claude Risset? A French composer and pioneer of computer music (1938‑2016). Risset worked at Bell Labs with Max Mathews, creating groundbreaking computer‑generated sounds including the famous "Shepard‑Risset glissando" (endless ascending/descending tone). His work focused on psychoacoustics, spectral manipulation, and algorithmic composition. This script honors his approach by generating music through parameterized transformations of simple sine waves, creating complex evolving textures that emerge from mathematical principles rather than traditional musical notation.

Technical Implementation: (1) Event Scheduling: Based on selected preset, generate N events with random start times, durations, frequencies, and mutation modes. (2) Spectral Synthesis: For each event, create a sine wave at the base frequency. (3) Harmonic Mutation: Apply Chebyshev polynomial transformations (modes 1‑3) to create evolving harmonic spectra. (4) Amplitude Shaping: Apply time‑varying amplitude and mutation envelopes. (5) Accumulation: Mix all events into a master composition. (6) Visualization: Generate score‑like display showing frequency trajectories with time‑based color coding.

Quick start

  1. In Praat, ensure no objects are selected (the script generates sound from scratch).
  2. Run script…risset_mutations_generator.praat.
  3. Select a Compositional Strategy preset (start with "1. Full Composition (3‑Part Arc)").
  4. Set master_duration (30.0 seconds is a good starting point).
  5. Enable show_visuals to see the frequency trajectory score.
  6. Click OK — the composition generates, visualizes, and plays automatically.
  7. The result appears as "Master_Mix_XXXXXX" where XXXXXX is a random run ID.
Quick tip: Start with Preset 1 (Full Composition) for a complete 3‑part musical form with beginning, middle, and end. Try Preset 2 (Odd Harmonics) for woody, hollow tones reminiscent of clarinet or bassoon. Use shorter durations (10‑15s) for quick experiments, longer (45‑60s) for evolving textures. The visualization shows frequency trajectories colored by time (blue→red) — watch how events are distributed and how their frequencies evolve. The script generates different results each run due to controlled randomness.
Important: This script generates new compositions — it does not process existing audio. Longer durations (>60 s) with many events can be CPU‑intensive. The visualization erases all existing Praat pictures. Each run gets a unique Run ID (1‑999999) for reproducibility — note this ID if you want to recreate the exact same composition. The base frequency is fixed at 110 Hz (A2) but individual events span from 55 Hz to 1320 Hz. Events are clipped to not exceed master_duration. Output is normalized to ‑0.95 dBFS.

Risset & Spectral Theory

Risset's Computer Music Philosophy

Spectral Thinking

Risset approached sound as spectral evolution rather than notes:

🎵 Beyond Equal Temperament

Traditional music: Discrete pitches (12‑TET), fixed timbres, rhythmic patterns.

Risset's approach: Continuous frequency spaces, evolving spectra, parameterized transformations.

Key principles:

  • Synthesis from first principles (sine waves as atoms)
  • Psychoacoustic exploration (how we perceive sound)
  • Algorithmic generation (music as mathematical process)
  • Emergent complexity (simple rules → rich results)

The Mutation Concept

Risset's "mutations" transform simple sounds into complex ones:

Starting point: Pure sine wave (single frequency) Mutation: Apply time‑varying nonlinear transformation Result: Harmonic spectrum that evolves over time Example: Sine → gradually adds harmonics → becomes rich tone → returns to sine

Chebyshev Polynomial Transformations

Mathematical Basis

The script uses Chebyshev polynomials of the first kind:

T₀(x) = 1 T₁(x) = x T₂(x) = 2x² − 1 T₃(x) = 4x³ − 3x T₄(x) = 8x⁴ − 8x² + 1 T₅(x) = 16x⁵ − 20x³ + 5x T₆(x) = 32x⁶ − 48x⁴ + 18x² − 1 T₇(x) = 64x⁷ − 112x⁵ + 56x³ − 7x Property: Tₙ(cos θ) = cos(nθ) Thus: Tₙ(sin ωt) generates nth harmonic of sin ωt

Three Mutation Modes

🔀 Spectral Transformation Modes

Mode 1 (Woody/Hollow):

Formula: (1‑m)×sine + m×(‑0.3×sine + 2.0×sine³ − 0.7×sine⁵)

Blends sine with combination of T₁, T₃, T₅

Result: Emphasizes odd harmonics (1,3,5) → clarinet‑like tones


Mode 2 (Brassy/Chaos):

Formula: (1‑m)×sine + m×(0.5×sine + 0.5×T₂(sine))

Blends sine with T₁ and T₂ mixture

Result: Adds even harmonics (2) → brighter, brass‑like character


Mode 3 (Glassy/Chime):

Formula: (1‑m)×sine + m×T₇(sine)

Pure 7th‑order Chebyshev polynomial

Result: High‑order harmonics → metallic, bell‑like timbres

Algorithmic Composition Structure

Event‑Based Architecture

The composition is built from scheduled events:

Each event has: start_t: Start time (0 to master_duration) dur: Duration (1.5 to 15.0 seconds) freq: Base frequency (55 to 1320 Hz) mode: Mutation mode (1, 2, or 3) pk: Peak mutation amount (0.2 to 1.0) Events are: Generated stochastically within constraints Shaped by amplitude and mutation envelopes Mixed additively into master output

Stochastic vs Deterministic

Controlled randomness creates variation within structure:

Random elements:
• Event start times (within section boundaries)
• Event durations (within preset ranges)
• Frequencies (within preset ranges)
• Peak mutation amounts

Deterministic elements:
• Number of events (fixed per preset)
• Section boundaries (for Preset 1)
• Mutation formulas (exact polynomials)
• Envelope shapes (mathematical functions)

Result: Each run is unique but follows the same structural rules.

Compositional Strategies

Four Preset Architectures

PresetEventsDuration RangeFrequency RangeMode BiasMusical Form
1. Full Composition144‑14 s110‑880 HzMode 1→2→33‑part arc: Beginning, Development, Conclusion
2. Odd Harmonics810‑15 s55‑275 HzMode 1 onlySustained drone study
3. High Order124‑9 s440‑1100 HzMode 3 onlyGlassy, chime‑like textures
4. Density Study251.5‑4 s110‑1320 HzMode 2 onlyDense, chaotic, brassy clusters

🎼 Preset 1: Full Composition (3‑Part Arc)

Structural Design:

  • Section 1 (Beginning): Events 1‑4, slow/long, low frequencies, Mode 1, moderate amplitude
  • Section 2 (Development): Events 5‑10, medium duration, mid‑high frequencies, Mode 2, high amplitude
  • Section 3 (Conclusion): Events 11‑14, medium duration, mid frequencies, Mode 3, low amplitude

Musical Result: A complete miniature composition with introduction, climax, and resolution. The harmonic character evolves from woody (Mode 1) through brassy (Mode 2) to glassy (Mode 3).

🎵 Preset 2: Study in Odd Harmonics

Focus: Exploration of clarinet‑like, hollow tones through exclusive use of Mode 1 (odd‑harmonic emphasis).

Parameters: 8 long events (10‑15 s), low frequency range (55‑275 Hz), all Mode 1.

Musical Result: A sustained drone texture with slowly evolving woody timbres. The limited harmonic palette creates coherence; overlapping long tones create beating and phasing effects.

🔔 Preset 3: Study in High Order

Focus: Metallic, bell‑like textures through exclusive use of Mode 3 (7th‑order Chebyshev).

Parameters: 12 medium events (4‑9 s), high frequency range (440‑1100 Hz), all Mode 3.

Musical Result: A sparkling, chime‑like texture with prominent high harmonics. Shorter events create rhythmic interplay; high frequencies create bright, crystalline quality.

🎺 Preset 4: Study in Density

Focus: Dense, chaotic textures through many short events with Mode 2 (even‑harmonic emphasis).

Parameters: 25 short events (1.5‑4 s), wide frequency range (110‑1320 Hz), all Mode 2, high amplitude.

Musical Result: A bustling, brassy texture with constant activity. Many overlapping short events create complex interference patterns; wide frequency range fills spectral space.

Parameter Ranges

📊 Preset Parameter Specifications

Base frequency: Fixed at 110 Hz (A2) for all presets, but individual events span:

  • Preset 1: 110‑880 Hz (1‑8× base)
  • Preset 2: 55‑275 Hz (0.5‑2.5× base)
  • Preset 3: 440‑1100 Hz (4‑10× base)
  • Preset 4: 110‑1320 Hz (1‑12× base)

Event counts: 8‑25 events depending on density goals.

Time distributions: Preset 1 has structured sections; others have uniform random within bounds.

Amplitude ranges: Peak amplitude 0.2‑1.0, with presets having different average levels.

Synthesis Pipeline

Event Generation

Stochastic Scheduling

For each preset, events are generated with controlled randomness:

if preset = 1 # Full Composition for i from 1 to 14 if i <= 4: section = 1, t_range = [0, 0.3×duration] elsif i <= 10: section = 2, t_range = [0.3×duration, 0.7×duration] else: section = 3, t_range = [0.6×duration, 0.9×duration] start_t[i] = randomUniform(t_min, t_max) if section = 1: dur = 8‑14s, freq = 110‑330Hz, mode=1, amp=0.3‑0.6 if section = 2: dur = 4‑8s, freq = 220‑880Hz, mode=2, amp=0.7‑1.0 if section = 3: dur = 6‑10s, freq = 110‑440Hz, mode=3, amp=0.2‑0.5 endfor Duration clipping: if start_t + dur > master_duration, reduce dur accordingly.

Parameter Arrays

Five arrays store event parameters:

start_t[1..n_events] # Start time (seconds) dur[1..n_events] # Duration (seconds) freq[1..n_events] # Base frequency (Hz) mode[1..n_events] # Mutation mode (1, 2, or 3) pk[1..n_events] # Peak mutation amount (0‑1) These arrays drive both synthesis and visualization.

Voice Synthesis

Per‑Event Processing

For each event i: STEP A: Create sine voice Create Sound: "if x < start_t then 0 else sin(2π×freq×(x−start_t)) fi" Duration: start_t + dur (silence before event) STEP B: Create envelopes Morph envelope: "if x < start_t then 0 else pk×(abs(sin(π×(x−start_t)/dur)))^1.5 fi" Amplitude envelope: "if x < start_t then 0 else (sin(π×(x−start_t)/dur))^2 fi" STEP C: Apply spectral mutation if mode = 1: blend sine with −0.3×sine + 2.0×sine³ − 0.7×sine⁵ if mode = 2: blend sine with 0.5×sine + 0.5×(2×sine² − 1) if mode = 3: blend sine with 64×sine⁷ − 112×sine⁵ + 56×sine³ − 7×sine STEP D: Apply amplitude envelope Multiply by amplitude envelope STEP E: Accumulate to master master = master + voice STEP F: Cleanup Remove temporary voice and envelope objects

Envelope Design

Two complementary envelopes shape each event:

Morph envelope: Controls spectral mutation amount over time
Formula: pk × (abs(sin(π×t/dur)))^1.5
Shape: Rises to peak at center, falls to zero at ends
Purpose: Spectral complexity peaks in middle of event

Amplitude envelope: Controls overall loudness
Formula: (sin(π×t/dur))²
Shape: Raised cosine (smooth fade in/out)
Purpose: Natural attack/decay without clicks

Interaction: Sound begins as pure sine, mutates to complex spectrum, returns to sine.

Master Mix Assembly

Additive Accumulation

All voices sum into a master buffer:

Initialize: Create master sound of duration master_duration, all zeros For each event: master = master + voice Finalize: Scale peak to 0.95 (normalize) The additive approach ensures: • No clipping during accumulation (voices have limited amplitude) • Simple, predictable mixing • Easy isolation of individual events (if needed)

Timing Precision

To avoid alignment issues:

Critical implementation detail: Each voice is created with duration = start_t + dur The formula includes: "if x < start_t then 0 else ..." This ensures: • Voice starts exactly at start_t • No samples before start_t contribute • Master addition aligns perfectly Alternative approach (creating voice at exact duration and shifting) proved unreliable in Praat.

Visualization

The Spectral Score

Graphical Representation

🎨 Time‑Frequency Score Display

The visualization creates a "score" showing all events as frequency trajectories over time.

Layout:

  • X‑axis: Time (0 to master_duration seconds)
  • Y‑axis: Frequency (0 to max_freq Hz, auto‑scaled)
  • Background: Black with subtle gray grid
  • Events: Colored lines showing frequency modulation
  • Base frequency: Dimmer horizontal line at event's base freq

Purpose: Visualize the algorithmic composition structure, showing event density, frequency distribution, and temporal evolution.

Color Coding System

Time‑based gradient shows progression:

time_ratio = start_time / master_duration if time_ratio < 0.25: # Early: Blue → Cyan r = 0.3, g = 0.5→0.8, b = 1.0 elsif time_ratio < 0.5: # Early‑mid: Cyan → Green r = 0.3, g = 0.8→1.0, b = 1.0→0.6 elsif time_ratio < 0.75: # Mid‑late: Green → Yellow r = 0.3→0.8, g = 1.0, b = 0.6→0.0 else: # Late: Yellow → Red r = 0.8→1.0, g = 1.0→0.7, b = 0.0 Brightness adjusted by mode (1=1.0, 2=0.85, 3=0.95)

Drawing Algorithm

Frequency Trajectory Calculation

Each event's frequency modulation is drawn:

For event with start_t, dur, freq, pk: steps = 30 # Line segments per event for s from 1 to steps: nt = s / steps # Normalized time (0‑1 within event) t_curr = start_t + (nt × dur) env_val = (abs(sin(π × nt)))^1.5 # Same as morph envelope f_curr = freq + (env_val × pk × 200) # Frequency deviation Draw line from (t_prev, f_prev) to (t_curr, f_curr) Base frequency line drawn separately (thinner, dimmer).

Visualization Pipeline

STEP 1: Setup Erase all existing pictures Calculate max_freq (highest event frequency + margin) STEP 2: Title section Display preset name and parameters STEP 3: Main score area Set viewport: 0‑10 (horizontal), 1‑7 (vertical) Set axes: time 0‑duration, freq 0‑max_freq Paint black background STEP 4: Draw grids Frequency grid at 110 Hz intervals (gray) Time grid at 2‑10 s intervals (gray) STEP 5: Draw events For each event: calculate color, draw trajectory STEP 6: Draw axes and labels White axes, labeled with time/frequency STEP 7: Info text Display event count, duration, base frequency

Interpretation Guide

📈 Reading the Spectral Score

Horizontal position: When event occurs in time

Vertical position: Base frequency (center of wiggly line)

Line wiggle amplitude: Amount of frequency modulation (pk parameter)

Line color: Time of event start (blue=early, red=late)

Line brightness: Mutation mode (brightest=Mode 1)

Event density: How many lines in time region

Frequency distribution: How lines are spread vertically

Preset 1 special pattern: Three clear clusters (sections)

Applications

Algorithmic Composition

Use case: Generate complete musical works from mathematical specifications.

Technique: Use Preset 1 (Full Composition) as starting point, modify parameters, run multiple times, select best results.

Workflow:

Sound Design & Texture Creation

Use case: Create evolving textures for film, game, or experimental music.

Technique: Use Preset 2 (Odd Harmonics) for woody drones, Preset 3 (High Order) for metallic textures, Preset 4 (Density) for chaotic beds.

Advantages:

Educational Tool

Use case: Teach spectral synthesis, algorithmic composition, computer music history.

Technique: Compare presets, modify parameters, observe audio and visual results.

Learning objectives:

Research & Exploration

Use case: Explore parameter spaces in algorithmic composition.

Technique: Modify script to systematically vary parameters, analyze results.

Example studies:

Practical Workflow Examples

🎬 Film Score Texture

Goal: Create evolving background texture for sci‑fi scene.

Settings:

  • Preset: 3 (High Order)
  • Duration: 45.0 s
  • Post‑process: Add reverb and subtle pitch modulation in DAW
  • Visualization: Disable for faster rendering

Result: A sparkling, metallic texture that slowly evolves over 45 seconds, suitable for space or technology scenes.

🎵 Generative Music Installation

Goal: Create continuously varying sound for art installation.

Settings:

  • Preset: 1 (Full Composition)
  • Duration: 180.0 s (3 minutes)
  • Run in loop: Modify script to generate new composition when previous ends
  • Parameter drift: Slowly change base frequency over multiple runs

Result: A never‑repeating sound environment with clear structural arcs every 3 minutes.

🔬 Psychoacoustic Experiment

Goal: Test perception of spectral mutation.

Settings:

  • Create pairs of sounds: same parameters except mutation mode
  • Use short durations (5‑10 s) for clear comparison
  • Ask listeners: "Which sound is more metallic/woody/brassy?"
  • Record visualizations for correlation with perception

Result: Data on how different Chebyshev polynomials affect timbre perception.

Advanced Techniques

Script modification ideas:
  • Parameter automation: Modify script so parameters change during composition (e.g., base frequency sweeps up over time).
  • External control: Read parameters from text file for precise control over each event.
  • Multi‑layer output: Generate separate tracks for each mutation mode, mix in DAW.
  • Real‑time control: Adapt script to respond to MIDI or OSC messages for live performance.
  • Export events separately: Save each event as individual sound for granular rearrangement.
Creative parameter explorations:
  • Extreme durations: 300 s (5 minute) compositions with very slow evolution.
  • Micro‑events: 100 events of 0.5 s each for granular texture.
  • Frequency modulation: Replace fixed frequency with sweeping or LFO‑modulated frequency.
  • Custom polynomials: Experiment with different Chebyshev combinations or other orthogonal polynomials.
  • Spatialization: Add stereo panning based on frequency or time position.

Troubleshooting Common Issues

Problem: Composition too sparse or empty
Cause: Too few events for duration, or events clustered in small time region.
Solution: Increase event count, adjust time distribution bounds, or use Preset 4 (high density).
Problem: Harsh, noisy sound
Cause: Too many high‑frequency events with high mutation amounts.
Solution: Use Preset 2 (lower frequencies), reduce pk values, or use Mode 1 (softer mutation).
Problem: Visualization missing or distorted
Cause: Praat picture window too small, or events outside expected frequency range.
Solution: Maximize Praat picture window; check max_freq calculation in script.
Problem: Script runs slowly
Cause: Many events with long durations, or visualization enabled for long compositions.
Solution: Disable visualization (show_visuals = 0), reduce event count or duration.

Technical Deep Dive

Chebyshev Polynomial Properties

Harmonic Generation

Why Chebyshev polynomials for spectral mutation?

Key property: Tₙ(cos θ) = cos(nθ) Thus for sine input (phase shifted cosine): Tₙ(sin ωt) = Tₙ(cos(ωt − π/2)) = cos(n(ωt − π/2)) = harmonic at frequency n×ω (with phase shift) Therefore: Mode 1: −0.3×T₁ + 2.0×T₃ − 0.7×T₅ Generates harmonics 1, 3, 5 with specified weights Mode 2: 0.5×T₁ + 0.5×T₂ Generates harmonics 1 and 2 Mode 3: T₇ Generates 7th harmonic only

Numerical Stability

Direct polynomial evaluation vs. trigonometric form:

The script uses direct polynomial evaluation: T₇(x) = 64x⁷ − 112x⁵ + 56x³ − 7x For x = sin ωt with |x| ≤ 1, this is stable. Alternative: Compute cos(7×ωt) directly would be: sin ωt → phase → 7×phase → cos But polynomial form allows blending between polynomials: (1‑m)×T₁ + m×T₇ (cannot blend phase computations)

Random Number Generation

Praat's Random Functions

The script uses Praat's built‑in random generators:

run_id = randomInteger(1, 999999) # Seed for reproducibility randomUniform(min, max) # Uniform distribution Used for: start times, durations, frequencies, amplitudes The randomness is: • Pseudorandom (deterministic given seed) • Uniform within specified bounds • Independent for each parameter No Gaussian or other distributions used.

Reproducibility

Run ID ensures reproducible compositions:

Run ID principle:
• Script starts with randomInteger(1, 999999)
• This seed determines all subsequent random values
• Same Run ID = same random sequence = identical composition

Practical use:
• Note Run ID from successful compositions
• Hard‑code that ID to recreate exact composition
• Or: Modify script to accept Run ID as parameter

Without fixed seed: Different composition each run (desired for exploration).

Memory Management

Object Cleanup Strategy

The script carefully manages Praat objects:

For each event: Create: Voice sound, Morph envelope, Amplitude envelope Process: Apply formulas to voice Accumulate: Add to master Remove: Voice + both envelopes This prevents: • Memory buildup with many events • Cluttered object list • Slowdown from too many objects Master sound persists for playback and saving.

Formula‑Based Efficiency

Using Praat's Formula for vectorized operations:

Instead of sample‑by‑sample loops: Formula: "self * Sound_env[]" Praat applies the operation to all samples at once (vectorized). This is dramatically faster than: for sample from 1 to n_samples value = Get value at sample... Set value at sample... endfor All synthesis uses Formula operations where possible.