Spectral Freeze & Glitch — User Guide
Creates buffer-stutter freezes by looping short waveform segments at random source positions, with optional loop-edge smoothing, silence avoidance, and cumulative time-varying amplitude artifacts.
What this does
Spectral Freeze & Glitch works directly on waveform samples. For each requested freeze point, it chooses a freeze-zone length and position, captures the current processed Sound as a snapshot, and fills that zone by repeatedly reading a shorter segment from the snapshot. After the freeze is written, a sinusoidal amplitude factor is applied across the full Sound.
Quick start
- Select exactly one Sound object.
- Run
Spectral_Freeze_&_Glitch.praat. - Choose Default, Short Bursts, Long Freeze, Artifact Storm, or Custom.
- Set the number and duration range of freeze zones.
- Set the repeat divisor to control the repeated micro-segment length.
- Leave loop smoothing and silence avoidance enabled for the default behavior, or adjust their controls.
- Run. The result is named
<source>_glitch.
Freeze generation
Base duration
The source length is converted to a base freeze duration in samples:
The value is clamped to at least one sample.
Per-point freeze length
The global minimum and maximum are constrained to the legal range 1…totalSamples. The minimum factor must not exceed the maximum factor.
Freeze position
The script first attempts to keep freeze zones away from the extreme beginning and end by using the base freeze duration as a margin. For very short files or extreme custom settings, it falls back to the complete legal start-position range.
Every accepted freeze zone is guaranteed to fit entirely inside the Sound.
Micro-loop structure & smoothing
Repeated segment length
The result is constrained to at least one sample and never longer than the freeze zone.
Loop read
Immediately before processing one freeze point, the current result is copied to a snapshot. Inside the freeze zone:
The same snapshot grain is therefore repeated throughout that freeze zone. The processing does not recursively read back the newly written repeats of the same point.
Loop-wrap smoothing
When Smooth_loop_wraps is enabled, the beginning and end of every repeated micro-segment receive matching raised-cosine tapers. The requested width is:
Smoothing is disabled for that freeze point when fewer than two samples are available for a valid taper. Otherwise, each repeated grain reaches exactly zero at both loop edges.
Silence avoidance
When Avoid_silence is enabled, the script measures the RMS of the original source and derives:
For each freeze point, the RMS test is performed on the proposed loop-source region, whose duration is one repeatSegment. If its RMS is below the threshold, only the position is rerolled; the chosen freeze length and repeat length remain unchanged.
The script tries at most Max_position_attempts positions. If none passes the threshold, that freeze point is skipped.
If the source's overall RMS is undefined or zero, the internal reference is replaced by 0.0001 before the silence threshold is calculated.
Time-varying amplitude artifact
After each successfully applied freeze point p, the complete Sound is multiplied by:
Point 1 contributes one sinusoidal gain cycle across the file, Point 2 contributes two cycles, Point 3 three cycles, and so on.
Because this multiplication is applied after every successful freeze point, the modulation accumulates multiplicatively:
The artifact acts across the complete Sound, not only inside the corresponding freeze zone.
Presets
| Preset | Points | Duration divisor | Length factors | Repeat divisor | Artifact |
|---|---|---|---|---|---|
| Default | 12 | 25 | 0.5–1.5 | 3 | 0.10 |
| Short Bursts | 8 | 15 | 0.3–1.0 | 2 | 0.05 |
| Long Freeze | 16 | 40 | 0.8–2.0 | 4 | 0.12 |
| Artifact Storm | 20 | 20 | 0.4–1.6 | 2 | 0.25 |
Named presets overwrite only the freeze parameters and Artifact_amplitude shown above. They do not change Smooth_loop_wraps, Smoothing_ms, Avoid_silence, Silence_rms_factor, Max_position_attempts, Scale_peak, Draw_visualization, or Play_result.
Parameters & effective limits
| Parameter | Default | Exact role |
|---|---|---|
| Preset | Default | Default, Short Bursts, Long Freeze, Artifact Storm, or Custom. |
| Freeze_points | 12 | Requested number of freeze passes; limited internally to 5000. |
| Freeze_duration_divisor | 25 | Positive divisor used to derive the base freeze length from total sample count. |
| Freeze_length_min_factor | 0.5 | Positive lower multiplier for random freeze length. |
| Freeze_length_max_factor | 1.5 | Positive upper multiplier; must be at least the minimum factor. |
| Freeze_repeat_divisor | 3 | Positive divisor used to derive the repeated micro-segment length. |
| Artifact_amplitude | 0.10 | Depth of the whole-file sinusoidal gain modulation applied after each successful point. |
| Smooth_loop_wraps | On | Enable raised-cosine tapers at the edges of each repeated micro-segment. |
| Smoothing_ms | 2 ms | Requested taper width; clamped to at most half of the repeat segment. |
| Avoid_silence | On | Reroll freeze positions whose source loop region is below the RMS threshold. |
| Silence_rms_factor | 0.15 | Multiplier applied to overall source RMS to define the silence threshold. |
| Max_position_attempts | 20 | Maximum number of position trials for one freeze point. |
| Scale_peak | 0.91 | Final target Sinc70 peak for non-silent output. |
| Draw_visualization | On | Draw source/result waveforms, freeze zones, freeze map and summary. |
| Play_result | On | Play the completed result. |
Channels, duration & sample rate
The result begins as a direct copy of the selected Sound. Every Formula preserves the existing channel rows and applies the same freeze timing and gain law independently to each channel.
- Channel count: preserved.
- Duration: preserved.
- Sample rate: preserved.
- Time domain: preserved.
- Original Sound: unchanged.
Final peak scaling
After all freeze points have been processed, the script measures the Sinc70 absolute extremum. For a non-silent result it applies:
This is target peak normalization. With the default value, the final non-silent result is scaled to a Sinc70 peak of 0.91.
Digital silence is left unchanged. The public form requires Scale_peak to be positive but does not impose an upper limit of 1.
Visualization
The v0.6.1 Picture view contains three main data regions plus a summary line:
- Original waveform — selected source Sound.
- Glitched waveform — processed result, with rose background bands marking successfully applied freeze zones and vertical lines marking their starts.
- Freeze-position map — one horizontal bar per requested freeze index, showing the source-time position and duration of each applied freeze.
- Summary — applied/requested freeze count, artifact amplitude and repeat divisor.
Shared waveform scale
Original and Glitched use one amplitude scale derived from the larger Sinc70 peak, with 5% display headroom. Their displayed waveform heights are therefore directly comparable.
Freeze-position map
The x-axis is source time. Each bar begins at the actual stored freeze position and extends for the actual freeze duration. Skipped freeze points have no bar.
Bar color intensity varies with the freeze length relative to the requested factor range; it does not encode amplitude or RMS.
Output behavior
- Name:
<source>_glitch. - Duration: unchanged.
- Sample rate: unchanged.
- Channels: preserved.
- Randomness: random freeze lengths and positions.
- Random seed: no user control in v0.6.1.
- Playback: optional through Play_result.
The Info window reports the requested freeze count, each applied or skipped point, its source position and duration, and the final applied-point count.