Stereo Mosaic — User Guide

Multi‑file audio collage tool that chops multiple sound files into regions and arranges them across stereo channels using creative distribution strategies.

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

What this does

This script creates a stereo audio mosaic from multiple input files. It chops each sound into regions, applies various transformations (pitch shift, reverse, filtering), then distributes the regions between left and right channels according to creative strategies. The result is a complex stereo collage where different source materials interweave across the stereo field.

Key Features:

What is an audio mosaic? Like a visual mosaic made from small tiles, an audio mosaic combines fragments (regions) from multiple source sounds. Each region can be transformed individually, then arranged spatially across the stereo field. This creates dense, evolving textures where listeners can pick out familiar fragments while experiencing a new composite whole.

Technical Implementation: (1) File preparation: All inputs converted to mono, resampled to common rate. (2) Region segmentation: Each file divided into N equal regions (with optional overlap). (3) Region processing: Each region can be pitch‑shifted, reversed, time‑stretched, filtered, attenuated. (4) Channel assignment: Region assigned to L or R based on strategy. (5) Assembly: Regions concatenated with optional gaps. (6) Stereo processing: Width adjustment, cross‑channel bleed applied. (7) Visualization: Region distribution plotted with transformation markers.

Quick start

  1. In Praat, select 2 or more Sound objects (Shift‑click to multi‑select).
  2. Run script…Stereo_Mosaic.praat.
  3. Choose a Preset or select "Custom" for full control.
  4. Adjust Regions per file (typically 4‑12).
  5. Select a Channel strategy for stereo distribution.
  6. Enable Draw visualization to see region distribution.
  7. Click OK – output named mosaic_Nf_Rr appears.
Quick tip: Start with 3‑5 contrasting sounds (speech, instrument, percussion). Use Classic Ping Pong preset for clear alternating pattern. Set Regions per file = 4‑6. Enable visualization to see how regions are distributed. The output will be a stereo file where fragments jump between channels.
Important: All input files are converted to mono before processing. Very short files (<1 s) may produce tiny regions if many regions are requested. Files with different sample rates are resampled to the highest rate among them. Processing time increases with more files and more regions. The script creates many temporary objects; ensure sufficient RAM for large projects.

Mosaic Concept

The Three‑Stage Pipeline

Stage 1: Deconstruction
• Multiple source files selected
• Each file divided into N equal‑length regions
• Regions can overlap (percentage)
• Gaps can be inserted between regions
Stage 2: Transformation
• Each region processed individually:
– Pitch shift (random within range)
– Reverse (probability‑based)
– Time‑stretch (tempo scaling)
– Channel‑specific filtering
– Amplitude variation
– Fade in/out applied
Stage 3: Spatial Reassembly
• Regions assigned to L or R channel via strategy
• Concatenated in order of processing
• Stereo width adjustment
• Cross‑channel bleed for cohesion
• Peak normalization

Region Segmentation Mathematics

For each file with duration D: # With overlap percentage O (0‑50%) overlap_factor = 1 - (O / 100) # Step size accounts for overlap step_size = D / (N × overlap_factor - (1 - overlap_factor)) # Region duration region_duration = step_size # Region start positions start_k = time_offset + (k-1) × step_size × overlap_factor end_k = start_k + region_duration # Time offset adds randomness max_offset = D × (random_time_offset_percent / 100) time_offset = randomUniform(0, max_offset) Example: D=10s, N=5, O=20%: overlap_factor = 0.8 step_size = 10 / (5×0.8 - 0.2) = 10 / 3.8 ≈ 2.63s Regions: [0‑2.63], [2.10‑4.73], [4.20‑6.83], [6.30‑8.93], [8.40‑10.0]

Transformation Stack

For each region, transformations apply in this order:
1. Extraction – Cut from source file
2. Tempo scaling – Time‑stretch (Lengthen)
3. Pitch shifting – PSOLA‑based pitch change
4. Channel filtering – L/R‑specific EQ
5. Reverse – Possibly inverted (probability)
6. Amplitude scaling – Random gain
7. Attenuation – Divide by attenuation_divisor
8. Fade in/out – Smooth edges
9. Pan jitter – Soft channel reassignment
Final stereo processing (after all regions assembled):
• Stereo width adjustment (M/S processing)
• Cross‑channel bleed (L←R, R←L)
• Peak normalization

Channel Distribution Strategies

Strategy 1: Alternating

Pattern: L, R, L, R, L, R...
Logic: Odd‑numbered regions → Left, Even → Right
Effect: Regular ping‑pong between channels
Example (5 regions): L, R, L, R, L
Best for: Clear stereo separation, rhythmic patterns

Strategy 2: Left first / Right second

Pattern: L, L, L, R, R, R...
Logic: First half of regions → Left, Second half → Right
Effect: Accumulation on one side then the other
Example (6 regions): L, L, L, R, R, R
Best for: Structural contrasts, sectional development

Strategy 3: Random split

Pattern: Random L/R assignment
Logic: 50% probability for each channel
Effect: Unpredictable stereo field
Example: L, R, R, L, R, L, L, R
Best for: Experimental textures, glitch effects

Strategy 4: Reverse order

Pattern: R, L, R, L, R, L...
Logic: Opposite of Alternating (even→L, odd→R)
Effect: Inverted ping‑pong pattern
Example (5 regions): R, L, R, L, R
Best for: Creating contrast with Strategy 1 results

Strategy 5: Inside out

Pattern: Symmetrical from center
Logic: Regions equidistant from center get same channel
Effect: Mirror‑image stereo field
Example (7 regions): L, R, L, C?, L, R, L (C = center hypothetical)
Best for: Spatial symmetry, centered focus

Strategy 6: Spiral pattern

Pattern: Golden ratio‑based progression
Logic: φ = 1.618, position = (file# × φ + region#) mod 2
Effect: Complex, quasi‑random but deterministic
Example: L, R, L, L, R, L, R, R... (non‑repeating)
Best for: Natural‑sounding distribution, avoiding patterns

Pan Jitter (Soft Strategy)

Applied after channel assignment: Each region has probability (pan_jitter_percent) to shift toward opposite channel. Creates "soft" boundaries rather than hard L/R separation. Example: Region assigned to Left has 30% chance to move to Right if pan_jitter=30.

Presets & Parameters

Built‑in Presets

PresetRegionsStrategyKey TransformationsCharacter
Classic Ping Pong4AlternatingNone (clean) Clear alternating pattern, transparent
Glitchy Scatter8RandomPitch±6st, 40% reverse, gaps Chaotic, broken, glitch‑heavy
Spectral Dance6SpiralL highpass 300Hz, R lowpass 4kHz Bright L, dark R, spectral separation
Wide Stereo Field5AlternatingWidth=180%, pan jitter 50% Extreme stereo width, movement
Dense Overlap12Random40% overlap, pitch±3st, bleed 15% Thick, overlapping, complex texture
Minimal Sparse3Split300ms gaps, 10% reverse Open, sparse, contemplative

Basic Parameters

ParameterDefaultRangeDescription
Regions_per_file41‑50Number of regions to extract from each file
Channel_strategy11‑6How regions distributed between L/R (see strategies)
Overlap_percent00‑50Percentage overlap between consecutive regions
Gap_ms00‑1000Milliseconds of silence between regions
Pitch_shift_semitones0-24‑24Maximum pitch shift (±range for presets)
Reverse_percent00‑100Percentage chance each region is reversed
Stereo_width_percent1000‑200Stereo width (100% = normal, 0% = mono, 200% = extreme)

Hidden/Advanced Parameters (Set by Presets)

These parameters are controlled by presets but can be modified in script code:
  • fade_time_s (0.02‑0.08): Fade in/out duration in seconds
  • attenuation_divisor (1.0‑1.4): Divide region amplitude by this value
  • random_time_offset_percent (0‑30): Random start time offset percentage
  • duration_variation_percent (0‑30): Random region duration variation
  • tempo_scale_min/max (70‑150): Time‑stretch range percentage
  • left/right_highpass_Hz: Channel‑specific high‑pass filters
  • left/right_lowpass_Hz: Channel‑specific low‑pass filters
  • pan_jitter_percent (0‑50): Probability to shift toward opposite channel
  • cross_channel_bleed_percent (0‑15): Amount each channel bleeds into other
  • amplitude_variation_min/max (60‑140): Random gain variation percentage
Parameter philosophy: The script uses a "preset‑as‑curation" approach. Presets aren't just parameter combinations but carefully tuned aesthetic packages. Custom mode gives access to basic parameters; for advanced control, modify the script code directly. This balances accessibility for beginners with flexibility for advanced users.

Visualization

The Region Distribution Plot

Top panel: Output waveform
• Stereo waveform of final mosaic
• Shows time‑domain result of all processing
Middle panel: Left channel regions
• Blue‑tinted background
• Rectangles represent regions assigned to Left
• Y‑axis = source file number (1, 2, 3...)
• X‑axis = sequential position in Left channel
• Color indicates source file (hue‑coded)
• White "R" = region was reversed
• White number = pitch shift in semitones
Bottom panel: Right channel regions
• Orange‑tinted background
• Same layout but for Right channel regions
• Shows complementary distribution
Bottom text: Parameter summary
• Key parameter values used
• Statistics (total regions, L/R counts, duration)

Reading the Visualization

Pattern recognition examples:
Clean alternating (Strategy 1):
• Left and Right panels have equal region counts
• Regions alternate L‑R‑L‑R in source file order
• Minimal markers (few Rs or numbers)
Random distribution (Strategy 3):
• Uneven region counts between L and R
• No discernible pattern in assignments
• Potentially many transformation markers
Spectral processing (Spectral Dance preset):
• Left panel might show only certain files (filtered)
• Right panel shows complementary files
• Creates spectral separation visible in distribution
Dense overlap (Dense Overlap preset):
• Many regions per file (12)
• Potentially many transformation markers
• High region count overall

Transformation Markers

Reverse marker "R":
• White "R" in center of region rectangle
• Indicates region was reversed (time‑inverted)
• Density shows reverse_percent effect
Pitch shift number:
• White number in center of region rectangle
• Shows pitch shift in semitones (rounded)
• Positive = higher pitch, negative = lower
• Only shown if |shift| > 0.5 semitones
Color coding:
• Hue varies by source file number
• Allows tracking which fragments came from which source
• Visualizes the "mosaic" mixture

Applications

Experimental Composition & Sound Art

Use case: Creating complex textures from field recordings or found sounds.

Technique: Use 5‑10 environmental recordings with Spectral Dance preset.

Example: Urban sounds (traffic, voices, construction) → spectral separation creates immersive soundscape.

Electronic Music Production

Use case: Generating rhythmic patterns and textured backgrounds.

Technique: Drum samples + synth phrases with Glitchy Scatter preset.

Result: Complex rhythmic texture with pitch variations and stereo movement.

Vocal Processing & Chopping

Use case: Creating vocal mosaics for hip‑hop, glitch, or experimental tracks.

Workflow:

Sound Design for Media

Use case: Creating transition sounds, UI feedback, atmospheric beds.

Technique: Synthetic sounds with Wide Stereo Field preset.

Example: UI beeps/clicks → extreme width and pan jitter creates spatial interest.

Educational Demonstrations

Use case: Teaching stereo perception, audio montage, transformation effects.

Technique: Clear source material (instrument scales) with Classic Ping Pong.

Result: Audible demonstration of stereo distribution principles.

Practical Workflow Examples

🎵 Ambient Texture from Field Recordings

Goal: Create evolving ambient bed from natural sounds.

Settings:

  • Sources: 4‑5 field recordings (forest, water, wind, birds)
  • Preset: Spectral Dance (modified)
  • Regions per file: 8
  • Overlap: 25%
  • Reverse percent: 20%
  • Gap: 0ms

Result: Spectral‑separated environmental mosaic with occasional reversed fragments.

🥁 Rhythmic Glitch from Drum Samples

Goal: Create glitch‑hop style rhythmic pattern.

Settings:

  • Sources: 6‑8 drum hits (kick, snare, hi‑hat, percussion)
  • Preset: Glitchy Scatter
  • Custom: Gap=80ms (creates stuttered rhythm)
  • Pitch shift: ±8 semitones
  • Strategy: Random with 30% pan jitter

Result: Chaotic but rhythmic drum pattern with pitch variations and stereo scatter.

🗣️ Vocal Chopping for Electronic Track

Goal: Process vocal hook into chopped texture.

Settings:

  • Sources: 1‑2 vocal phrases (3‑5 seconds each)
  • Preset: Dense Overlap
  • Regions per file: 10
  • Overlap: 35%
  • Reverse: 15%
  • Cross‑channel bleed: 10%
  • Strategy: Alternating (clear L/R pattern)

Result: Dense vocal texture with overlapping fragments alternating between channels.

Troubleshooting

Problem: "Please select at least two Sound objects"
Cause: Only one or no sounds selected.
Solution: Select 2+ Sound objects (Shift‑click or Ctrl‑click in Praat Objects window).
Problem: Output is mostly silent or very quiet
Cause: Attenuation_divisor too high or amplitude_variation_min too low.
Solution: In script code, reduce attenuation_divisor (1.0‑1.2) or increase amplitude_variation_min (80‑100).
Problem: Regions sound truncated or click at edges
Cause: Fade_time_s too short for region duration.
Solution: Increase fade_time_s (0.05‑0.1) or ensure regions are long enough (>0.2s).
Problem: Stereo image collapses to mono
Cause: Stereo_width_percent = 0 or cross‑channel bleed = 100%.
Solution: Check stereo_width_percent (100 for normal), reduce cross_channel_bleed_percent.
Problem: Processing very slow with many files/regions
Cause: High region count (files × regions_per_file) creates many operations.
Solution: Reduce regions_per_file (≤8), use fewer files, or shorten source files.

Performance Optimization

For faster processing:
  • Region count: Keep total regions (files × regions_per_file) under 100.
  • File duration: Use shorter source files (≤10 s each).
  • Complex transformations: Pitch shifting and time‑stretching are computationally expensive.
  • Visualization: Turn off Draw_visualization for faster processing.
  • Filtering: Channel‑specific filters add processing time.

Creative Experimentation Tips

For unique results:
  • Source selection: Combine contrasting materials (noise + tone, speech + music).
  • Parameter extremes: Try 50% overlap, 100% reverse, extreme pitch shifts.
  • Layered processing: Process output, then process again with different settings.
  • Source preparation: Pre‑process files with effects before mosaic creation.
  • Temporal alignment: Align region boundaries to transients by adjusting time_offset.
  • Strategy combinations: Process same files with different strategies, then mix results.