Distortion & Bit-Crusher Suite — User Guide

Two deliberately different nonlinear processors in one Praat tool: amplitude quantization for stepped digital degradation, and sign-driven synthesis for gated, modulated harsh textures.

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

What this does

Distortion & Bit-Crusher Suite contains two separate processing modes. Bit Crusher applies a static sample-by-sample amplitude quantizer. Harsh Distortion discards the source amplitude and keeps only each sample's sign, then multiplies that sign texture by a sinusoidal amplitude modulator and a periodic gate.

Important distinction: these are not two stages in one serial effect. Each run uses either Bit Crusher or Harsh Distortion. Presets select one of those modes and set its central parameters.

The script requires exactly one Sound, creates a processed copy, preserves the Sound's channel count and duration, optionally draws a diagnostic page, optionally plays the result, and leaves the processed Sound selected.

Quick start

  1. Select exactly one Sound in Praat.
  2. Run Distortion_Bit-Crusher.praat.
  3. Choose one of the eight named presets or Custom.
  4. For Custom, choose Bit Crusher or Harsh Distortion and edit only the parameters relevant to that mode.
  5. Choose an Output_level. The default is Normalize to target with Target_peak = 0.95.
  6. Click OK. The output is named with _crushed_ or _harsh_ plus the preset name.
Preset scope: the four Bit Crusher presets force the legacy Steps per unit quantizer because their names explicitly describe a step size. Harsh presets set Base/Mod/Frequency/Gate values, but they do not override Zero_handling, Phase_origin, Output_level, Target_peak, visualization, or playback choices.

Bit Crusher

Bit Crusher mode is a memoryless amplitude mapping: every sample is quantized independently and every input channel is processed with the same transfer rule.

Quantizer 1 — Steps per unit (legacy)

q = Quantization_steps y = round(x · q) / q step size = 1/q within -1..+1: number of states = 2q + 1

This parameter is not a literal number of levels. For example, q=4 produces a step of 0.25 and therefore nine states over −1..+1: −1, −0.75, −0.5, −0.25, 0, 0.25, 0.5, 0.75, 1. Samples outside full scale are not clamped, so the mapping can continue beyond ±1.

Quantizer 2 — True N levels

N = Quantization_steps x_c = clamp(x, -1, +1) y = 2 · round(((x_c + 1)/2) · (N - 1)) / (N - 1) - 1

This mode first clamps the input to −1..+1 and then maps that interval onto exactly N discrete output values. It therefore behaves like an explicit N-level quantizer rather than the legacy step-size mapping.

Not literal PCM bit-depth conversion: the script quantizes floating-point sample amplitudes. It does not change the Sound object's storage format or sample rate. The resulting stepped waveform resembles low-resolution digital audio, but Quantization_steps should not be read as a PCM bit-depth control.

Bit Crusher presets

PresetQuantizerStepStates over −1..+1
Bit Crush: Default (step 1/4)Steps per unit0.259
Bit Crush: Mild (step 1/8)Steps per unit0.12517
Bit Crush: Lo-Fi (step 1/3)Steps per unit0.333…7
Bit Crush: Extreme (step 1/2)Steps per unit0.55

Harsh Distortion

Harsh Distortion is not clipping in the usual sense. It replaces the source amplitude with a synthesized texture. The source contributes only its sample sign — positive, negative, and optionally zero — while the output magnitude is generated by the AM and gate stages.

s(x) = selected sign rule for the current sample t = x_time - phaseOffset AM(t) = Base_amplitude + Mod_amplitude · sin(2π · Mod_frequency · t) Gate(t) = 1 if (t mod Gate_period) < Gate_duty, otherwise 0 y = s(x) · AM(t) · Gate(t)

Sample-sign extraction

The script does not run a separate zero-crossing detector. It evaluates the sign of each sample. The resulting polarity sequence is square-wave-like and retains the timing of sign changes while discarding the original amplitude contour.

Zero_handlingSample x = 0Consequence
Treat zero as negative−1Legacy/default behavior. Digital silence can generate a negative-polarity synthesized texture while the gate is open.
Preserve silence0Exact zero samples remain zero.
Treat zero as positive+1Zero samples generate the positive branch of the synthesized texture.

Amplitude modulation

Base_amplitude and Mod_amplitude may both be zero in Custom mode. Negative values are rejected. When Mod_amplitude = 0, the sinusoidal modulation disappears and the sign texture is multiplied by a constant base level. If Mod_amplitude > Base_amplitude, the envelope crosses below zero and introduces additional polarity inversions from the modulator; the script allows this but reports a note.

Gate and phase origin

Gate_duty_cycle_s is the open duration within each gate period. A duty of 0 produces a fully closed gate. If duty exceeds the period, the script clamps it to the period and reports the correction.

With the default Start of this Sound phase origin, both AM and gate use time relative to the Sound's own start, so processing begins at modulation phase zero even when the Sound's time domain does not start at 0 s. Absolute time axis instead uses Praat's absolute time coordinates.

Harsh presets

PresetBaseModFrequencyGate periodOpen
Harsh: Balanced0.500.30100 Hz50 ms25 ms
Harsh: Light Drive0.400.2080 Hz70 ms35 ms
Harsh: Industrial0.700.40150 Hz30 ms15 ms
Harsh: Stutter Gate0.600.2590 Hz20 ms10 ms

Parameters & presets

ParameterDefaultUsed byMeaning
PresetCustomBothCustom plus eight named presets.
Effect_typeBit CrusherCustomSelects the active processing engine. Named presets set this automatically.
Quantization_steps4Bit CrusherInteger q for the legacy step quantizer, or N for True N levels.
QuantizerSteps per unitBit CrusherLegacy step-size mapping or exact N-level mapping.
Base_amplitude0.5HarshConstant component of the synthesized AM envelope; 0 is allowed.
Mod_amplitude0.3HarshSinusoidal AM depth; 0 disables modulation.
Mod_frequency_Hz100HarshAM oscillator frequency in Hz.
Gate_period_s0.05HarshDuration of one gate cycle.
Gate_duty_cycle_s0.025HarshOpen duration per cycle; clamped to the period if necessary.
Zero_handlingTreat zero as negativeHarshDefines the sign assigned to an exact zero sample.
Phase_originStart of this SoundHarshChooses relative or absolute phase reference for AM and gate.
Output_levelNormalize to targetBothPreserve, attenuate only when necessary, or normalize.
Target_peak0.95Scaling modesPeak target for attenuation/normalization; must not exceed 1.0 when used.
Draw_visualizationYesBothDraw the diagnostic Picture page.
Play_resultYesBothPlay the processed Sound after rendering.
Mode-aware validation: unused parameters do not block the other mode. Bit Crusher validates its quantizer settings; Harsh validates its AM/gate settings; Target_peak is checked only when an output-scaling mode actually uses it.

Output level, channels, and naming

Output level

ModeBehavior
PreserveNo peak scaling. If the peak exceeds 1.0, the Info window warns that playback/export may clip.
Attenuate to target only if peak > targetPerforms one global peak scaling operation only when the current peak exceeds Target_peak. This is attenuation, not a dynamic limiter.
Normalize to targetScales any non-silent result so its absolute peak equals Target_peak. A fully silent result is left silent and normalization is skipped.

Normalization can change the absolute meaning of Harsh mode's Base/Mod amplitudes because the whole rendered file is rescaled afterward. Preserve mode is the clearest choice when those absolute amplitudes should determine output level directly.

Channels

The effect is applied independently to every channel of the selected Sound. Mono remains mono; stereo remains stereo; multichannel input keeps all channels. In Harsh mode, all channels share the same AM oscillator and gate timing, while each channel contributes its own sample-sign sequence.

Object naming

Bit Crusher creates <source>_crushed_<preset>. Harsh Distortion creates <source>_harsh_<preset>. The source object is not deleted.

Visualization

The Picture page follows the AudioTools 8-inch layout and changes its main diagnostic according to the active mode.

Bit Crusher headline panel
Quantization staircase over input −1..+1. It mirrors the selected quantizer and includes the actual peak scaling applied to this render.
Harsh headline panel
Component diagram: INPUT → SIGN → AM → GATE → OUTPUT. The SIGN box shows the selected zero-sample rule.
Parameter report
Mode-specific values: quantizer/state count for Bit Crusher, or Base/Mod/Frequency/Gate for Harsh.
30 ms overlay
Original in gray and processed output in the mode color, starting at the Sound's actual xmin rather than assuming 0 s.
Full-file waveform
Mono is shown directly. For multichannel output the display draws only channels 1 and 2; all channels remain present in the Sound.
Summary bar
Preset, mode parameters, output-level result, duration, and final peak.

Notes & limitations

Applications

Bit Crusher is suited to stepped digital degradation, lo-fi percussion, coarse amplitude textures, and controlled reduction of amplitude resolution. Harsh Distortion is suited to industrial/noise textures, rhythmic sign-based resynthesis, stutter patterns, and intentionally severe transformation of source material.

Parallel use: this script does not include a wet/dry control. For parallel distortion, retain the source object and mix the processed result with the original afterward.