1
0
Fork
You've already forked mp3glitch
0
CLI tool for glitching MP3s, creating interesting sounds for music production. Includes many options to shape glitching amount, character, and timbre.
  • Python 100%
2026年06月03日 19:08:54 -04:00
src/mp3glitch include first/last frame 2026年06月03日 19:08:54 -04:00
.gitignore removed scripts folder 2026年06月03日 13:34:49 -04:00
LICENSE Create LICENSE 2025年04月05日 16:34:01 -04:00
pdm.lock initial CLI app version 2026年06月02日 21:44:07 -04:00
pyproject.toml initial CLI app version 2026年06月02日 21:44:07 -04:00
README.md updated README 2026年06月03日 15:40:24 -04:00

mp3glitch

Python tool for glitching MP3s, creating interesting sounds for music production. Includes many options to shape glitching amount, character, and timbre.

The mechanics behind this are described in this article, and I discuss using Python to do the glitching in this article.

Should work for both constant bit rate (CBR) and variable bit rate (VBR) MP3s.

Installing

To install with pipx:

pipx install git+https://codeberg.org/reillypascal/mp3glitch.git

Usage

  • Provide the path of an input MP3 file, followed by the desired output file name, OR provide an input and output directory. NOTE: input/output must both be either files or directories.
mp3glitch <input_file_or_directory> <output_file_or_directory>
  • Options
    • -h, --help show this help message and exit
    • -p, --prob percent probability of glitching (float)
    • -m, --hexmin decimal representation of minimum hex value to insert (int)
    • -M, --hexmax decimal representation of maximum hex value to insert (int)
    • -f, --framemin minimum position in frame to glitch (float, 0-1)
    • -F, --framemax maximum position in frame to glitch (float, 0-1)
    • -s, --spacingmin minimum spacing between glitched frames (int)
    • -S, --spacingmax maximum spacing between glitched frames (int)
    • -w, --width number of hex digits to insert in each glitch (int)
    • -l, --limit max number of glitches per frame (0 = no limit) (int)

NOTE: while the resulting MP3 is still playable, it will likely have e.g., denormal values, and with greater glitch probability or hexmax values, this can still cause difficulty with playback.

When composing with this tool, I usually use FFmpeg to convert a WAV sample to MP3, glitch it, and then convert back to WAV in order to have the noisy artifacts without the playback difficulty. FFmpeg may report errors on some frames, but it will still produce the expected glitchy output.