Bigram Stutter Effect — User Guide

Probabilistic stuttering driven by a first-order Markov rule: each output step either repeats the current source window or advances to the next, with several ways to coordinate the left and right channels.

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

What this does

Bigram Stutter Effect divides the source into fixed, non-overlapping windows. During output generation it follows those source windows in order, but at every transition it makes a probabilistic choice: stay on the current window (a stutter/self-loop) or advance to the next window. When the chain advances past the last complete source window, it wraps back to the first.

The output is therefore a forward-moving traversal of the source interrupted by probabilistic repetitions. Target_duration_s determines the requested output duration; the source can cycle as many times as necessary to fill it.

Source versus output spacing: source states are consecutive windows of Window_size_ms. Overlap_ms does not change those source-state boundaries; it controls only the crossfade between successive windows in the rendered output.

What is a Bigram?

A bigram is a pair of adjacent items in a sequence. In language, for example, the sentence sound moves forward contains the adjacent word pairs sound–moves and moves–forward. A bigram model uses the current item to describe or predict what comes next; this corresponds to a first-order Markov assumption because only the present state is needed to choose the next state.

In this script, the items are source-window states. If the current source state is window 7, the next transition has only two possibilities:

Self-loop / stutter: (7 → 7), probability = P
Advance: (7 → 8), probability = 1 − P

So a sequence such as 1, 1, 2, 3, 3, 3, 4 can be read as a chain of adjacent state pairs: (1,1), (1,2), (2,3), (3,3), (3,3), (3,4). Equal pairs are stutters; successive pairs are advances.

Important: this is not a bigram model learned from statistics in the input audio. The script does not estimate a transition matrix from the source. It uses a deliberately simple first-order Markov rule with one user-controlled stutter probability.

Quick start

  1. Select exactly one mono or stereo Sound.
  2. Run Bigram_Stutter_Effect.praat.
  3. Choose a preset or leave Custom.
  4. Set Target_duration_s. The script can loop through the source states to reach this duration.
  5. Set Window_size_ms and Stutter_probability_0_to_1.
  6. Set Overlap_ms; use 0 for hard concatenation or a value smaller than the window for crossfaded joins.
  7. Choose a Stereo_mode.
  8. Run the script. The result is named <source>_BigramStutter.
Default Custom settings: target 8.0 s, 50 ms windows, P = 0.30, 5 ms overlap, identical L/R decision pattern, visualization on, playback on.

Markov chain behavior

Source states

Only complete source windows enter the chain:

numberOfSegments = floor(sourceDuration / windowSize)

Any final source remainder shorter than one full window is not a state. At least two complete windows are required.

Transition rule

At output step i: state[i] = current source window if random(0,1) < P: next state = current state # self-loop / stutter else: next state = current state + 1 # advance after the last source state: advance wraps to state 1

For the base chain, when P < 1, the expected number of extra repeats before an advance is P / (1 − P), and the expected number of appearances of a source state before advancing is 1 / (1 − P). These are statistical expectations, not fixed repeat counts. At P = 1, the base chain never advances and repeats its current source window for the whole target duration.

Output-step planning

With overlap, the effective rendered hop is:

hop = windowSize − overlap rendered duration of N windows = windowSize + (N − 1) × hop

The script generates enough output steps to exceed the requested target, then trims the stereo result to Target_duration_s. A safety limit rejects settings requiring more than 20,000 output windows.

Stereo processing modes

Mono input is copied into two source channels before processing. Stereo input keeps its original left and right channel audio, while the selected mode controls how the two state chains relate.

ModeChain relationshipPractical result
Mono to StereoR copies the complete L state/decision chain.Identical timing pattern in both channels. With stereo source material, L/R audio content can still differ.
IndependentL and R draw independent Markov decisions using the same P.Different stutters can occur in each channel.
ComplementaryFor each L transition, R makes the opposite choice: L stutter → R advance; L advance → R stutter.Anti-correlated transition behavior.
OffsetR uses the L state sequence delayed by one output step; its displayed decisions are derived from that shifted chain.One-step inter-channel offset.
AsymmetricL uses P; R runs an independent chain with P/2.Fewer expected stutters on the right.
Ping-PongThe base random process determines stutter-event opportunities. Each stutter event is assigned alternately to L and R; the other channel advances. If there is no event, both advance.True alternating left/right stutter events while retaining the requested global event probability.

Presets

Presets override Window_size_ms, Stutter_probability_0_to_1, and Overlap_ms. They do not change target duration, stereo mode, visualization, or playback.

PresetWindowP(stutter)Overlap
Subtle Stutter80 ms0.2010 ms
Medium Stutter60 ms0.358 ms
Heavy Stutter40 ms0.555 ms
Glitch Hop100 ms0.4015 ms
Broken Record25 ms0.603 ms
Tape Malfunction150 ms0.1520 ms

Parameters

ParameterDefaultBehavior / validation
PresetCustomCustom or one of six parameter presets.
Target_duration_s8.0Requested final duration. Must be at least two samples at the source sampling rate.
Window_size_ms50Length of each source state. Must span at least two samples.
Stutter_probability_0_to_10.3Probability of a self-loop at each eligible transition; valid range 0–1.
Overlap_ms5Output crossfade duration. May be 0, but must be strictly smaller than Window_size_ms.
Stereo_modeMono to StereoControls the relationship between L and R state chains.
Draw_visualizationOnDraws Source → Bigram transition map → Output → Summary.
Play_resultOnPlays the final result automatically.
Channel limit: the script accepts only mono or stereo input. Sounds with more than two channels are rejected.

Rendering & output

For every output step, the script extracts the selected source window with a rectangular window. It does not add a separate fade to each segment.

If Overlap_ms > 0, Praat's Concatenate with overlap performs the join. Praat applies complementary raised-cosine fades over the overlap, so adjacent windows are crossfaded once. With Overlap_ms = 0, the windows are concatenated directly.

Visualization

The visualization is organized as Source → Bigram transition map → Output → Summary.

Source: mono display copy of the original, with the number of complete source windows, window size, overlap, and hop.

Bigram transition map: separate L and R lanes. Vertical position is the source-window index; horizontal position is output-step order. A horizontal transition is a self-loop/stutter, a diagonal transition is an advance, and the downward reset shows cyclic wrap from the final source state back to state 1. Up to the first 80 output steps are shown.

Output: mono display copy of the stereo result, including the output-step and stutter counts.

Summary: preset, window, overlap, hop, probability, stereo mode, source-window count, output-step count, and L/R stutter counts.

The Source and Output waveform panels use a shared amplitude scale, so their displayed levels are directly comparable.