Bigram Stutter Effect — User Guide

Probabilistic audio stuttering using Markov chain (bigram) logic. Segments audio into windows and makes chain decisions: repeat current segment or advance to next, creating natural‑sounding glitch effects.

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

What this does

This script implements a probabilistic stutter effect using a bigram (Markov chain) model. It divides audio into fixed‑length windows, then makes sequential decisions: at each step, either repeat the current segment (stutter) or advance to the next segment. This creates natural‑sounding glitch patterns that are more organic than simple repetition or random skipping.

Key Features:

What is a bigram model? In natural language processing, a bigram is a sequence of two adjacent items. Here, audio segments are the "words," and the bigram model decides whether to repeat the current "word" (segment) or move to the next. This creates a first‑order Markov chain where each decision depends only on the current segment, producing patterns that feel more natural than random repetition.

Technical Implementation: (1) Segmentation: Divides audio into fixed‑length windows. (2) Bigram chain: For each channel, builds a sequence where at each position, random number determines: if < stutter_probability → repeat current segment, else → advance to next. (3) Stereo coordination: Applies one of six modes to relate L and R chains. (4) Extraction & assembly: Extracts segments, applies fade in/out, concatenates according to chain. (5) Visualization: Draws decision chains as colored circles (red=stutter, green=advance).

Quick start

  1. In Praat, select exactly one Sound object (mono or stereo).
  2. Run script…Bigram_Stutter_Effect.praat.
  3. Choose a Preset or select "Custom" for full control.
  4. Adjust Window size (ms) and Stutter probability if desired.
  5. Select a Stereo processing mode (even for mono input).
  6. Enable Draw visualization to see decision chains.
  7. Click OK – processed sound named originalname_stuttered appears.
Quick tip: Start with Medium Stutter preset (window=60 ms, probability=0.35). Use speech or percussive material for clear stutter effect. Enable visualization to understand the decision chain. Try different stereo modes to create width and movement.
Important: The effect works best with short to medium window sizes (25‑150 ms). Very short windows (<20 ms) create granular‑like effects; very long windows (>200 ms) create obvious looping. Overlap should be < window size (typically 5‑20% of window). Mono inputs are automatically duplicated to stereo using the selected stereo mode.

Bigram Model Explained

The Markov Decision Process

State: Current audio segment (window)
Action space: {STUTTER, ADVANCE}
Transition probabilities:
• P(STUTTER | current) = stutter_probability
• P(ADVANCE | current) = 1 – stutter_probability

Chain Generation Algorithm

current_segment = 1 chain = [] WHILE current_segment ≤ total_segments: # Add current segment to chain chain.append(current_segment) # Generate random number between 0 and 1 r = randomUniform(0, 1) IF r < stutter_probability: # STUTTER: Stay on same segment # (current_segment unchanged) decision_type = 0 (stutter) ELSE: # ADVANCE: Move to next segment current_segment += 1 decision_type = 1 (advance) ENDIF ENDWHILE Result: Sequence like [1, 1, 1, 2, 2, 3, 3, 3, 3, 4, ...]

Mathematical Properties

# Expected behavior: Expected_stutters_per_segment = p / (1 - p) where p = stutter_probability Example: p = 0.3 Expected stutters = 0.3 / 0.7 ≈ 0.43 So each segment repeats ~0.43 times on average # Total output length: Expected_output_segments = total_segments / (1 - p) Example: 100 segments, p = 0.3 Expected output = 100 / 0.7 ≈ 143 segments # This creates the characteristic "stretched" feel # while maintaining temporal coherence

Comparison to Other Stutter Methods

Simple repetition:
• Pattern: [1, 1, 1, 2, 2, 2, 3, 3, 3]
• Mechanical, predictable
• No decision chain
Random skip/repeat:
• Pattern: [1, 3, 5, 2, 4, 1, 6]
• Unnatural jumps
• Lacks temporal coherence
Bigram Markov (this script):
• Pattern: [1, 1, 2, 2, 2, 3, 4, 4, 5]
• Locally coherent (adjacent segments)
• Natural‑sounding, "human" feel
• Maintains forward progression

Stereo Processing Modes

Mode 1: Mono to Stereo (Identical)

Behavior: Same bigram chain for both L and R channels
Effect: Centered, mono‑like stutter
Use case: Basic stutter effect, mono compatibility
Pattern example:
• L: [1, 1, 2, 2, 2, 3, 4]
• R: [1, 1, 2, 2, 2, 3, 4] (identical)

Mode 2: Independent

Behavior: Completely independent random chains
Effect: Wide, chaotic stereo field
Use case: Maximum width, experimental textures
Pattern example:
• L: [1, 1, 2, 2, 2, 3, 4]
• R: [1, 2, 2, 3, 3, 3, 4] (different)

Mode 3: Complementary

Behavior: When L stutters, R advances, and vice versa
Effect: Anti‑correlated, "breathing" motion
Use case: Psychoacoustic effects, width modulation
Pattern example:
• L: [1, 1, 2, 2, 2, 3, 4] (stutters at positions 2, 4, 5)
• R: [1, 2, 2, 3, 3, 4, 4] (advances when L stutters)

Mode 4: Offset

Behavior: R channel delayed by 1 segment from L
Effect: Echo‑like, canon effect
Use case: Rhythmic patterns, delayed textures
Pattern example:
• L: [1, 1, 2, 2, 2, 3, 4]
• R: [1, 1, 1, 2, 2, 2, 3] (shifted right by 1)

Mode 5: Asymmetric

Behavior: L uses full probability, R uses half probability
Effect: L more active/stuttery, R more stable
Use case: Focused effects, lead‑accompaniment
Pattern example:
• L: [1, 1, 2, 2, 2, 3, 4, 4] (p=0.3)
• R: [1, 2, 2, 3, 4, 4, 5, 5] (p=0.15, fewer stutters)

Mode 6: Ping‑Pong

Behavior: Stutters alternate between L and R channels
Effect: Panning stutter, side‑to‑side motion
Use case: Rhythmic panning, dance music effects
Pattern example:
• L: [1, 1, 2, 3, 3, 4, 5] (stutters at positions 2, 5)
• R: [1, 2, 2, 3, 4, 4, 5] (stutters at positions 3, 6)

Presets & Parameters

Built‑in Presets

PresetWindow (ms)ProbabilityOverlap (ms)Character
Subtle Stutter 800.2010 Light glitch, barely noticeable
Medium Stutter 600.358 Clear stutter, musical effect
Heavy Stutter 400.555 Intense, glitch‑heavy texture
Glitch Hop 1000.4015 Rhythmic, beat‑oriented stutter
Broken Record 250.603 Fast, frequent micro‑stutters
Tape Malfunction 1500.1520 Long segments, rare but long stutters

Custom Parameters

ParameterDefaultRangeDescription
Window_size_ms5010‑500Length of each segment in milliseconds
Stutter_probability_0_to_10.30‑1Probability to repeat current segment
Overlap_ms50‑50Crossfade overlap between segments
Stereo_mode11‑6How L and R channels relate (see modes above)
Draw_visualizationon/offShow decision chain plot
Play_resulton/offAuto‑play after processing
Parameter interactions:
  • Window size vs content: For speech, 40‑80 ms captures phonemes. For music, 80‑150 ms captures beats/harmony. For granular effects, 20‑40 ms.
  • Probability: 0.1‑0.25 = subtle; 0.3‑0.45 = musical; 0.5‑0.7 = intense glitch; >0.7 = may get stuck on segments.
  • Overlap: Typically 5‑20% of window size. Larger = smoother transitions but less definition. 0 = hard cuts.
  • Stereo mode + probability: In Asymmetric mode, R probability = 0.5 × L probability.

Visualization

The Decision Chain Plot

Display elements:
Red circles = STUTTER decision (repeat current segment)
Green circles = ADVANCE decision (move to next segment)
• Horizontal position = sequential step in chain
• Vertical position: 0.5 = stutter, 1.0 = advance
• Left panel = L channel decisions
• Right panel = R channel decisions
• Shows first 100 decisions of each chain

Reading the Visualization

Pattern recognition examples:
Mostly green with few red:
• Low stutter probability
• Smooth progression with occasional repeats
• Example: [G, G, R, G, G, G, R, G]
Alternating red/green clusters:
• Medium probability
• Segments repeat 1‑3 times then advance
• Example: [R, R, G, R, G, G, R, R, R, G]
Mostly red with few green:
• High stutter probability
• Gets "stuck" on segments
• Long repeats before advancing
• Example: [R, R, R, R, G, R, R, R, G]

Stereo Mode Visualization

Comparing L and R panels:
Identical (Mode 1):
• L and R panels exactly match
Independent (Mode 2):
• No correlation between L and R
• Different patterns
Complementary (Mode 3):
• When L is red, R is green at same position
• Anti‑correlated patterns
Offset (Mode 4):
• R panel looks like L panel shifted right
Asymmetric (Mode 5):
• R has fewer red circles (half probability)
Ping‑Pong (Mode 6):
• Red circles alternate between L and R

Waveform Displays

Additional visualization elements:
Top panel: Original waveform (gray)
Bottom panel: Processed stereo waveform (blue)
• Shows time‑domain effect of stutter decisions
• Original vs processed comparison
• Stereo waveform shows L (top) and R (bottom) channels

Applications

Electronic Music Production

Use case: Creating glitch, IDM, and experimental textures.

Technique: Apply Heavy Stutter preset to drum loops or synth lines.

Example: Drum loop → 40 ms window, 0.55 probability, Independent stereo mode = complex, wide stutter pattern.

Vocal Processing & Effects

Use case: Adding stutter effects to vocals for electronic/pop tracks.

Technique: Use Medium Stutter with 60‑80 ms windows (phoneme‑length).

Result: Natural‑sounding vocal stutter that respects speech rhythm.

Sound Design for Media

Use case: Creating malfunction, glitch, and transition sounds.

Workflow:

Experimental Composition

Use case: Generating rhythmic and textural material from field recordings.

Technique: Environmental sounds with Tape Malfunction preset.

Example: Rain recording → 150 ms windows, 0.15 probability = occasional long stutters creating rhythmic structure.

Practical Workflow Examples

🎵 Vocal Stutter for Electronic Track

Goal: Add modern stutter effect to vocal hook.

Settings:

  • Preset: Medium Stutter
  • Custom adjustments: Window=70 ms, Probability=0.4
  • Stereo mode: Complementary
  • Overlap: 10 ms

Result: Musical vocal stutter with stereo width modulation.

🥁 Drum Loop Glitch

Goal: Create glitch‑hop style drum stutter.

Settings:

  • Preset: Glitch Hop
  • Custom adjustments: Window=100 ms (quarter note at 150 BPM)
  • Stereo mode: Ping‑Pong
  • Probability: 0.45

Result: Rhythmic stutter that pans L‑R, suitable for breakbeat/IDM.

🎬 Sci‑Fi UI Sound Design

Goal: Create malfunctioning computer/interface sound.

Settings:

  • Preset: Broken Record
  • Custom adjustments: Window=30 ms, Probability=0.65
  • Stereo mode: Independent
  • Overlap: 3 ms (hard cuts)

Result: Fast, chaotic stutter suggesting system failure.

Troubleshooting

Problem: "Sound is too short for the given window size"
Cause: Window size too large relative to audio duration.
Solution: Reduce window_size_ms (try 25‑100 ms) or use longer source audio.
Problem: Output has clicks/pops at transitions
Cause: Overlap too small or zero, creating discontinuities.
Solution: Increase overlap_ms (5‑20 ms), ensure overlap < window size.
Problem: Stutter effect too subtle/not noticeable
Cause: Probability too low or window too large.
Solution: Increase stutter_probability (0.4‑0.6), decrease window_size_ms (30‑60 ms).
Problem: Gets "stuck" on one segment for too long
Cause: Probability too high (>0.7).
Solution: Reduce probability (0.3‑0.5), or combine with shorter window for faster progression.
Problem: Stereo modes not producing expected results
Cause: Mono input being processed differently than expected.
Solution: Remember mono inputs are duplicated to stereo; true stereo requires stereo input.

Performance Notes

Processing considerations:
  • Window count: More segments = more processing time. Long audio with small windows creates many segments.
  • Overlap: Larger overlap requires more crossfade calculations.
  • Stereo modes: Independent and Complementary modes require separate chain generation.
  • Visualization: Drawing decision chains adds processing time (minimal).
  • Memory: All segments extracted simultaneously; very long audio may require significant RAM.

Creative Tips

For interesting results:
  • Layer multiple passes: Apply effect, bounce, apply again with different settings.
  • Combine with other effects: Stutter → reverb/delay → stutter again.
  • Rhythmic alignment: Set window to match tempo (60000/BPM = ms per beat).
  • Selective processing: Apply to only certain sections of audio (use Praat's Edit window first).
  • Parameter automation: Manually change parameters between script runs for evolving effects.