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).
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.
- 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
- In Praat, select exactly one Sound object (mono or stereo – stereo will be downmixed to mono for processing).
- Run script… →
Waveset_Distortion.praat. - Choose a Preset:
- Waveset Repeat, Skip, Reverse, Stretch, Compress, Shuffle (individual), Shuffle (groups), Amplitude, Keep Strongest, Delete Weakest, Telescope
- 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.
- Click OK. The script finds zero crossings, processes each waveset, reassembles, and creates a new Sound object named
originalname_WSD_preset.
The 11 presets (+ Custom)
| Preset | Type | Amount | Group size | Description | |
|---|---|---|---|---|---|
| Waveset Repeat | Repeat | 2.0 | – | Stutter – each waveset repeated 2 times with decay 0.8. | |
| Waveset Skip | Skip | 2.0 | – | Randomly skip half the wavesets (silence). | |
| Waveset Reverse | Reverse | 1.0 | – | Reverse each waveset individually. | |
| Waveset Stretch | Stretch | 2.0 | – | Double each waveset’s duration (lower pitch). | |
| Waveset Compress | Compress | 2.0 | – | Halve each waveset’s duration (higher pitch). | |
| Waveset Shuffle (individual) | Randomize | 1.0 | 1 | Randomise order of individual wavesets. | |
| Waveset Shuffle (groups) | Randomize | 1.0 | 4 | Group wavesets, shuffle group order (CDP distort_shuf). | |
| Waveset Amplitude | Amplitude | 2.0 | – | Alternate gain: ×2, ×0.5, ×2, ×0.5, … | |
| Keep Strongest (CDP) | Keep Strongest | 1.0 | 4 | Keep only the loudest waveset per group (sparse, percussive). | |
| Delete Weakest (CDP) | Delete Weakest | 1.0 | 4 | Remove the quietest waveset per group (subtle noise reduction). | |
| Telescope (CDP) | Telescope | 1.0 | 4 | Time‑compress N wavesets into one averaged waveform. |
Operation types
| Type | Parameter | Effect |
|---|---|---|
| Repeat | Amount (repeats), Repeat_decay | 。Repeat each waveset N times, with exponential amplitude decay. Creates stutter / echo effects. |
| Skip | Amount (probability denominator) | 。Each waveset has 1/amount probability of being silenced. Amount=2 → ~50% silence. Random gaps. |
| Reverse | Amount (ignored) | 。Reverse the samples within each waveset. Creates backward‑speech-like effects. |
| Stretch | Amount (factor) | 。Time‑stretch each waveset by Amount (lower pitch). Uses sample‑rate override + resample. Onset and offset preserved. |
| Compress | Amount (factor) | 。Time‑compress each waveset by Amount (higher pitch). Sets SR to original × Amount, then resamples back. Presses energy into shorter time. |
| Randomize | Group_size | 。If 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.} |
| Amplitude | Amount (alternation factor) | 。Alternate gain: odd‑index wavesets ×Amount, even‑index ×1/Amount. Creates rhythmic amplitude pulsing.} |
| Keep Strongest | Group_size | 。In each group, keep only the waveset with highest energy (sum of |sample|). Discard the rest. Sparse, percussive thinning (CDP distort_del). |
| Delete Weakest | Group_size | 。In each group, remove only the quietest waveset. Subtle noise reduction / cleaning at waveset level (CDP distort_del). |
| Telescope | Group_size, Telescope_mode | 。Collapse 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:
- Detecting pitch periods via
To PointProcess (cc)– more accurate than zero crossings for pitched material. - For each group of N periods, find reference duration (longest or mean).
- Time‑stretch each waveset to the reference duration via SR override + resample.
- Average all N wavesets sample‑by‑sample.
- 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:
- Group_size – number of periods to collapse into one. Larger groups = more compression, smoother texture.
- Telescope_mode – “Longest cycle” (CDP default) or “Mean cycle length”. Longest preserves the lowest pitch; mean creates a neutral average.
Parameters & defaults
Operation type
Select the waveset processing type (see table above).
Amount
- Repeat – number of repeats (rounded).
- Skip – probability denominator (1/amount).
- Stretch / Compress – time factor (amount >1 = more stretch/compress).
- Amplitude – alternation gain factor.
- Other types – ignored (set to 1.0).
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
- Scale_peak – normalise output peak to this value (0.95).
- Draw_visualization – show 5‑panel comparison.
- Play_result – auto‑play after processing.
Visualization (5‑panel Praat picture)
When Draw_visualization = 1, the script draws:
- Input waveform (grey).
- Output waveform (blue).
- Original spectrogram (0–5 kHz).
- Waveset distorted spectrogram (0–5 kHz).
- Summary panel – operation type, amount, waveset count, input/output durations, processing time.
FAQ / troubleshooting
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.
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.
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).
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.
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.