Multi-channel Random Slice Time-Stretcher — v1.2.1 User Guide
Extracts random regions from one mono working source, optionally changes their duration with Praat Manipulation/DurationTier resynthesis, places each result near its original temporal centre, and routes the isolated slices to multichannel, stereo, quad, 8-channel, or mono output.
What this does
The script selects exactly one Sound, derives a single mono working source, extracts N random slices, and creates a processed event from each slice. A duration factor other than 1 uses Praat's Manipulation + DurationTier + overlap-add resynthesis; factor 1 bypasses that round trip and copies the extracted region directly. Each event receives short raised-cosine edge fades, is placed on an output timeline, and is then routed according to the selected output mode.
- One mono working source: mono input is copied; multichannel input is downmixed to mono by default, or channel 1 / channel 2 can be selected explicitly.
- Random but optionally reproducible: seed 0 is unpredictable; a positive seed initializes Praat's predictable generator.
- Source-level preservation by default: slices are not individually peak-normalized unless the legacy level mode is selected.
- Edge fades: each processed slice is faded in/out, with each fade capped at 10% of the processed slice duration.
- Measured output length: the script uses the actual latest event end rather than an estimated padding formula.
- Three final normalization modes: peak-to-target, attenuate-only, or none.
Quick start
- Select exactly one Sound object.
- Run
Multi-channel_Random_Slice_Time-Stretcher.praat. - Choose the number and duration range of random slices.
- Select a duration-factor preset or Custom.
- For multichannel input, choose the working-source rule: downmix, channel 1, or channel 2.
- Choose an output routing mode and whether to prepend the original mono source as CH1.
- Choose final output normalization, then run the script.
Form & defaults
| Parameter | Default | Implemented behavior |
|---|---|---|
| Number_of_segments | 4 | Natural-number slice count. Also determines the number of slice stems in N-channel routing. |
| Min_duration | 0.5 s | Lower bound for random source-slice duration. Must be > 0. |
| Max_duration | 2.0 s | Upper bound. If it exceeds source duration it is clamped to source duration; Min is also reduced if necessary. |
| Random_seed | 0 | 0 = unpredictable generator. Positive values seed Praat predictably so the random duration/start/pan sequence can be reproduced in the same workflow. |
| Preset | Normal | Normal 1.0; Slow 1.5; Fast 0.67; Double speed 0.5; Half speed 2.0; Custom. |
| Custom_factor | 1.25 | Positive duration factor used only for Custom. |
| Pitch_floor / Pitch_ceiling | 75 / 600 Hz | Passed to To Manipulation whenever factor ≠ 1. Floor must be below ceiling. |
| Slice_level_mode | Preserve source level | Either retain slice level or scale every processed slice individually to peak 0.99. |
| Slice_edge_fade_ms | 10 ms | Requested fade at both edges; internally capped to 10% of each processed slice duration. |
| Output_routing | N-channel stems | Six routing choices; see below. |
| Mix_original_channel_1 | no | Prepends the mono working source as an additional CH1. All slice-routing channels then move up by one index. |
| Input_handling | Downmix to mono | For multichannel input: downmix all channels, use channel 1 only, or use channel 2 only. For mono input this choice has no effect. |
| Preserve_original_timeline_length | yes | Prevents output from becoming shorter than the source. It does not force an exact source-length output when a stretched slice ends later. |
| Output_normalisation | Peak | Peak-to-target, attenuate-only, or none. |
| Peak_target | 0.99 | Must be >0 and ≤1; invalid values are replaced by 0.99. |
| Draw_visualization | yes | Draw the source regions, placement timeline, slice table, and summary. |
| Play_after_processing | yes | Plays the final multichannel Sound in Praat. |
Processing pipeline
mono input → copy
multichannel default → Convert to mono
Left-only → Extract channel 1
Right-only → Extract channel 2
If source time does not begin at 0, extract the full source without preserving times so the working domain starts at 0.
2. For each slice i
duration_i ~ Uniform(Min_duration, Max_duration)
start_i ~ Uniform(0, source_duration − duration_i)
extract [start_i, end_i] with rectangular extraction
3. Duration processing
factor = 1 → direct copy, no Manipulation
factor ≠ 1 → Manipulation(0.01, Pitch_floor, Pitch_ceiling) + constant DurationTier factor + overlap-add resynthesis
4. Slice level and edges
optional per-slice Scale peak: 0.99
fade = min(Slice_edge_fade_ms, 10% of processed duration)
5. Placement
source_center = (source_start + source_end) / 2
target_start = source_center − processed_duration / 2
if target_start < 0 → target_start = 0 (shift right; do not clip)
target_end = target_start + processed_duration
Output routing
| Routing | Without original CH1 | Slice mapping |
|---|---|---|
| N-channel stems | N channels | Slice 1 → CH1, slice 2 → CH2, … one slice per channel. |
| Stereo, alternating L/R | 2 channels | Odd slices → L; even slices → R, unity gain. |
| Stereo, fixed random pan per slice | 2 channels | Each slice gets one random p in 0..1 and gains L = √(1−p), R = √p. The position stays fixed for that slice. |
| Quad, cyclic routing | 4 channels | Slice numbers cycle CH1→CH2→CH3→CH4. |
| 8-channel, cyclic routing | 8 channels | Slice numbers cycle CH1…CH8. |
| Mono sum | 1 channel | Every slice is summed at unity gain into the same mono channel. |
Mix_original_channel_1 = yes, one extra CH1 containing the same mono working source is inserted before the routing channels. Therefore Stereo becomes 3 channels, Quad becomes 5, 8-channel becomes 9, Mono becomes 2, and N-channel stems becomes N+1.Placement & output length
The output duration is determined from the measured end time of the latest placed slice. This replaces the older estimated padding formula.
outDur = latestEnd
if Preserve_original_timeline_length = yes OR Mix_original_channel_1 = yes:
outDur = max(outDur, source_duration)
Consequently, “Preserve original timeline length” means keep at least the original duration. A stretched slice that extends beyond the source can still make the output longer.
If centered placement would begin before time 0, the slice is shifted right to start at 0. The complete event is retained, but that particular slice is no longer centered on its source region.
Levels & normalization
Per-slice level
Preserve source level is the default and applies no slice peak scaling. Normalise each slice reproduces the older behavior by applying Scale peak: 0.99 independently to every processed event before its edge fades.
Final output normalization
| Mode | Implemented rule |
|---|---|
| Peak (scale to target) | If peak > 0, multiply the entire combined multichannel output by Peak_target / peak. This can either attenuate or boost. |
| Attenuate only | Apply that shared factor only when the output peak exceeds Peak_target. Quiet output is not boosted. |
| None | No final gain correction. |
Final normalization is a shared gain across all output channels, so inter-channel level relationships created by routing are preserved.
Visualization
When enabled, v1.2.1 draws four functional regions rather than the “8-panel” layout described by older documentation:
- Source with sampled regions: the mono working-source waveform is drawn over colored extraction regions. Region shading is painted first so it does not obscure the waveform.
- Placement timeline: grey outlines show each original source extent; colored bars show the processed placement; a vertical tick marks the original source center. The source end is also marked.
- Slice table: source interval, original duration, stretched duration, achieved duration factor, and placement start. At most the first 8 slices are shown, with an explicit note when more exist.
- Summary: preset/factor, input handling, source/output durations, slice level mode, fade, PSOLA count, seed, routing, channel count, normalization mode, and pre/post peak.
Notes & limitations
- No source separation: these are random temporal derivatives of one mono working source, not semantic/instrument stems.
- Random overlap is allowed: in folded routing modes, multiple slices may overlap and sum in the same channel.
- Channel 2 terminology: “Use right channel only” literally extracts channel 2. On inputs with more than two channels, this should be understood as channel 2 rather than a guaranteed semantic “Right” channel.
- High channel counts: the script only warns when the final output exceeds 32 channels; it does not impose a hard maximum.
- Playback: Praat can play the resulting object, but actual monitoring of large multichannel layouts depends on the available audio system.
- No file export: the script creates a Sound object but contains no WAV-save control.