Fractal Convolution Swarm — User Guide

Multi-scale fractal convolution processing: applies recursive delay networks with exponentially increasing time scales to create complex, swarm-like textures and spatial effects.

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

What this does

This script implements fractal convolution swarm processing — a multi-scale algorithmic approach to audio effects that creates complex, evolving textures through recursive delay networks. The algorithm applies convolution kernels at exponentially increasing time scales (fractal depth levels), with weighted mixing that creates swarm-like spatial and textural effects. Each depth level processes the audio with progressively longer delays and convolution kernels, creating a rich, multi-layered result that resembles natural swarm behavior or granular textures.

Key Features:

What are fractal convolution swarms? Traditional effects: reverb, delay, chorus, granular synthesis. Fractal convolution swarms: multi-scale delay networks with exponentially increasing time intervals, processed through convolution kernels at each scale. The "fractal" aspect comes from self-similar processing across different time scales — the same convolution pattern repeats but with exponentially increasing delay times. The "swarm" effect emerges from the complex interference patterns created by multiple delayed versions of the signal mixing together. Advantages: (1) Natural complexity: Creates organic, evolving textures similar to natural phenomena. (2) Multi-scale richness: Simultaneous processing at micro and macro time scales. (3) Spatial depth: Creates immersive, three-dimensional sound fields. (4) Algorithmic control: Precise mathematical parameters for reproducible results. Use cases: Experimental sound design, ambient music production, spatial audio, generative composition, psychoacoustic research.

Technical Implementation: (1) Depth iteration: For each depth level (1 to fractal_depth): Calculate current_delay = base_delay × (depth_scale_factor ^ depth), Calculate depth_weight = 1 / √depth. (2) Kernel iteration: For each kernel offset (-convolution_width to +convolution_width, excluding 0): Calculate kernel_weight = 1 / (1 + |kernel|), Calculate total_shift = current_delay + (kernel × round(current_delay × 0.3)). (3) Signal processing: Apply convolution formula: output = input × (1 - mix_amount × kernel_weight × depth_weight) + delayed_input × (mix_amount × kernel_weight × depth_weight). (4) Final processing: Scale peak to prevent clipping, rename output. Key insight: The algorithm creates a recursive network where each depth level processes the signal with exponentially longer delays, and each kernel offset creates additional variations. The weighted mixing ensures that higher depth levels and kernel offsets contribute less to the final result, creating a natural-sounding complexity.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…fractal_convolution_swarm.praat.
  3. Choose Preset or select "Custom" to specify parameters manually.
  4. Adjust fractal_depth (number of recursive processing levels).
  5. Set convolution_width (kernel processing range).
  6. Configure base_delay_ms (starting delay time in milliseconds).
  7. Set depth_scale_factor (delay multiplier per depth level).
  8. Adjust mix_amount (wet/dry balance per iteration).
  9. Enable play_after_processing to hear result immediately.
  10. Click OK — processing applied, result named "originalname_fractal_convolution_swarm".
Quick tip: Start with Ambient Swarm preset for balanced processing — creates rich textures without overwhelming the source. Use Subtle Texture for gentle enhancement. Dense Cloud and Granular Dispersion create more pronounced effects. Extreme Fractal for maximum processing intensity. Higher fractal_depth creates more complex results but increases processing time. Wider convolution_width creates denser textures. Lower mix_amount preserves more of the original signal. Processing time increases with depth and width — complex settings may take several seconds. Output "originalname_fractal_convolution_swarm" appears in Objects window.
Important: PROCESSING INTENSIVE — higher depth and width values significantly increase computation time. Very high settings (depth > 8, width > 6) may cause temporary freezing on slower systems. The algorithm is destructive — original amplitude relationships are altered. Very high mix_amount values (>0.7) can cause excessive feedback and potential clipping. Extreme settings may create unpredictable results — always preview with play_after_processing enabled. The effect works best on sounds with clear transient content — very noisy or dense signals may become muddy. For vocal processing, use moderate settings to maintain intelligibility. Always save your original sound before processing.

Fractal Convolution Theory

Fractal Mathematics Basics

Self-Similarity Across Scales

Fractal concept in audio:

Fractal processing applies the same operation at multiple scales: Scale 1: Process with delay T Scale 2: Process with delay T × r Scale 3: Process with delay T × r² ... Scale n: Process with delay T × r^(n-1) Where: T = base delay time r = scale factor (depth_scale_factor) n = fractal_depth This creates self-similar processing patterns: The same convolution kernel is applied But at exponentially increasing time intervals Creating complex interference patterns Mathematical foundation: Fractal dimension D = log(N) / log(1/r) Where N = number of similar elements at each scale In our case: N = 2 × convolution_width + 1

Why Exponential Scaling?

Advantages of exponential time scaling:

Vs linear scaling:

Convolution Kernel Processing

Multi-Offset Convolution

Convolution kernel definition:

For each depth level d: For each kernel offset k from -width to +width (excluding 0): Kernel processing: total_shift = current_delay + (k × round(current_delay × 0.3)) kernel_weight = 1 / (1 + |k|) Signal mixing: output = dry × (1 - M × W_k × W_d) + wet × (M × W_k × W_d) Where: M = mix_amount W_k = kernel_weight W_d = depth_weight dry = original signal wet = delayed signal (shifted by total_shift) This creates a weighted convolution where: Center kernels (small |k|) contribute more Outer kernels (large |k|) contribute less Higher depth levels contribute less (natural decay)

Why Convolution Width?

Kernel width interpretation:

🔬 Acoustic Intuition

Think of fractal convolution as:

Multiple echo chambers nested within each other

Each depth level = a larger echo chamber

Each kernel offset = a different reflection path

The weighting creates natural distance perception

Result: Complex spatial impression similar to natural environments

Weighting Strategies

Depth Weighting

Depth weight formula:

depth_weight = 1 / √depth Why square root? Natural decay: higher depths contribute but less strongly Prevents overwhelming by highest depth levels Creates balanced contribution across scales Alternative weighting schemes: Linear: 1/depth (too aggressive decay) Exponential: 1/2^depth (too rapid decay) Square root: Balanced, natural-sounding

Kernel Weighting

Kernel weight formula:

kernel_weight = 1 / (1 + |kernel|) Center-weighted kernel: kernel = 0 (excluded from processing) kernel = ±1: weight = 1/2 = 0.5 kernel = ±2: weight = 1/3 ≈ 0.333 kernel = ±3: weight = 1/4 = 0.25 This creates: Strongest contribution from nearest offsets Gradual fall-off for farther offsets Natural-sounding convolution pattern

Complete Processing Algorithm

INPUT: Sound object, parameters STEP 1: Initialization originalName$ = selected$("Sound") Copy: originalName$ + "_fractal_swarm" sampling = Get sampling frequency base_delay = round(base_delay_ms * sampling / 1000) STEP 2: Fractal Depth Processing FOR depth FROM 1 TO fractal_depth: current_delay = round(base_delay * (depth_scale_factor ^ depth)) depth_weight = 1 / sqrt(depth) STEP 3: Convolution Kernel Processing FOR kernel FROM -convolution_width TO convolution_width: IF kernel ≠ 0: kernel_weight = 1 / (1 + abs(kernel)) total_shift = current_delay + (kernel * round(current_delay * 0.3)) STEP 4: Signal Mixing Formula: "self * (1 - 'mix_amount' * 'kernel_weight' * 'depth_weight') + self[max(1, min(ncol, col + 'total_shift'))] * ('mix_amount' * 'kernel_weight' * 'depth_weight')" END FOR (kernel) END FOR (depth) STEP 5: Final Processing Scale peak: scale_peak Rename: originalName$ + "_fractal_convolution_swarm" IF play_after_processing: Play OUTPUT: Processed sound with fractal convolution swarm effect

Parameter Interactions

How Parameters Affect Each Other

Key relationships:

fractal_depth × depth_scale_factor:
Depth controls number of scales, scale_factor controls spacing
High depth + high scale_factor = very wide time range
Low depth + low scale_factor = narrow, focused processing

convolution_width × mix_amount:
Width controls density, mix_amount controls intensity
High width + high mix = very dense, potentially muddy
Low width + low mix = subtle, transparent effect

base_delay_ms × depth_scale_factor:
Base delay sets starting point, scale_factor sets progression
Small base + high factor = rapid progression to long delays
Large base + low factor = slow progression, more similar scales

Computational Complexity

Processing time estimation:

Total operations ≈ O(N × D × W) Where: N = number of samples in sound D = fractal_depth W = 2 × convolution_width Examples: Sound: 10 seconds at 44.1 kHz → N = 441,000 samples Settings: D=5, W=6 → operations ≈ 441,000 × 5 × 6 = 13,230,000 Processing time scales linearly with: Sound duration Fractal depth Convolution width Memory usage: Moderate (working on copy, temporary buffers)

Preset Descriptions

Preset 1: Custom

🎛️ Manual Parameter Control

Character: Full control over all parameters

Use case: Experimental sound design, precise control

Recommended for: Users familiar with fractal processing concepts

Preset 2: Subtle Texture

🌫️ Gentle Enhancement

Settings: depth=3, width=2, base_delay=3.0ms, scale=1.4, mix=0.2

Character: Light texturing, preserves original sound character

Use case: Adding subtle depth and space without obvious effect

Best for: Vocals, acoustic instruments, transparent enhancement

Preset 3: Ambient Swarm

🌌 Balanced Spatial Effect

Settings: depth=5, width=3, base_delay=5.0ms, scale=1.6, mix=0.3

Character: Rich, evolving textures with good spatial depth

Use case: Ambient music, pad sounds, creating atmospheric spaces

Best for: Synthesizers, processed vocals, environmental sounds

Preset 4: Dense Cloud

☁️ Thick Textural Processing

Settings: depth=6, width=4, base_delay=7.0ms, scale=1.8, mix=0.4

Character: Dense, complex textures with significant transformation

Use case: Sound design, experimental music, creating sonic clouds

Best for: Percussion, noise sources, synthetic sounds

Preset 5: Granular Dispersion

⚡ Time-Scattered Effects

Settings: depth=7, width=5, base_delay=8.0ms, scale=2.0, mix=0.45

Character: Granular-like dispersion with fractal organization

Use case: Rhythmic fragmentation, glitch effects, time manipulation

Best for: Rhythmic material, speech, melodic fragments

Preset 6: Extreme Fractal

🔥 Maximum Processing Intensity

Settings: depth=8, width=6, base_delay=10.0ms, scale=2.2, mix=0.5

Character: Extreme transformation, potentially overwhelming

Use case: Sound destruction, experimental noise, extreme effects

Best for: Short sounds, noise sources, extreme sound design

Preset 7: Gentle Shimmer

💎 Delicate High-Frequency Enhancement

Settings: depth=4, width=2, base_delay=2.5ms, scale=1.3, mix=0.15

Character: Subtle high-frequency sparkle and shimmer

Use case: Adding air and sparkle, gentle high-end enhancement

Best for: Cymbals, vocals, acoustic guitars, high-frequency content

Preset Selection Guide

ApplicationRecommended PresetAlternativeNotes
VocalsSubtle TextureGentle ShimmerPreserve intelligibility
Drums/PercussionAmbient SwarmGranular DispersionAdd space without losing impact
Pads/AmbientDense CloudAmbient SwarmEnhance textural quality
Sound DesignGranular DispersionExtreme FractalCreative transformation
Acoustic InstrumentsSubtle TextureGentle ShimmerNatural enhancement
ExperimentalExtreme FractalCustomMaximum processing
MasteringGentle ShimmerSubtle TextureSubtle enhancement only

Parameters & Controls

Core Processing Parameters

ParameterTypeRangeDefaultDescription
fractal_depthnatural1-105Number of recursive processing levels
convolution_widthnatural1-83Kernel processing range (each side)
base_delay_mspositive0.1-50.05.0Starting delay time in milliseconds
depth_scale_factorpositive1.1-3.01.6Delay multiplier per depth level
mix_amountpositive0.0-1.00.3Wet/dry mix per iteration

Output Parameters

ParameterTypeRangeDefaultDescription
scale_peakpositive0.1-1.00.95Output normalization level
play_after_processingboolean0/11Auto-play result

Parameter Effects Summary

fractal_depth (1-10):
1-3: Subtle, minimal processing
4-6: Moderate, balanced effect
7-10: Extreme, dense processing
>8: Very CPU intensive

convolution_width (1-8):
1: Simple, sparse texture
2-4: Rich, complex texture
5-8: Very dense, potentially muddy
>6: Extreme CPU load

base_delay_ms (0.1-50.0):
<5ms: Micro-time effects, chorus-like
5-20ms: Clear delay perception
>20ms: Distinct echoes, rhythmic effects

depth_scale_factor (1.1-3.0):
1.1-1.5: Gradual progression
1.6-2.0: Moderate progression
2.1-3.0: Rapid progression to long delays

mix_amount (0.0-1.0):
0.0-0.2: Very subtle
0.3-0.5: Moderate effect
0.6-1.0: Strong, potentially overwhelming

Applications

Ambient Music Production

Use case: Creating evolving pads and atmospheric textures

Technique: Use Ambient Swarm or Dense Cloud presets

Workflow: Process synth pads, vocal samples, or acoustic sources

Sound Design & Experimental Music

Use case: Transforming ordinary sounds into complex textures

Technique: Extreme Fractal or Granular Dispersion presets

Examples: Turn percussion into clouds, speech into textures, noise into structures

Spatial Audio Enhancement

Use case: Adding depth and space to mono or dry recordings

Technique: Subtle Texture or Gentle Shimmer with low mix amounts

Advantages: Creates natural-sounding space without traditional reverb

Rhythmic Processing

Use case: Creating complex rhythmic patterns from simple sources

Technique: Granular Dispersion with rhythmic source material

Application: Drum processing, glitch effects, rhythmic fragmentation

Vocal Processing

Use case: Adding character and space to vocals

Technique: Subtle Texture or Gentle Shimmer presets

Considerations: Maintain intelligibility, use moderate settings

Practical Workflow Examples

🎵 Ambient Pad Creation

Goal: Transform simple synth patch into evolving ambient pad

Settings:

  • Preset: Dense Cloud
  • Optional: Reduce mix_amount to 0.35 if too intense
  • Process entire sound or individual notes

Result: Rich, evolving texture with complex spatial characteristics

🥁 Drum Texturing

Goal: Add space and texture to drum samples

Settings:

  • Preset: Ambient Swarm
  • Process individual hits or entire loops
  • For loops: consider lower mix_amount (0.2-0.25)

Result: Drums with enhanced space and complex tail characteristics

🎤 Vocal Enhancement

Goal: Add subtle depth and character to vocals

Settings:

  • Preset: Subtle Texture
  • Optional: Gentle Shimmer for brighter vocals
  • Always preview to maintain intelligibility

Result: Vocals with enhanced presence and subtle spatial quality

Advanced Techniques

Layered processing:
  • Multiple passes: Apply different presets sequentially
  • Section processing: Apply different settings to different sound sections
  • Mix blending: Process copy and mix with original
  • Parameter automation: Change settings over time for evolving effects

Experiment with unconventional source material for unique results

Creative sound sources:
  • Field recordings: Transform environmental sounds
  • Noise sources: Create structured textures from noise
  • Silence/room tone: Process to create atmospheric beds
  • Extreme settings: Push parameters beyond normal ranges

Troubleshooting Common Issues

Problem: Processing too slow
Cause: High fractal_depth and/or convolution_width
Solution: Reduce depth to 3-5, width to 2-3
Problem: Result too muddy/unclear
Cause: Excessive mix_amount or convolution_width
Solution: Reduce mix_amount to 0.2-0.3, lower width
Problem: Clipping/distortion
Cause: High mix_amount causing excessive level buildup
Solution: Reduce mix_amount, ensure scale_peak = 0.95 or lower
Problem: Effect too subtle
Cause: Low mix_amount or insufficient depth/width
Solution: Increase mix_amount to 0.4-0.5, try higher depth/width

Mathematical Deep Dive

Fractal Dimension Calculation

Estimating Fractal Dimension

For fractal convolution swarm:

Fractal dimension D = log(N) / log(1/r) Where: N = number of similar elements at each scale r = scale factor (1/depth_scale_factor) In our algorithm: N = 2 × convolution_width (kernel offsets at each depth) r = 1 / depth_scale_factor Example: convolution_width = 3, depth_scale_factor = 1.6 N = 2 × 3 = 6 r = 1 / 1.6 = 0.625 D = log(6) / log(1/0.625) = log(6) / log(1.6) D ≈ 1.7918 / 0.4700 ≈ 3.81 This high dimension indicates very complex, space-filling behavior

Interpreting Fractal Dimension

Dimension ranges and meanings:

D < 2.0: Simple, sparse texture
D = 2.0-3.0: Moderate complexity
D = 3.0-4.0: Complex, dense texture
D > 4.0: Extremely complex, potentially overwhelming

Most natural sounds and textures: D ≈ 2.0-3.0
The algorithm typically creates: D ≈ 3.0-4.5
Higher dimension = more complex, detailed result

Signal Processing Mathematics

Transfer Function Analysis

Frequency domain effects:

The processing creates a complex transfer function: H(ω) = Σ[d=1 to D] Σ[k=-W to W] [M × W_d × W_k × e^(-iωτ_dk)] Where: ω = angular frequency τ_dk = delay for depth d, kernel k M = mix_amount W_d = depth_weight W_k = kernel_weight This creates: Comb filtering effects from delayed versions Complex interference patterns Frequency-dependent amplitude and phase changes Self-similar spectral structure The result: rich, evolving spectral texture with fractal characteristics

Computational Complexity Analysis

Big-O notation analysis:

Time complexity: O(N × D × W) Where: N = number of samples D = fractal_depth W = 2 × convolution_width Space complexity: O(N) (working on copy) For typical values: N = 441,000 (10 seconds at 44.1 kHz) D = 5, W = 6 Operations ≈ 441,000 × 5 × 6 = 13,230,000 Optimizations: The algorithm is already optimized for Praat Chunked processing not needed (single pass efficient) Memory usage minimal (in-place processing with temporary buffers)