|
[originally writen for Hugi #34] It's a well known fact that cheating is an important factor in 4k (and only 4k) intros. The best known example is the now widely used and accepted gm.dls trick - in case you still don't know it, it's all about a 3 megabyte file that contains almost five hundred wav files, ready to be triggered by your module player or to be input to any machine of a soft synthesizer. Even if these wavs sound crappy, it solves a big part of the sound generation problem at least. However for textures, the problem still remains, as can be seen in the fact that 90% of the 4k intros lack textures. I think if we had an equivalent to gm.dls for textures, it would become widely used too (again, as source of textures, or just as source of patterns in a complex texture generation system). Well, we have all those wallpapers of Windows; the problem is they are different between OS versions, unlike gm.dls. So let's think of something else in a loud voice... "This is not easy... but shit, but we need to find something, think... let's see, we need a file that is as standard as gm.dls that contains textures... hm... a file as standard as gm.dls... standard as gm.dls... as gm.dls. Got it! The answer is gm.dls!" gm.dls, source of textures:
OK, let's just try and see You know what to do now. Open gl.dms, search for "data" sequence, read 4 more bytes with the length of the sample, read as many samples as you just indicated, store the sound buffer, and go for the next "data" chunk. For each sound buffer, split it in chunks and construct the image. As indicated before, the chunk size should match the main frequency peak of the signal. There are also other values that make interesting patterns. For example: all multiples of that value (harmonics). Also look to the second and third main frequency peaks, if they are not already harmonics of the main one, they will actually create very different yet interesting patterns. But don't worry, you don't need to program any DFT or self-correlation here. Just try different values in brute force, you will immediately see which values are the good ones, because as you approach a good pitch value the image changes from an ugly thing into an interesting shape. Harmonic values will normally lead you to tiled/streched versions of the main image. Depending on how inharmonic the sound is, you can get more than one very different patterns (inharmonic signals conain several hidden images, as opposed to harmonic ones that only contain one!). When I came up with the idea, I could not resist to try it. In a few minutes I got 70 useful textures. Not bad for a sound repository! I added a few of them to this article. Note that these are NOT photoshopped at all, what you see is the raw data coming from the gm.dls file, believe it or not. Some of them look like they had a lighting effect (emboss) - that comes also from the gm.dls file and it's probably due to the fact that the underlying sound was high-pass or band-stop filtered. Another side effect of dealing with periodic signals is that most textures tile quite well, at least horizontally. They are not fantastic textures as you can see below, but remember they come for free!
|