Audio Waveform Art

Everything todo with programming goes HERE.
Post Reply
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Audio Waveform Art

Post by sinewav »

I'm putting this post in programming because this might turn into a conversation about how it was done. Two years ago I thought about turning audio thumbnails into visual art, but in a way I've never seen done before. About six months ago I had a rough idea how I wanted to approach this project. I wrote myself a note, thus putting it "on the list" of future projects. Well, I finally reached that part of the queue and hammered out a few drawings. I'm only going to share one with you now because I'm not ready to release the full gallery -- but I can't contain my excitement, so here:

Here is a silhouette of a lightcycle and trail. For those of you who don't know what you are looking at, this is a screenshot of my audio editor (Wavosaur) and the thumbnail is an actual audio file, similar to what you would see on soundcloud.com. This is far less impressive if you know nothing about audio and editing. But if you do know something about audio, then you should be a little amazed right now. I have more impressive pieces, but those and more will be released in a couple weeks.

I zipped up the .wav file and attached it for those who want to hear what it sounds like. NOTE: Not every media player or editor can play the file and all of them will sound different! I think this has to do with unsupported sample rates. These drawings of mine are supposed to be visual art made from audio files.
Attachments
wav-art-lightcycle.png
wav-art-lightcycle.zip
(816 Bytes) Downloaded 222 times
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: Audio Waveform Art

Post by Jonathan »

I see what you did there!
Attachments

[The extension wav has been deactivated and can no longer be displayed.]

ˌɑrməˈɡɛˌtrɑn
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Audio Waveform Art

Post by sinewav »

Jonathan wrote:I see what you did there!
I can guarantee what you did is smarter and more efficient than how I made my drawings. Care to explain? I know almost nothing about mathematics. I can't even do most Algebra. And I know even less about programming; I just modify code without having a real understanding of what I'm actually doing.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: Audio Waveform Art

Post by Jonathan »

Um, where do I even start? You've made one yourself, somehow! I'll just try to give a brief overview.

The signal is simply amplitude varying over time. Time is always increasing, running from left to right on this sort of graph. At regular intervals are samples, where you can set any amplitude (vertical position) you like. This puts some constraints on the things you can draw, as they must be monotonic with respect to time. That is, time is always passing at a constant rate; you can't go back to the left and draw some more lines, as you might in a regular 2D drawing, or skip any point in time (although we've cheated here by just encoding zeros). This is your canvas.

When you zoom out to the point that individual samples—possibly even waveforms—are smaller than pixels, programs still try to draw something sensible. Audacity draws the min/max peaks across the period of time covered by the pixel in dark blue, so you'll always know where your peaks are. It also draws the RMS in light blue, to show overall amplitude. But the peaks are what we use here. In this case we're even simply dealing with pairs of samples to represent min/max. This is essentially a kind of multiplexing, where we can encode a 'high' and a 'low' line, between which pixels are filled.

Knowing that, it's just a matter of doing it.
ˌɑrməˈɡɛˌtrɑn
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Audio Waveform Art

Post by sinewav »

Yes, yes. I guess what I am trying to discover is how you approach the problem. I suspect you constructed the polygons above using code only. My method is very time consuming and involves the following: tracing an image by hand using Inkscape point by point across the X-axis, taking the SVG paths and converting the Y-coordinates to arrays in the audio range, then writing them to a file. An easier way would be to draw a closed path (silhouette if the image) in Inksacpe and have some code that recognizes the min/max Y as it traverses X. But you see, I have no idea how to construct something like that. I failed math!

Now that I think about it, you might not bother explaining your process to me because I probably won't understand it anyway, heh.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Re: Audio Waveform Art

Post by Jonathan »

Oh, that! It's called math, indeed. I used sine and cosine (more elegantly put as the imaginary and real parts of the value of the complex exponential function with an imaginary argument, but I'm trying to help) to space the vertices evenly. I normalized area and then transformed each polygon to its intended location. I used some basic ray tracing to sample the polygons, because who doesn't trace rays to create an audio file?
ˌɑrməˈɡɛˌtrɑn
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Audio Waveform Art

Post by sinewav »

Hahaha... Exactly. This is so beyond my abilities. I just hope I inspire someone to do this kind of art better.
Word
Reverse Adjust Outside Corner Grinder
Posts: 4258
Joined: Wed Jan 07, 2009 6:13 pm

Re: Audio Waveform Art

Post by Word »

I remembered watching a report about a local artist who did something like this. I did a quick search and the closest thing I found was this guy, but what he does is completely different from what I remember (and he's bavarian). Maybe interesting regardless. And I found this, it's like that map of the London Underground you can use as a musical instrument.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Audio Waveform Art

Post by sinewav »

Because I said I would be back with more, I put up my small gallery of wav-art images. They are so silly, I just love it. What a weird project.

Audio Waveform Art

8)
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Audio Waveform Art

Post by sinewav »

Jonathan, if you ever see this thread again and by some miracle you have the code you wrote to recreate my work, I would like to see that code. I still get regular email about this wav-art stuff and I would like to understand how other people approach the problem.

Thanks!
User avatar
stephanietubesocks
On Lightcycle Grid
Posts: 47
Joined: Sat May 20, 2017 2:59 am
Contact:

Re: Audio Waveform Art

Post by stephanietubesocks »

interesting, waveform display will allow only limited filled art from the zero crossing line but still very cool

i like it
Post Reply