Segment Mixer — Stereo Composite from Multiple Sounds
Creates stereo composites from multiple selected Sound objects. LEFT channel uses beginning segments, RIGHT channel uses end/offset/random segments. Supports multiple repeat cycles for longer compositions.
What this does
This script creates stereo composite tracks from multiple selected Sound objects. For each source file, the script extracts a segment from the beginning and places it in the left channel. A second segment is extracted from the right channel source using one of three strategies: end of file, fixed offset, or random position. All segments are concatenated sequentially, with optional fading and attenuation, and the process can be repeated in cycles to build longer compositions.
Key Features:
- Multi-file processing — select any number of Sound objects, process in order
- 3 Right channel strategies — End of file, Fixed offset, Random position
- Repeat cycles — Loop through all selected files multiple times for longer outputs
- Attenuation divisor — Reduce amplitude per segment to prevent clipping
- Cosine fading — Smooth crossfades between segments (no clicks)
- 6 Presets — Quick Collage, Slow Morph, Random Scatter, Stereo Spread, Dense Layers, Custom
- Visualization — Colour-coded segment map showing which file contributes to each segment, per channel
Quick start
- In Praat, select multiple Sound objects (2 or more).
- Run script… →
Segment_Mixer.praat. - Choose a preset from the dropdown (6 options).
- Or select "Custom" and adjust Segment_duration_s, Fade_time_s, Attenuation_divisor, Repeat_cycles.
- Select Right channel strategy (End / Offset / Random).
- If using Fixed offset, set Right_fixed_offset_s.
- Click OK — script processes all files and creates output
stereo_mix_Nfiles_Xx.
Right Channel Strategies
End of file Strategy 1
Extracts the last segment_duration_s seconds from each source file. If the file is shorter than the segment, extracts from 0.
Effect: Left channel = beginning, Right channel = ending. Creates a dramatic stereo contrast — start vs. finish of each sound.
Fixed offset Strategy 2
Extracts from offset seconds into the file. If offset + duration exceeds file length, offset is adjusted backwards.
Effect: Consistent offset across all files. Use for syncopation or aligning specific moments (e.g., 0.5s into each drum hit).
Random Strategy 3
Extracts from a uniformly random position within each file (where the segment fits).
Effect: Unpredictable, varied right channel content. Ideal for generative collages and experimental textures.
- Left: start = 0, end = min(segment_duration, file_duration)
- Right (End): start = max(0, file_duration - segment_duration), end = file_duration
- Right (Offset): start = min(offset, file_duration - segment_duration), end = start + segment_duration
- Right (Random): start = uniform(0, max(0, file_duration - segment_duration)), end = start + segment_duration
6 Presets
| Preset | Segment (ms) | Fade (ms) | Attenuation | Cycles | Right strategy | Character |
|---|---|---|---|---|---|---|
| Quick Collage | 150 | 30 | 1.2 | 4 | Random | Dense, granular texture from many short segments. |
| Slow Morph | 500 | 100 | 1.0 (no atten) | 2 | End | Smooth, gradual transitions, preserves amplitude. |
| Random Scatter | 200 | 40 | 1.3 | 5 | Random | Unpredictable, scattered stereo field. |
| Stereo Spread | 300 | 50 | 1.1 | 3 | End | Dramatic L=start / R=end contrast. |
| Dense Layers | 100 | 20 | 1.5 | 8 | Random | Very dense, highly attenuated, busy texture. |
| Custom | user | user | user | user | user | Full manual control. |
Parameters
Core parameters
| Parameter | Range | Default | Description |
|---|---|---|---|
| Segment_duration_s | >0, ≤ shortest file | 0.25 | Length of each extracted segment (seconds). |
| Fade_time_s | >0, ≤ segment/2 | 0.05 | Cosine fade duration at segment boundaries (prevents clicks). |
| Attenuation_divisor | ≥1.0 | 1.1 | Divide each segment's amplitude by this value to prevent clipping buildup. |
| Repeat_cycles | ≥1 | 3 | Number of times to loop through all selected files. |
Right channel parameters
| Parameter | Options / Range | Description |
|---|---|---|
| Right_part_strategy | End of file / Fixed offset / Random | Determines where to extract the right channel segment from each source file. |
| Right_fixed_offset_s | ≥0 | For Fixed offset strategy, the start position in seconds. |
Applications
Ambient / Soundscape Composition
Use case: Create evolving stereo textures from field recordings, synth pads, or drones.
Settings: Slow Morph preset (500 ms segments, End strategy, 2 cycles). Left channel = beginnings (attacks), right channel = endings (decays/releases).
Granular / Glitch Collage
Use case: Dense, stuttering textures from percussion or speech.
Settings: Quick Collage or Dense Layers (100–150 ms segments, Random strategy, 4–8 cycles). The short segments create a granular, pointillistic texture.
Stereo Contrast / Call-and-Response
Use case: Two different versions of the same material in left and right ears.
Settings: Stereo Spread preset. Left = starts, right = ends. Works well with spoken word (beginning vs. end of each sentence) or drum loops (attack vs. tail).
Generative / Algorithmic Composition
Use case: Randomly assembled compositions from a corpus of sounds.
Settings: Random Scatter preset (Random strategy). Each run produces a different stereo output because right channel positions are randomised. Use with a large selection of sounds for endless variation.
Workflow: Field recording collage
Source: 10–20 short field recordings (birds, water, footsteps, wind).
Settings: Random Scatter preset, segment=200 ms, cycles=3, attenuation=1.3.
Result: A dense, unpredictable stereo texture where each ear hears different moments from the same recordings. Great for installation or background ambience.
Workflow: Drum loop stereo widening
Source: Multiple drum loops (same tempo, different patterns).
Settings: Stereo Spread preset, segment=300 ms, cycles=2.
Result: Left channel = attack of each loop, right channel = decay/tail. Creates a wide, call-and-response stereo image.
Workflow: Voice → stutter / glitch
Source: Single spoken word recording (duplicated multiple times in Praat selection).
Settings: Quick Collage preset, segment=80 ms, cycles=8, Random strategy.
Result: The voice is chopped into tiny fragments and randomly rearranged in the right channel — classic glitch/stutter effect.
• Clicking between segments: Increase fade_time_s (ensure it's at least 10–20 ms). Cosine fades eliminate clicks.
• Output is too quiet: Reduce attenuation_divisor (closer to 1.0) or increase segment duration. The script normalises peak to 0.99, so quiet output indicates sparse segments or low input levels.
• Right channel sounds wrong / out of sync: Check strategy — End of file extracts the ending, which may sound very different from the beginning. Use Fixed offset with offset=0 for identical L/R content.
• Files have different sample rates: The script resamples all sounds to match the first file's rate. This may affect pitch slightly.
• Visualisation colours repeat: Colours are assigned by file index using a sine-wave hue mapping. With many files, colours may appear similar — the segment map still clearly shows segment order.
Visualization details
- Output waveform: Stereo mix (blue curve)
- Left channel segment map: Colour-coded bars, each bar = one segment. Colour indicates source file (hue cycles through files).
- Right channel segment map: Same format, using the chosen strategy.
- File legend: Colour swatches with file numbers.
- Stats panel: Total segments, final duration, fade time.