Forums

  • previous
  • next
  • 1
  • 2
  •  |  39 posts

  • avatar
    18 sounds
    456 posts
    Raw images converted to sound


    This thread continues the talk that started [here], about importing raw image files into a wav editor.

    AlienXXX
    OK, great.

    I am assuming once the sound is approved you will be posting the link. grin
    May I suggest you do so in a new post in a more appropriate forum and also post the link to this initial discussion? grin

    We will continue the discussion in the new thread and I will be posting my sonic (miss)adventures on the new thread as well.

    With regards to the blip cause by the bmp header, I had the same problem too. I mean ultimately, you can import ANY kind of file as a RAW file... Even if you have to manually edit the file name to change it from bmp or GIF or whatever to RAW.
    The problem is that you do get the file header. You can edit it out, but the problem is that it is not exactly obvious where the header finishes when you are looking at a sound file on a graphics editor or at a picture on a sound editor...
    That is why I prefer to actually convert to RAW format - absolutely no header data at all.

    On another matter, you are using GIMP. Are you working on a Linux machine?
    I have not installed Audacity, but I have heard great things about this program, so I might install it in th enear future.

    Sound not approved yet, but of course I'll post it here once it is. I gave it the tag "image2wav" we could use for this kind of sounds.

    I'm working on Mac OS X actually smile

    Yeah, the bmp header is not a big problem. One thing to keep in mind though, bmp encodes the image from bottom to top. I did another test, which I will post too, where a low frequency wave starts at the bottom and gradually gets to a higher freq further to the top of the image, in a bmp this does indeed start low and gradually increases frequency. (and for dramatic effect, then it quickly declines to low freq again, it's quite trippy)
    I created the image by applying a simple continuous dark-light wave pattern to a deformed tube in Blender 3D. I then baked that outline to a 1024x1024 image. This results in a horizontally tileable texture, therefore there are no blips in the sound where it goes from one line to another and creates a continuous flowing sound. It is impossible however to create sine waves with this technique, as the line won't wrap around the cylinder that way. But it does create a cool phasing-like effect. Which is also quite trippy.
    And actually the image with shifted greys is quite trippy too. I'm telling you, they should've had this technology back in the 60s.

  • avatar
    1345 sounds
    1520 posts


    Hi nemoDaedalus,

    Yes... Now that you mention that bmp encodes the picture from bottom to top, i seem to remember having those issues.
    I mean, when I did these pic-to-sound and soud-to-pic conversions was almost 10 years ago. I am actually surprised of how much of it I can remember.

    Great that you are using a Mac OSX. I am a PC person myself and never ventured to Linux sad . Althoug I have a spare laptop now and I might do just that to try out some promising Linux software.)
    It will be even more interesting to compare our methods and results, as we are using different software.

    8 years ago I was using an old version of Goldwave as the sound editor and a demo version of Paint Shop Pro, which I managed to rellocate in a CD at a bottom of a drawer and I am in the process of installing again.

    I have also located the best sound I created with this technique (quite possibly the only one that was not lost or deleted since).

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    Yeah, it'd be cool to hear what you made back then and hear about your methods.

    I don't know about Paint Shop Pro, I did use it in the past, but never got into the advanced functions. But with GIMP, there's a few cool tools that make sound creation easier, like "Make Tileable" or "Blur Tileable". These functions greatly help you to create sounds that are fully loopable.
    I had a weird problem though, I created a 210x210 image, which results in exactly 44100 pixels (so that's exactly 1 second if you use 44100 Hz). However, on import, where one line goes into the next line, some extra empty bytes were added. I also checked the filesize and where normally bmp is 1078 bytes larger than the amount of pixels (header size), this particular image was 1498 bytes larger. But a 420x105 image (also 44100 pixels) was fine. Also a 100x440 image produced a normal sound, I only had the problem with 210x210. So that's odd, but now I know it, I simply avoid that size.
    Another thing, if you import the sound as 8 bit unsigned, you don't need to shift the greyscales.

  • avatar
    1345 sounds
    1520 posts


    Hello nemoDaedalus,

    I feel 10 years younger doing this stuff again! LOL

    Those "tilleable" functions in GIMP sound really cool. I can see how they would be very usefull for sound creation.

    Interesting problem with the 210 x 210 size image. I don't think I had that one before... smile
    I will try to recreate that and get back to you.

    The 8 bit unassigned issue was precisely the Amiga sound format. Which is why importing 16 bit PC files resulted in that problem.
    I did find a way of fixing it using just basic sound editor functions in the Amiga... Will probably email you separately about that one, if you want to know (no point bothering to death anyone else who reads this thread weirdhock: )
    Anyway, playing with the different import formats did eventually realise, like you did, that importing as 8 bit audio avoided the need to colour shift grin . It was actually a problem to do that with Paint Shop Pro, so I started to do all the import/export as 8 bit audio. Later I could convert back to 16 bit, if needed. Soudfile processing in a graphic editor was pretty extreme so loss of fidelity due to 8 bit audio conversion was not an issue and was the easiest way.

    Paint Shop Pro may not be the ideal graphics edtor to try to manipulate sound files. But there is quite a lot you can do with just "basic" functions such as "sharpen", "blur" and "contrast/colour adjustment"...
    I have just some basic and low pass filtered saw waves through some mild graphic processing (contrast, etc) and I am very pleased with the result.
    I will probably repeat some of the tests in a more controlled fashion and do some analysis of th resulting audio files. I would like to understand what happens to the frequency spectrum. It is getting late, so that will probably have to wait until tomorrow.

    GIMP sounds like a fantastic tool to play with. I seem to recall it is free and there is also a Windows version?

    hmmmm..... erm..... I forgot...
  • avatar
    121 sounds
    1544 posts


    you guys should have a look at:
    http://www.uisoftware.com/MetaSynth/index.php

    - bram

    Warning: if you break the rules, see my avatar. Freesound Admin, Moderator, Ex-Freesound-Coder & Benevolent Dictator For Life.
  • avatar
    1345 sounds
    1520 posts


    I did... Unfortunately, windows users have to keep dreaming about it (and weep sad )

    Thanks Bram.

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    AlienXXX
    Interesting problem with the 210 x 210 size image. I don't think I had that one before... smile
    I will try to recreate that and get back to you.

    Possibly an issue with GIMP. Earlier when I tested if you could create separate channels (for stereo files) with the colour channels, it also created a bmp with alpha channel, even though I didn't use any alpha.

    AlienXXX
    GIMP sounds like a fantastic tool to play with. I seem to recall it is free and there is also a Windows version?

    Yes. It can be weird at first, it took me a while to get used to it. But there are plenty of tutorials to be found.

    Bram
    you guys should have a look at:
    http://www.uisoftware.com/MetaSynth/index.php

    Thanks Bram, that's looking quite cool. I remember having similar software, but simpler, a long time ago on Windows. If you had an image, placing dots to the bottom of the image produced low frequencies and placing dots more to the top produced higher freqs. Very fun to play with smile

  • avatar
    121 sounds
    1544 posts


    http://www.nicolasfournel.com/audiopaint.htm
    http://hem.passagen.se/rasmuse/Coagula.htm
    http://sourceforge.net/projects/opensonify/

    are 3 more. check the first one first...

    - bram

    Warning: if you break the rules, see my avatar. Freesound Admin, Moderator, Ex-Freesound-Coder & Benevolent Dictator For Life.
  • avatar
    1345 sounds
    1520 posts


    MetaSynth may eventually spring a windows version.
    In the meantime, ther eare a few image to sound VST plugins on the current KVR challenge:
    http://www.kvraudio.com/developer_challenge_2009.php

    Such as Harsh Digital Nose and SpectroBits

    nemoDaedalus, you may also be interested in looking at Eigenmode.

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    I thought of a way to create custom wave shapes using images, I'll tell you later smile

    I had more problems with small bmp files. Tif exporting is fine, although this of course stores the image from top to bottom again and it has a header and a footer, so some noise at the beginning and some at the end. So it seems a special GIMP plugin is needed for pure raw export/import, but I couldn't find any. When you say 'raw', the image world immediately think of digital cameras, which are not pure raw images.

  • avatar
    1345 sounds
    1520 posts


    Looking forward to hear that idea of yours!

    I mentioned being able to "fix" the flipped waveform problem when importing 16bit audio files as 8 bit using just basic sound editor functions.

    1) Take the starting waveform ("flipped"wink and save it as "Wave1.wav"
    2) Now invert this waveform and save it as "Wave2.wav".
    3) Amplify the volume of "Waveform2.wv" until it saturates completely and you are left only with square waves. Make sure you overdo this massivey so that any hint of the waveshape is destroyed and you are left only with pure sqare waves - byt the way, DO NOT PRESS PLAY. This waveform will be very loud and almost certainly extremely unpleasant.
    4) Now simply add waveforms Wave1.wav and Wave2.wav and save as "wave3.wav". - The result should be very close to the original waveform. Zoom in to inspect the waveform. If there are still some oddities (especially in the low volume parts), you may need to pump the volume of Wave2.wav further up and try step 4 again.

    Hopefully this instruction is clear enough to allow you to try with your sound editor.

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    Ah yes, that makes sense smile

  • avatar
    18 sounds
    456 posts


    Here's the idea how to make wave shapes with images.

    1. Create a new image, greyscale, I made mine 100x441 pixels, which should get you a 1 second sample with a frequency of 441 Hz (which is close enough to middle A, 440 Hz) (with sample settings 8 bit, 44100 Hz). Fill the image with a gradient, full black on the left and full white on the right.
    2. Open the 'Curves' dialog and edit whatever shape you want your wave to be. For best results, make sure the leftmost and rightmost node in the editor are at about the same level, 127 would be a good choice for their values.
    3. Import in audio editor and you're all done!
    http://s3.postimage.org/Dkm5A.jpg

    Now, we can do the same, but instead of greyscale, use RGB.
    1. Create the same sort of image as above, but RGB, not greyscale. Shape the Curves separately per channel, one for red, one for green, I made blue all flat, not using that.
    2. Now, in your audio editor (and I use Audacity, this may be different for other editors), choose to import not 1, but 3 channels! Depending on how you've saved the file in your image editor, you may also need to set a start offset. For tiff, I used start offset of 2 bytes, but if you use pure raw, you might keep it at 0.
    3. And then we have created a stereo wave! Red corresponds to left channel, green is right channel and blue could be center, if your audio setup supports it. You could also just delete the blue layer in Audacity to keep only left and right.
    http://s3.postimage.org/DkZ_S.jpg

  • avatar
    18 sounds
    456 posts


    And for those interested, my very first attempt I did with a Blender-created Woodband texture can be found [here].
    Also see:
    http://s4.postimage.org/4HkX9.jpg

  • avatar
    1345 sounds
    1520 posts



    http://www.nicolasfournel.com/audiopaint.htm
    http://hem.passagen.se/rasmuse/Coagula.htm
    http://sourceforge.net/projects/opensonify/

    are 3 more. check the first one first...

    - bram

    bram,

    Thanks for the links. I have checked the first one and downloaded the program.
    It is amazing !!! cool

    There are, of course, different ways of converting images to sound.
    -> Me and nemoDaedalus have mostly been doing direct conversion, bit-by-bit between image and sound files. - meaning the file is converted between sound and image as raw data, there is no interpretation by the software of what the bits mean.
    -> MetaSynth and AudioPaint convert an image by mapping colour to intensity and the pixel height position to frequency.
    ->The Harsh Digital Nose VST is a plug in that converts a whole image as a waveform and gives you a lot of control over the speed at which that "image file" is played back at, which in turn can generate different effects.

    Obviously, each method has its advantages and disadvantages. They pretty much do very different things.

    Thanks again for the links.

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    I also found one online in a Java applet, see [link]. It also works like AudioPaint, bottom is low frequency, top is high frequency. White is louder and black is less audible.

  • avatar
    1345 sounds
    1520 posts


    I thought I had it all sussed... But just in case you want to know.

    I imported my own file
    http://www.freesound.org/samplesViewSingle.php?id=82398
    and converted it to raw format with the intention of processing it in Paint Shop.

    First thing I noticed when I listened to the raw version (no processing) back in a sound editor, was that there was a clip on some of the bass beats. There is no clip in the original file... so that was the first time I was left scratching my head.

    I made a second conversion to raw format, but with the volume lowered to 80%, to assure no clipping.
    This one sounded fine.
    So I processed it in Paint Shop Pro with some motion blurr. The result was ecognizeable, but very noisy. So I desicec to blend it with the original raw file, but I wanted to to this in the graphics program.

    Now work this out... The raw file (A) and the processed raw file (motion blurr) (B) are both 1367Kb.
    What I did in the graphics program was (A+B)/2. I thought this would result in a mix between the two sounds.
    The resulting file has the same number of pixels, but it is 4100Kb (????). It sounds recognizeable, but plays much slower than the original file - can be ajusted by changing the play rate, but why the change in size ?

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    I would say it converted to RGB, as 4100 is 3 times 1367.

  • avatar
    1345 sounds
    1520 posts


    yep. That is what I realised.
    I went through the process in my head as I was going to bed, and remembered ticking a box for "all layers" when selecting which colour layers to process. - So the program created 3 equal layers for RGB (picture was greyscale).

    Fixed now and posting the processed sound to Freesound.

    hmmmm..... erm..... I forgot...
  • avatar
    18 sounds
    456 posts


    Here's one more I made. In Blender, I created and deformed a tube, baked the procedural texture to an image and imported that into Audacity.

    Here's the object in Blender 3D with texturing:
    http://s2.postimage.org/1iWYu0.jpg

    Here's the baked texture after the greyshift conversion:
    http://s3.postimage.org/IlUgJ.jpg

    And here is the result:
    [link]

    So you see, they should've had this technique back in the 60s, trippy image and trippy audio grin

  • previous
  • next
  • 1
  • 2
  •  |  39 posts