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.

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

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.

Important architectural point: the output is not always “original + one slice per channel.” That is only one routing configuration. v1.2.1 can instead fold the slices into stereo, quad, 8-channel, or mono layouts. Mix_original_channel_1 prepends the same mono working source as an additional CH1; it does not mix the original into the routed slice channels.

Quick start

  1. Select exactly one Sound object.
  2. Run Multi-channel_Random_Slice_Time-Stretcher.praat.
  3. Choose the number and duration range of random slices.
  4. Select a duration-factor preset or Custom.
  5. For multichannel input, choose the working-source rule: downmix, channel 1, or channel 2.
  6. Choose an output routing mode and whether to prepend the original mono source as CH1.
  7. Choose final output normalization, then run the script.
Normal preset: factor 1.0 performs no PSOLA resynthesis. The selected regions are copied directly and only the edge fades and routing/level stages are applied.

Form & defaults

ParameterDefaultImplemented behavior
Number_of_segments4Natural-number slice count. Also determines the number of slice stems in N-channel routing.
Min_duration0.5 sLower bound for random source-slice duration. Must be > 0.
Max_duration2.0 sUpper bound. If it exceeds source duration it is clamped to source duration; Min is also reduced if necessary.
Random_seed00 = unpredictable generator. Positive values seed Praat predictably so the random duration/start/pan sequence can be reproduced in the same workflow.
PresetNormalNormal 1.0; Slow 1.5; Fast 0.67; Double speed 0.5; Half speed 2.0; Custom.
Custom_factor1.25Positive duration factor used only for Custom.
Pitch_floor / Pitch_ceiling75 / 600 HzPassed to To Manipulation whenever factor ≠ 1. Floor must be below ceiling.
Slice_level_modePreserve source levelEither retain slice level or scale every processed slice individually to peak 0.99.
Slice_edge_fade_ms10 msRequested fade at both edges; internally capped to 10% of each processed slice duration.
Output_routingN-channel stemsSix routing choices; see below.
Mix_original_channel_1noPrepends the mono working source as an additional CH1. All slice-routing channels then move up by one index.
Input_handlingDownmix to monoFor 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_lengthyesPrevents output from becoming shorter than the source. It does not force an exact source-length output when a stretched slice ends later.
Output_normalisationPeakPeak-to-target, attenuate-only, or none.
Peak_target0.99Must be >0 and ≤1; invalid values are replaced by 0.99.
Draw_visualizationyesDraw the source regions, placement timeline, slice table, and summary.
Play_after_processingyesPlays the final multichannel Sound in Praat.

Processing pipeline

1. Working source
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
PSOLA qualification: the script aims to preserve pitch when factor ≠ 1. Results depend on successful pitch-synchronous analysis; periodic/monophonic material is the intended case, while polyphonic, noisy, or transient-heavy signals may produce artifacts.

Output routing

RoutingWithout original CH1Slice mapping
N-channel stemsN channelsSlice 1 → CH1, slice 2 → CH2, … one slice per channel.
Stereo, alternating L/R2 channelsOdd slices → L; even slices → R, unity gain.
Stereo, fixed random pan per slice2 channelsEach slice gets one random p in 0..1 and gains L = √(1−p), R = √p. The position stays fixed for that slice.
Quad, cyclic routing4 channelsSlice numbers cycle CH1→CH2→CH3→CH4.
8-channel, cyclic routing8 channelsSlice numbers cycle CH1…CH8.
Mono sum1 channelEvery slice is summed at unity gain into the same mono channel.
Original channel option: if 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.

latestEnd = max(target_end_i)
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

ModeImplemented 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 onlyApply that shared factor only when the output peak exceeds Peak_target. Quiet output is not boosted.
NoneNo 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:

Notes & limitations