Waveset Distortion — v1.3 User Guide

CDP‑style waveset processing: segments between zero‑crossings are extracted and transformed individually. Ten operation types: Repeat, Skip, Reverse, Stretch, Compress, Randomize (individual or group shuffle), Amplitude alternation, Keep Strongest (CDP distort_del), Delete Weakest (CDP distort_del), and Telescope (CDP distort_tel).

Author: Shai Cohen Affiliation: Department of Music, Bar‑Ilan University, Israel Version: 1.3 (2025) – Telescope added License: MIT License Repo: GitHub
Contents:

What this does

Waveset Distortion processes a sound by segmenting it into wavesets – the segments between consecutive zero crossings. Each waveset is extracted and processed independently, then reassembled. This is a classic CDP (Composers' Desktop Project) technique that produces rhythmic, stutter, and time‑domain effects that cannot be achieved with spectral processing.

Key features:
  • Zero‑crossing detection via To PointProcess (zeroes) – C‑level, fast.
  • Batch extraction and concatenation – no per‑sample loops.
  • Ten operation types, from simple (Repeat, Reverse) to advanced (group shuffle, keep strongest, telescope).
  • v1.2: Added Keep Strongest / Delete Weakest (CDP distort_del) – loudness‑based waveset selection.
  • v1.3: Added Telescope (CDP distort_tel) – time‑compresses groups of wavesets into a single averaged waveform.

Quick start

  1. In Praat, select exactly one Sound object (mono or stereo – stereo will be downmixed to mono for processing).
  2. Run script…Waveset_Distortion.praat.
  3. Choose a Preset:
    • Waveset Repeat, Skip, Reverse, Stretch, Compress, Shuffle (individual), Shuffle (groups), Amplitude, Keep Strongest, Delete Weakest, Telescope
  4. For custom mode (preset = Custom), set:
    • Type – the operation to apply.
    • Amount – repeats (Repeat), skip probability (Skip), stretch/compress factor, amplitude alternation factor.
    • Repeat_decay – exponential decay factor for repeated copies (Repeat only).
    • Group_size – number of wavesets per group (for Randomize groups, Keep Strongest, Delete Weakest, Telescope).
    • Telescope_mode – reference length: Longest cycle or Mean cycle length.
    • Preserve_length – trim or pad output to original duration.
  5. Click OK. The script finds zero crossings, processes each waveset, reassembles, and creates a new Sound object named originalname_WSD_preset.
Tip: Start with Waveset Repeat (2 repeats, decay 0.8) for a classic stutter effect. Waveset Shuffle (groups) with group size 4 scrambles local phrases while preserving micro‑structure. Telescope with group size 8 creates a crystallised, time‑compressed texture.
Important: This effect is implemented entirely in Praat – no Python required. Processing time depends on the number of wavesets; for a 10‑second sound with ~2000 wavesets, processing takes 1–5 seconds.

The 11 presets (+ Custom)

PresetTypeAmountGroup sizeDescription
Waveset RepeatRepeat2.0Stutter – each waveset repeated 2 times with decay 0.8.
Waveset SkipSkip2.0Randomly skip half the wavesets (silence).
Waveset ReverseReverse1.0Reverse each waveset individually.
Waveset StretchStretch2.0Double each waveset’s duration (lower pitch).
Waveset CompressCompress2.0Halve each waveset’s duration (higher pitch).
Waveset Shuffle (individual)Randomize1.01Randomise order of individual wavesets.
Waveset Shuffle (groups)Randomize1.04Group wavesets, shuffle group order (CDP distort_shuf).
Waveset AmplitudeAmplitude2.0Alternate gain: ×2, ×0.5, ×2, ×0.5, …
Keep Strongest (CDP)Keep Strongest1.04Keep only the loudest waveset per group (sparse, percussive).
Delete Weakest (CDP)Delete Weakest1.04Remove the quietest waveset per group (subtle noise reduction).
Telescope (CDP)Telescope1.04Time‑compress N wavesets into one averaged waveform.

Operation types

。。。。。。。。。。
TypeParameterEffect
RepeatAmount (repeats), Repeat_decayRepeat each waveset N times, with exponential amplitude decay. Creates stutter / echo effects.
SkipAmount (probability denominator)Each waveset has 1/amount probability of being silenced. Amount=2 → ~50% silence. Random gaps.
ReverseAmount (ignored)Reverse the samples within each waveset. Creates backward‑speech-like effects.
StretchAmount (factor)Time‑stretch each waveset by Amount (lower pitch). Uses sample‑rate override + resample. Onset and offset preserved.
CompressAmount (factor)Time‑compress each waveset by Amount (higher pitch). Sets SR to original × Amount, then resamples back. Presses energy into shorter time.
RandomizeGroup_sizeIf group_size=1, shuffle individual wavesets. If group_size>1, partition into groups, shuffle group order (preserves local micro‑structure). Onset and offset wavesets respected.}
AmplitudeAmount (alternation factor)Alternate gain: odd‑index wavesets ×Amount, even‑index ×1/Amount. Creates rhythmic amplitude pulsing.}
Keep StrongestGroup_sizeIn each group, keep only the waveset with highest energy (sum of |sample|). Discard the rest. Sparse, percussive thinning (CDP distort_del).
Delete WeakestGroup_sizeIn each group, remove only the quietest waveset. Subtle noise reduction / cleaning at waveset level (CDP distort_del).
TelescopeGroup_size, Telescope_modeCollapse N consecutive wavesets into one averaged waveform. Preserves pitch, reduces noise, crystallises timbre. (CDP distort_tel). See dedicated section.

Telescope (CDP distort_tel)

🔭 How Telescope works

Telescope takes groups of N consecutive wavesets (pitch periods) and replaces them with a single averaged waveform of length equal to the reference period (longest or mean). This is achieved by:

  1. Detecting pitch periods via To PointProcess (cc) – more accurate than zero crossings for pitched material.
  2. For each group of N periods, find reference duration (longest or mean).
  3. Time‑stretch each waveset to the reference duration via SR override + resample.
  4. Average all N wavesets sample‑by‑sample.
  5. Output one averaged waveform per group.

The result is time compression with timbral smoothing: N cycles become one “consensus” waveform. Transients vanish, noise drops by √N, pitch is preserved. The sound becomes focused, crystallised, and “telescoped” – as if viewed through a narrow lens.

Parameters:

Parameters & defaults

Operation type

Select the waveset processing type (see table above).

Amount

Repeat_decay

Exponential amplitude decay per repeat. Each copy is multiplied by decay^r. Default 0.8.

Group_size

Number of wavesets per group (for Randomize groups, Keep Strongest, Delete Weakest, Telescope). Minimum 2 for energy‑based modes, 1 for individual shuffle.

Telescope_mode

Reference length: “Longest cycle” (CDP default) or “Mean cycle length”.

Preserve_length

If checked, output duration is trimmed or padded with silence to match the original duration. Useful for comparing effects in a fixed timeline.

Output

Visualization (5‑panel Praat picture)

When Draw_visualization = 1, the script draws:

Tip: Compare the original and processed spectrograms to see how the waveset processing changed the spectral envelope. For Telescope, the output spectrogram should show the same pitch but with reduced noise and sharper partials.

FAQ / troubleshooting

Not enough zero crossings / no wavesets

The script requires at least 3 zero crossings (2 wavesets). If the sound is very quiet or DC‑offset, zero crossings may be sparse. Apply “Subtract mean” first, or use a sound with adequate amplitude.

Telescope falls back to zero crossings

If the pitch detection (To PointProcess (cc)) finds fewer than group_size+1 periods, the script falls back to using zero‑crossing boundaries. For pitched material, ensure Pitch_floor and Pitch_ceiling (hardcoded to 75–600 Hz) are appropriate for your source. You can edit these in the script if needed.

Output duration is very different from input

Repeat, Stretch, and Compress change duration by design. Use Preserve_length to trim/pad back to original duration. For Telescope, the output duration is approximately original / group_size (time compression).

Group shuffle vs. individual shuffle

Individual shuffle (group_size=1) randomises every waveset, creating chaotic, granular textures. Group shuffle (group_size>1) partitions wavesets into groups of N, then shuffles the groups. Within each group, the original order is preserved. This scrambles macro‑structure while retaining local micro‑structure – a classic CDP technique for rhythmic variation.

Keep Strongest / Delete Weakest – energy measurement

Energy is measured as the sum of absolute sample values (Get energy in Praat), which matches CDP’s DISTDEL_CYCLEVAL accumulation. This is a monotonic proxy for loudness. The group size determines how many wavesets are considered together. Remainder wavesets (tail of the sound) are always kept unmodified.