Instructables

Sound Fruit - How to Make a Sculptural Audio Visualizer

Featured
Picture of Sound Fruit - How to Make a Sculptural Audio Visualizer
cover.png

Sound Fruit is a project I did to study a free graphic scripting software called Processing. It consists of a little program that translates a mp3-file into a 3-dimensional object in .dxf format. The exported object is essentially an expression of sound, frozen in time. Depending on what sound you feed it, it will vary in its shape, giving every fruit a unique form. In the example shown I used the song "Rolling with the Punches" by The Blue Stones as a test.
The exported file can be opened in another 3d program, looked at, printed, or whatever you can think of! Potentially, you could print it hollow, wire it with an LED or two and make a cute little lamp.

Here is a video showing it in action:

Sound.Fruit - Sculptural Audio Visualizer from Tao C on Vimeo.


You need Processing to open the program. It's free, it's fun, and it can be downloaded here.
If you only want to use the program, you only need to follow the first 3 steps.

For people who are interested in the sketch itself, I'm explaining the details of the script starting from step 4. During my learning process I struggled quite a bit with finding good information about more advanced concepts and I had to piece together a lot of the information from obscure corners of the internet. I hope you will find this instructable useful in your own programming. This program is not a finished product yet and I'm still working on it, so if there are any suggestions or questions, feel free to comment. I'm barely more than a beginner myself, so any tips are greatly appreciated!
Many thanks to Brad Borevitz, who helped me a great deal in understanding programming and its application within the visual arts.




EDIT: I have added scale functionality and replaced the original .zip package with the updated one. Please redownload if you have the old version.

To scale down, press the 'n' key, to scale up, press 'm'.

 
Remove these adsRemove these ads by Signing Up
Izola23 days ago

jreilly gavin, I used my own music, i.e. a recording done at a waterfall and it did not look so hot. It did not render a big image at all and it was as if it was dimmed. I think it is because of the intervals in the "music', it is not big enough like when you play a song with drums and rhythm, it is not an "even" sound like water. I then tried another song and got a similar look. I do not want a similar look, I want it different. I'd like to experiment with other colours and shapes. Any advice?

Izola23 days ago

Is there a way to use other shapes, i.e. cubes or triangles? Also, I struggled to make a free-standing application after saving everything. Most people do not have processing installed. What alternatives are there?

Fantastic. I can't wait to play with it. Thanks!

Have you found that your favorite songs have a similar look? I'd be curious to see if an artist produces similar shaped 'fruit'.

So many possibilities thanks again. I totally see this taking up my spare time this week!
mxfaiman2 months ago

Way Cool!

Is there any way to make it so you can scroll / pan in and out? As when it gets to a certain point it fills the screen and I'd like to be able to pan out.

flesh_dog (author)  mxfaiman2 months ago

Certainly! The easiest method I can think of is to add a scale() function at the beginning of every void draw() loop. You would have to experiment with the scale-factor to find one that makes sense, I'm assuming it would be close to a factor of 1 (say 0.99 maybe). Basically, it will shrink the object a tiny little bit per loop and it will appear like as if it stays the same size throughout.

Alternatively, you could use one of the many libraries that enable camera control functionality in the processing window. (like this one: http://gdsstudios.com/processing/libraries/ocd/) I wasn't too concerned with this feature as the resulting .dxf object was more important to me.

I have been playing with it but I'm completely new to coding and can't figure it out. I tried the scale but all it does is shrink the whole window and the ball still fills it up and no zoom. I also tried adding ocd to it and I got it to dolly but it added in a cube and focused on that which was nowhere near the ball. So how do I focus on the ball and delete the cube?

Thanks!

flesh_dog (author)  mxfaiman1 month ago

hey mxfaiman,

I have added scale functionality as promised. Just redownload the zip package. Use the 'n' and 'm' keys to scale. Sorry for the delay!

flesh_dog (author)  mxfaiman2 months ago

Hm. I can't say for sure without looking at your code. It sounds like as if you have inserted the function in the void setup(). Make sure it's inside the curly braces belonging to the void draw() function.

Alternatively, you could assign a key to the scale-function, so it only scales when you press the key on your keyboard. I will try to update the code with scaling functionality once I have some time. Sometime in the next few weeks.

dneishtadt2 months ago

Hey, super cool! I was wondering, how do you output the result into a 3D file? DXF is 2D...

flesh_dog (author)  dneishtadt2 months ago

Thanks! To my knowledge, DXF is often used for 2d applications like Illustrator/AutoCAD and also for 2d-based processes like laser-cutting, but it can store 3d information. Most 3d programs should support it. I used Rhino3d to import the dxf file, it automatically converts it into a mesh object. I'm pretty sure SketchUp supports dxf also, so that would be your free alternative.

So you just open the dxf file in Rhino? hmm :)) never thought of that, will give it a try tomorrow

Jan_Henrik2 months ago

Very nice!!

craftclarity2 months ago

COOL!