Beat Repeat — User Guide

Tempo-grid stutter processing: selects a beat-aligned source slice, repeats it with optional exponential level decay and short edge fades, then inserts the repeated section back into the source.

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

What this does

Beat Repeat takes a short source slice whose duration is derived from BPM and a musical note value, creates a chain of repeated copies, and replaces part of the original Sound with that chain. The first copy is unchanged in level; later copies can decay by Amplitude_decay^(repeat-1).

The source slice is extracted with a rectangular window, so its attack and spectral content are not softened by a full-duration window. If Fade_repeats is enabled, only short fades are applied at the two edges before the slice is copied.

Tempo assumption: BPM is supplied by the user. The script does not detect tempo and assumes a constant beat grid beginning at the Sound's start.

What is beat repeat?

A beat-repeat effect captures a short rhythmic slice and plays that slice several times in succession. The repeated unit is usually tied to the musical grid — for example a 1/16, 1/8, triplet, or dotted value — so the result behaves as a tempo-related stutter rather than an arbitrary edit.

source: ... [ selected slice ] ... ↓ repeat chain: [1.00] [decay] [decay²] [decay³] ... ↓ output: before + repeated chain + after

Quick start

  1. Select exactly one Sound object.
  2. Run Beat_Repeat.praat.
  3. Enter the source tempo in Bpm.
  4. Choose a preset or select Custom.
  5. Choose the rhythmic slice length with Note_value.
  6. Choose how the source beat is selected: Specific, Random, Beat range, or Auto.
  7. Set the number of repeats and amplitude decay.
  8. Leave Skip_silence on if silent candidate slices should be avoided.
  9. Optionally enable Fade_repeats for short edge fades.
  10. Click OK. The result is created as <source>_beatRepeat_<presetName>.

Presets

Named presets override only the note value, repeat count, amplitude decay, and — where listed — fade settings. BPM, beat-selection mode, silence settings, visualization, and playback remain user-controlled.

PresetNote valueRepeatsDecayFades
Stutter 1/161/1641.00Off
Fast Stutter 1/321/3281.00Off
Slow Repeat 1/41/440.85On, 20 ms requested
Triplet Fill1/8 triplet60.95Off
Decaying Echo1/880.70On, 10 ms requested
Glitch Burst1/32160.95Off

Tempo & note values

secondsPerBeat = 60 / BPM 1/32 = beat / 8 1/16 = beat / 4 1/8 = beat / 2 1/4 = beat 1/2 = beat × 2 1/16 triplet = (beat / 4) × 2/3 1/8 triplet = (beat / 2) × 2/3 1/4 triplet = beat × 2/3 dotted 1/16 = (beat / 4) × 1.5 dotted 1/8 = (beat / 2) × 1.5 dotted 1/4 = beat × 1.5 dotted 1/2 = beat × 3

The script counts only beat-grid starts from which the complete chosen slice fits:

validBeatStarts = floor((sourceDuration - noteDuration) / secondsPerBeat) + 1

This prevents a late selection from being silently moved backward off the beat grid.

Beat selection modes

Specific beat number
The requested beat is clamped to the valid range. With silence skipping on, a silent request searches outward in the order +1, -1, +2, -2, and so on until a non-silent candidate is found.
Random beat
With silence skipping on, selection is uniform over all non-silent candidate beats. With silence skipping off, the legacy behavior chooses randomly from beats 2 through N-1 when possible, otherwise beat 1.
Beat range
The user-defined range is the section that will be replaced. The source slice is normally taken from the range start; with silence skipping on, it moves to the first non-silent candidate inside the range. The replacement range itself does not move.
Auto (1 second in)
The nominal location is 1 second into the Sound, or 25% of the duration when the Sound is shorter than 2 seconds. This time is converted to a beat index. If that candidate is silent, the search goes forward first and then backward.

Silence-aware selection

Before choosing a source beat, the script measures the RMS of every valid candidate slice. Each measurement covers the actual selected note duration, not an entire quarter-note beat.

thresholdLinear = 10^(Silence_threshold_dB / 20) candidate is silent if: RMS(candidate slice) < thresholdLinear

The default threshold is -40 dB relative to amplitude 1.0. For normally scaled digital audio, this corresponds to the familiar full-scale reference convention. The scan is performed even when Skip_silence is off so the visualization and diagnostics can still report silent candidates.

If every candidate is below the threshold: processing still continues using the requested/default candidate; the Info window reports that all candidates were silent.

Parameters

ParameterDefaultBehavior
PresetCustomCustom or one of six named settings.
Bpm120Must be greater than zero. Defines the beat grid.
Note_value1/16One of 12 standard, triplet, or dotted rhythmic values.
Beat_selection_modeSpecific beat numberSpecific, Random, Beat range, or Auto.
Specific_beat4Requested source beat in Specific mode; clamped to valid candidates.
Beat_range_start2First beat of the replacement range.
Beat_range_end4Last beat of the replacement range; start/end are swapped if entered in reverse order.
Num_repeats41–512 copies of the selected slice.
Amplitude_decay0.90–1. Repeat i has gain decay^(i-1). The first repeat is always 1.0.
Skip_silenceOnAvoids candidate slices whose RMS is below the threshold.
Silence_threshold_dB-40RMS threshold expressed in dB relative to amplitude 1.0.
Fade_repeatsOffApplies short fades to the source slice before it is copied.
Fade_duration_s0.01Requested fade duration. The applied fade is min(requested, 0.3 × sliceDuration).
Draw_visualizationOnDraws Source, Beat-repeat map, Output, and Summary.
Play_resultOnPlays the result after processing.

Visualization

The visualization is organized as a direct description of the transformation:

Source and output waveforms share the same amplitude scale. Multichannel Sounds are converted to mono only for drawing; audio processing itself preserves the source channel count.

Output behavior

For Specific, Random, and Auto modes, the selected note-length slice is replaced by Num_repeats copies of that same slice:

outputDuration = sourceDuration + (Num_repeats - 1) × noteDuration

In Beat Range mode, the user-defined beat range is removed and replaced by the repeated chain. The source slice may come from a later non-silent beat inside that range:

outputDuration = sourceDuration - actualRemovedRange + Num_repeats × noteDuration