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'.

Step 1: Run the Sketch

Make sure you have Processing installed on your computer. Download the attached file, unzip it and you will see a number of .pde files. Double-click the one named "soundfruit_sketch.pde" to open the main file. In the sketch window, you will see a play-button in the top left corner. Click it to run the sketch.

<p>Hey!</p><p><br>Great work, I love the shape and form it creates :D</p><p>Would love to collaborate and turn this into a rendered animation. Using this for a spatial project, if there was a way of saving the dxf for every layer that'd be a great solution for me please!<br>Also is there a way of working out how long one rotation takes, and if its possible to change the variables to change the rotation for a set time? For example one rotation is the same time for the length of a song or sound clip.</p><p>Thanks :)</p>
<p>Thanks! I am sure that is possible, although I haven't looked at the code for a long time and would have to dig it up again. If I recall, at one point I had a dxf saved for each frame, but it was too much for my computer to handle and it kept crashing, so this might potentially be a problem. I'm not sure when I'll have time, but I'll try to get back to you when I do! And let me know if you do find out how it's done, I would be curious too. </p>
<p>This is a great tutorial for those who want to make shapes from sound and then print it. Thank you.</p>
<p>Firsly congratulations for this great work! </p><p>I am having a problem with the software altough i followed the directions in the pdf. Firtsly i import the dxf file to rhino and than export it as stl. But when i upload the stl file to host two circular points connected with main object (fruit) appears on the screen as you see on the picture which i've uploaded. I meant two points on the ground. So its not possible to print the fruit. How to get rid of this problem?</p><p>thanks in advance</p>
<p>thx!</p><p>Well it looks like those are maybe artifacts created through importing/exporting. It is quite common for errors such as this to occur when you are moving a file across different software. Have you tried opening the stl file again in rhino to see if it is faulty? After opening in rhino, select all (ctrl+a) then type in &quot;zs&quot; and then enter (shortcut for ZoomSelected) to make sure you see everything in the file. Then select the circles which you dont want and delete. save again as .stl. </p>
<p>Hi! im super excited to use for meditation.. but i get this error .</p><p>Cannot find &quot;ddf.minim.analysis&quot; library. Line 3 in tab soundfruit_sketch</p><p>Cannot find &quot;ddf.minim&quot; library. Line 4 in tab soundfruit_sketch</p><p>Could you help me out?</p><p>im using Processing3.0b1 on a mac</p>
<p>Using Processing 3.0b6 here. </p><p>First thing was, that it gives an error (&quot;cannot use size() here&quot;) so I changed that to fullScreen(P3D); </p><p>that worked and the Sketch loaded the UI with play and record button as well as your mp3-file and the visuals.. </p>
<p><a href="https://www.instructables.com/member/jreilly+gavin/" rel="nofollow"><strong>jreilly gavin</strong></a>, 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 &quot;music', it is not big enough like when you play a song with drums and rhythm, it is not an &quot;even&quot; 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?</p>
<p>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?</p>
Fantastic. I can't wait to play with it. Thanks! <br><br>Have you found that your favorite songs have a similar look? I'd be curious to see if an artist produces similar shaped 'fruit'. <br><br>So many possibilities thanks again. I totally see this taking up my spare time this week!
<p>Way Cool! </p><p>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. </p>
<p>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. </p><p>Alternatively, you could use one of the many libraries that enable camera control functionality in the processing window. (like this one: <a rel="nofollow">http://gdsstudios.com/processing/libraries/ocd/)</a> I wasn't too concerned with this feature as the resulting .dxf object was more important to me.<br></p>
<p>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?</p><p>Thanks!</p>
<p>hey mxfaiman,</p><p>I have added scale functionality as promised. Just redownload the zip package. Use the 'n' and 'm' keys to scale. Sorry for the delay! </p>
<p>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. </p><p>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.</p>
<p>Hey, super cool! I was wondering, how do you output the result into a 3D file? DXF is 2D...</p>
<p>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. </p>
<p>So you just open the dxf file in Rhino? hmm :)) never thought of that, will give it a try tomorrow</p>
<p>Very nice!!</p>

About This Instructable




More by flesh_dog:Sky Printer - Prototyping An Adaptable Large-Scale 3d-Printer Sound Fruit - How to Make a Sculptural Audio Visualizer 
Add instructable to: