- Joined
- May 30, 2021
- Messages
- 341
- Reaction score
- 631
- Awards
- 10
Skull posted about data bending with Audacity. I'd never heard of the term before, but as a long time hacker, I'm definitely familiar with using applications for something other then their intended purpose.
I honestly don't like the Audacity approach. You have to manually select the part of the file to change and it's very easy to overwrite the header and break the image. So as usual, I wanted to find a command line way of doing the same thing. Just faster, and scriptable, etc.
Enter sox. Sox is an audio toolbox for Linux, Mac and Windows. It's the command line toolkit and does everything Audacity does and more.
For Linux, it's easy to install with apt-get install sox or yum install sox (depending on Linux distro). For Mac (I use a MacBook Pro regularly), it's easiest to install through Homebrew (brew install sox). I've never used the Windows version (this would sort of defeat the purpose for me personally), but it's downloadable from Sourceforge ().
I'm starting with this image. It's a 3d fractal I created in Mandelbulb3d quite awhile ago. I named it Buddha, but I haven't posted it anywhere yet as far as I can remember. I converted it to a BMP (same as data bending in Audacity).
I'm doing this in Terminal on a Mac, but it would be the same in Linux, and the flags and such should be the same.
I ran it through some audio filters using sox, using the output from the previous command as the input.
The "trim 0 100s" is part of the magic. It skips the BMP header and works perfect every time. Flanger, phaser and sinc are filters.
From the sox documentation...
Flanger
There's also an echo filter, reverse, etc, but I didn't use any of them on this image. This is the result of those 2 audio filters.
Pretty happy with the results.
I honestly don't like the Audacity approach. You have to manually select the part of the file to change and it's very easy to overwrite the header and break the image. So as usual, I wanted to find a command line way of doing the same thing. Just faster, and scriptable, etc.
Enter sox. Sox is an audio toolbox for Linux, Mac and Windows. It's the command line toolkit and does everything Audacity does and more.
For Linux, it's easy to install with apt-get install sox or yum install sox (depending on Linux distro). For Mac (I use a MacBook Pro regularly), it's easiest to install through Homebrew (brew install sox). I've never used the Windows version (this would sort of defeat the purpose for me personally), but it's downloadable from Sourceforge ().
I'm starting with this image. It's a 3d fractal I created in Mandelbulb3d quite awhile ago. I named it Buddha, but I haven't posted it anywhere yet as far as I can remember. I converted it to a BMP (same as data bending in Audacity).
I'm doing this in Terminal on a Mac, but it would be the same in Linux, and the flags and such should be the same.
I ran it through some audio filters using sox, using the output from the previous command as the input.
The -t sets the data type to u-law, -c 1 sets the number of channels to 1 (mono) and -r48k is the resample rate. Everything after the second bmp filename are audio filters.sox -t ul -c 1 -r 48k buddah.bmp -t ul buddah2.bmp trim 0 100s : flanger
sox -t ul -c 1 -r 48k buddah2.bmp -t ul buddah3.bmp trim 0 100s : phaser 0.3 0.9 1 0.5 0.2 -t
sox -t ul -c 1 -r 48k buddah3.bmp -t ul buddah-glitch.bmp trim 0 100s : sinc 250-35
The "trim 0 100s" is part of the magic. It skips the BMP header and works perfect every time. Flanger, phaser and sinc are filters.
From the sox documentation...
Flanger
PhaserThe flanger effect is like the chorus effect, but the delay varies between 0ms and maximal 5ms. It sound like wind blowing, sometimes faster or slower including changes of the speed.
The flanger effect is widely used in funk and soul music, where the guitar sound varies frequently slow or a bit faster.
Sinc is a bandpass filter.The phaser effect is like the flanger effect, but it uses a reverb instead of an echo and does phase shifting.
There's also an echo filter, reverse, etc, but I didn't use any of them on this image. This is the result of those 2 audio filters.
Pretty happy with the results.