Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /customers/a/2/2/larsby.com/httpd.www/johan/wp-content/plugins/add-link-to-facebook/add-link-to-facebook.php on line 58
Deprecated: Function create_function() is deprecated in /customers/a/2/2/larsby.com/httpd.www/johan/wp-content/plugins/add-link-to-facebook/add-link-to-facebook-class.php on line 138
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AL2FB_Widget has a deprecated constructor in /customers/a/2/2/larsby.com/httpd.www/johan/wp-content/plugins/add-link-to-facebook/add-link-to-facebook-widget.php on line 8

A blog about me and stuff that I build or like.

Menu

Decompression glitches for sound generation.

The art of using compression glitches as visual tools for creating art has been around a some time now. Datamoshing yields many hits, as do glitch. But how could you apply the same effects to audio and get more interesting results then we have to day with the mp3 FFT artifact?

That question was thrown out in a conversation between me and Rosa late one night at Norbergfestivalen. I recently met her when we carpooled to the festival. Anyways, she’s writing her doctorate about these things and that was one of the questions she was thinking about. To bad she addressed that to me, because I started thinking about it also.

I’ve gone through and tried a few things, but none of them sounded very good. Basic RLE decoding of data to a waveform. Fourier compression data corruption test’s. Packaging raw data in a zip-file, change the contest of the zip data, and then re-import the raw-data. None of these where very interesting, but they are easy to do without any programming. I also listened to the scratched mp3-cd’s I have in my car. Where the most interesting effects where a sort of LP-like stuttering. But not interesting enough.

So what to do to make things a little more interesting? Well one has to look at the problem from another angle I suppose.

I have to create a compression-algorithm that makes more sense to break. Sounds stupid? I guess, but if we cant be stupid for the sake of art or comedy when are we allowed to be stupid?

Right. I came up with a modified RLE-algorithm. It’s pretty basic. waveforms are 2D, and the next sample can move up, down, or not move at all. With that you can compress your data with information on where to move for the next sample, and if there is a pattern to it it’s easy to find and repeat. A triangle example follows the data could be: “move up 1 step for every sample 127 times”.

This can also make for seriously fun glitches if you edit the compressed data, or as nice samples if you just randomly generate the compressed data.

As you can see below the implementation is very naive, there are no key frames, the comparison algorithm works by stripping away data (converting from double to float). One could also implement a better RLE that finds patterns. None of this however was very important for me when I wanted to test this idea.

There are a few parameters I’ve been toying around with on a few different wav files. These have yielded results that I’m mildly satisfied with. I don’t know what my expectations where when I started out on this journey, but there has been some success.

I tried it out on a few different sounds, the result’s are a little longer and they don’t share parameters:

I’ve toyed with the parameters in injectErrors() function. as you can se from the commented out code there are a few different things to play with when trying out the algorithm.

Where to go now?

Well I don’t know, perhaps wrap this in a standalone program, look more into other compression techniques to try out, make a VST out of it. Maybe I’ll just leave it. Possibly I’ll try to make some nice noise songs with this as either a generation device or as an effect on noisy samples. Most possibly I’ll let it mutate itself over time, feeding the same sample back over and over and over and over. Maybe one should try and apply this to MIDI note data. That could be awesome.