Sound Duplicator — v1.3 User Guide

Duplicates a selected Sound a whole number of times, joins the copies with overlap crossfades, then applies one global amplitude envelope across the measured output duration. Five envelope shapes are available, and peak normalization is optional and off by default.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.3 (2026) License: MIT License Repo: GitHub
Contents:

What this does

Sound Duplicator v1.3 creates a longer Sound from repeated copies of the selected source. Consecutive copies are joined with Praat's Concatenate with overlap; the effective overlap is constrained to a safe range derived from the source sampling rate and duration. After assembly, the resulting Sound is shifted so that it starts at time 0, its actual duration is measured, and one global envelope is applied across that measured duration.

Important v1.2/v1.3 behavior:
  • Repetitions are integral. The form uses a natural number, so the number of copies, predicted duration, report, and envelope cannot disagree.
  • The envelope uses the measured output duration. It is not calculated from a nominal duration that may differ after overlap assembly.
  • Peak normalization is optional and off by default. This preserves the absolute scaling implied by Peak_level_percent.
  • Five envelope types are available: Linear, Cosine, Triangle, Arch (symmetric), and Gentle arch.
  • v1.3 changes the visualization/UI only; the audio processing is unchanged from v1.2.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run Sound_Duplicator.praat.
  3. Choose a preset or leave Preset = Custom.
  4. Set the number of repetitions and the requested overlap duration.
  5. Choose the global envelope and its fade percentages.
  6. Set Peak_level_percent. Values above 100% deliberately amplify before optional normalization.
  7. Click OK. The result is named <source>_dupN_xfX_Envelope, where the crossfade label is the rounded effective overlap in milliseconds.
Default behavior: 4 repetitions, 50 ms requested overlap, Linear envelope, 10% fade-in, 15% fade-out, 100% peak level, visualization on, peak normalization off, playback on.

6 presets (+ Custom)

PresetCopiesRequested overlapEnvelopeFade inFade outPeak
Stutter810 msLinear0%0%100%
Echo Decay580 msLinear0%60%100%
Swell4120 msCosine25%25%100%
Tight Loop6200 msLinear0%0%100%
Pulse Burst820 msTriangle10%unused100%
Long Fade3150 msGentle arch30%30%100%

Presets replace the listed duplication/envelope fields. The overlap may still be changed internally by the safety clamps described below.

Envelope types

TypeImplemented shapeFade fields used
LinearStraight rise to unity, flat sustain, straight fall.Fade in + Fade out
CosineHalf-cosine rise, flat sustain, half-cosine fall.Fade in + Fade out
TriangleLinear rise over Fade in, followed by one continuous linear fall from the peak to zero at the file end.Fade in only; Fade out is not used
Arch (symmetric)Fixed 0.5 - 0.5*cos(2*pi*x/T) = sin²(pi*x/T) hill across the whole output. Zero at both ends, peak at the midpoint.Neither fade field
Gentle archSmootherstep rise, flat unity sustain, smootherstep fall. The smootherstep curve is 6t^5 - 15t^4 + 10t^3, with zero first and second derivatives at its endpoints.Fade in + Fade out

Peak-level scaling

The selected shape is multiplied by Peak_level_percent / 100. Thus 50% halves the envelope before any optional normalization, while 150% applies a 1.5× maximum multiplier and may clip.

Parameters & exact behavior

ParameterDefaultImplemented behavior
Number_of_repetitions4Natural number; one copy is allowed.
Crossfade_duration_ms50 msRequested overlap. For processing it is floored to two samples and capped at 90% of the source duration. If more than one repetition is requested but the source is shorter than three samples, the script stops.
Envelope_typeLinearFive modes as described above.
Fade_in_percent10%Clamped to 0–100%.
Fade_out_percent15%Clamped to 0–100%; if Fade in + Fade out exceeds 100%, Fade out is reduced so the sum is exactly 100%.
Peak_level_percent100%Positive value. Above 100% amplifies before optional normalization.
Draw_visualizationyesDraw the v1.3 four-part diagnostic figure.
Peak_normalize_outputnoIf enabled and the result is non-silent, scales the final peak to 0.99. This is whole-file constant gain and therefore changes the absolute level established by Peak level.
Play_resultyesPlay the finished Sound.

Processing pipeline

  1. The selected Sound is copied to a temporary result.
  2. For each additional repetition, one fresh source copy is joined with the growing result using Concatenate with overlap; the old temporary result and the added copy are then removed.
  3. The assembled Sound is shifted to start at 0 seconds.
  4. The actual output duration is measured. The script also reports the theoretical duration N·sourceDuration - (N-1)·overlap and warns if the two differ by more than two source samples.
  5. The chosen envelope is built from that measured duration and applied with one vectorized Formula: call.
  6. Optional peak normalization is applied last.
Memory/performance: Assembly is incremental rather than creating all N source copies at once. However, each Concatenate with overlap operation still has to create a new, larger result, so very long outputs can require substantial temporary memory and repeated copying. The envelope stage itself is a single vectorized operation.

Visualization (v1.3)

When Draw_visualization is enabled, the script draws:

The source and output waveform panels use their own automatic vertical scaling; they are not intended as a shared-amplitude before/after comparison.

FAQ / troubleshooting

The requested crossfade is not the one reported

The script reports the overlap actually used. It cannot be shorter than two samples and cannot exceed 90% of the source duration.

Peak level seems to have no absolute meaning

Check Peak_normalize_output. When enabled, the entire finished file is rescaled to 0.99 peak, so an earlier 50% or 150% envelope scale does not survive as an absolute final level.

Triangle ignores Fade out

This is intentional. Triangle reaches its peak at the end of Fade in and then falls continuously to zero over the rest of the file.

Arch (symmetric) ignores both fade percentages

This is intentional. It is the preserved fixed sin² hill from the older implementation. Use Gentle arch when you want independent fade-in/fade-out durations plus a sustain region.

Output time domain: the created Sound always starts at 0, even if the selected source has a non-zero xmin.