Python tool for glitching MP3s while leaving them playable. 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.
- 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,--helpshow this help message and exit-p,--probpercent probability of glitching (float)-m,--hexmindecimal representation of minimum hex value to insert (int)-M,--hexmaxdecimal representation of maximum hex value to insert (int)-f,--frameminminimum position in frame to glitch (float, 0-1)-F,--framemaxmaximum position in frame to glitch (float, 0-1)-s,--spacingminminimum spacing between glitched frames (int)-S,--spacingmaxmaximum spacing between glitched frames (int)-w,--widthnumber of hex digits to insert in each glitch (int)-l,--limitmax 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.