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.
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.
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:
PAdvance: (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.
Quick start
- Select exactly one mono or stereo Sound.
- Run
Bigram_Stutter_Effect.praat. - Choose a preset or leave Custom.
- Set Target_duration_s. The script can loop through the source states to reach this duration.
- Set Window_size_ms and Stutter_probability_0_to_1.
- Set Overlap_ms; use 0 for hard concatenation or a value smaller than the window for crossfaded joins.
- Choose a Stereo_mode.
- Run the script. The result is named
<source>_BigramStutter.
Markov chain behavior
Source states
Only complete source windows enter the chain:
Any final source remainder shorter than one full window is not a state. At least two complete windows are required.
Transition rule
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:
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.
| Mode | Chain relationship | Practical result |
|---|---|---|
| Mono to Stereo | R copies the complete L state/decision chain. | Identical timing pattern in both channels. With stereo source material, L/R audio content can still differ. |
| Independent | L and R draw independent Markov decisions using the same P. | Different stutters can occur in each channel. |
| Complementary | For each L transition, R makes the opposite choice: L stutter → R advance; L advance → R stutter. | Anti-correlated transition behavior. |
| Offset | R uses the L state sequence delayed by one output step; its displayed decisions are derived from that shifted chain. | One-step inter-channel offset. |
| Asymmetric | L uses P; R runs an independent chain with P/2. | Fewer expected stutters on the right. |
| Ping-Pong | The 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.
| Preset | Window | P(stutter) | Overlap |
|---|---|---|---|
| Subtle Stutter | 80 ms | 0.20 | 10 ms |
| Medium Stutter | 60 ms | 0.35 | 8 ms |
| Heavy Stutter | 40 ms | 0.55 | 5 ms |
| Glitch Hop | 100 ms | 0.40 | 15 ms |
| Broken Record | 25 ms | 0.60 | 3 ms |
| Tape Malfunction | 150 ms | 0.15 | 20 ms |
Parameters
| Parameter | Default | Behavior / validation |
|---|---|---|
| Preset | Custom | Custom or one of six parameter presets. |
| Target_duration_s | 8.0 | Requested final duration. Must be at least two samples at the source sampling rate. |
| Window_size_ms | 50 | Length of each source state. Must span at least two samples. |
| Stutter_probability_0_to_1 | 0.3 | Probability of a self-loop at each eligible transition; valid range 0–1. |
| Overlap_ms | 5 | Output crossfade duration. May be 0, but must be strictly smaller than Window_size_ms. |
| Stereo_mode | Mono to Stereo | Controls the relationship between L and R state chains. |
| Draw_visualization | On | Draws Source → Bigram transition map → Output → Summary. |
| Play_result | On | Plays the final result automatically. |
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.
- Input Sound time domains may start at non-zero time; source extraction uses the true absolute source times.
- The final result is shifted to start at 0.
- The rendered result is trimmed to the requested target duration when necessary.
- The final non-silent stereo output is peak-scaled to 0.95.
- The result is named
<source>_BigramStutter.
Visualization
The visualization is organized as Source → Bigram transition map → Output → Summary.
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.