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.
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.
- 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
- In Praat, select exactly one Sound object.
- Run
Sound_Duplicator.praat. - Choose a preset or leave Preset = Custom.
- Set the number of repetitions and the requested overlap duration.
- Choose the global envelope and its fade percentages.
- Set Peak_level_percent. Values above 100% deliberately amplify before optional normalization.
- Click OK. The result is named
<source>_dupN_xfX_Envelope, where the crossfade label is the rounded effective overlap in milliseconds.
6 presets (+ Custom)
| Preset | Copies | Requested overlap | Envelope | Fade in | Fade out | Peak |
|---|---|---|---|---|---|---|
| Stutter | 8 | 10 ms | Linear | 0% | 0% | 100% |
| Echo Decay | 5 | 80 ms | Linear | 0% | 60% | 100% |
| Swell | 4 | 120 ms | Cosine | 25% | 25% | 100% |
| Tight Loop | 6 | 200 ms | Linear | 0% | 0% | 100% |
| Pulse Burst | 8 | 20 ms | Triangle | 10% | unused | 100% |
| Long Fade | 3 | 150 ms | Gentle arch | 30% | 30% | 100% |
Presets replace the listed duplication/envelope fields. The overlap may still be changed internally by the safety clamps described below.
Envelope types
| Type | Implemented shape | Fade fields used |
|---|---|---|
| Linear | Straight rise to unity, flat sustain, straight fall. | Fade in + Fade out |
| Cosine | Half-cosine rise, flat sustain, half-cosine fall. | Fade in + Fade out |
| Triangle | Linear 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 arch | Smootherstep 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
| Parameter | Default | Implemented behavior |
|---|---|---|
| Number_of_repetitions | 4 | Natural number; one copy is allowed. |
| Crossfade_duration_ms | 50 ms | Requested 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_type | Linear | Five modes as described above. |
| Fade_in_percent | 10% | Clamped to 0–100%. |
| Fade_out_percent | 15% | Clamped to 0–100%; if Fade in + Fade out exceeds 100%, Fade out is reduced so the sum is exactly 100%. |
| Peak_level_percent | 100% | Positive value. Above 100% amplifies before optional normalization. |
| Draw_visualization | yes | Draw the v1.3 four-part diagnostic figure. |
| Peak_normalize_output | no | If 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_result | yes | Play the finished Sound. |
Processing pipeline
- The selected Sound is copied to a temporary result.
- 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. - The assembled Sound is shifted to start at 0 seconds.
- The actual output duration is measured. The script also reports the theoretical duration
N·sourceDuration - (N-1)·overlapand warns if the two differ by more than two source samples. - The chosen envelope is built from that measured duration and applied with one vectorized
Formula:call. - Optional peak normalization is applied last.
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:
- Header: source name, repetition count, effective crossfade, envelope type, and output duration.
- Source waveform: the original Sound.
- Output waveform: the processed result. Orange vertical lines are placed at the calculated starts of the overlap regions between successive copies.
- Envelope curve: a 500 Hz synthetic Sound generated from the same expression string used for processing. If final peak normalization changed the level, that constant normalization gain is folded into this plotted curve.
- Summary: source properties, copies, effective crossfade, output duration/peak, envelope/fade settings, peak level, and normalization state.
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 script reports the overlap actually used. It cannot be shorter than two samples and cannot exceed 90% of the source duration.
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.
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.
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.
xmin.