My Blog: projects, sketches, works in progress, thoughts, and inspiration.

Tagged: spectrum

processing audio waveform & spectrum 1

processing audio waveform & spectrum 2

This is a quick little audio visualizer I put together with Processing and the ESS Sound Library. The audio spectrum is analyzed with an FFT and spectrum bands are plotted as vertical bars. The Waveform is drawn over the bars in white, adding a lot of interest to the image. To create the fading effect of the object a transparent, white rectangle is drawn over the whole sketch instead of using a background. Previous frames are left on the screen and are slowly covered up by white.

To create an interesting color scheme each bar is colored based on its own height and its neighbors. Combined with the overlapping shapes a broad range of tones and hues is created.

processing audio waveform & spectrum 3

Read On »

Read On (Post Continues) »

In my last post I explained how to control the brightness of multiple light emitting diodes connected to an Arduino with an interface scripted in Processing. The script which I created was great because it just took a series of values sent via USB and lit the LED’s appropriately. This is convenient because it is not specific to any input which might be needed to control the lights. The script to send a value serially along with an indicator character can be added to any Processing script. Naturally one of the first things I had to do with it was create an audio visualizer. With the Arduino programmed as it was all I had to do was use a sound library to break an audio input into frequency bands and send the values down.

arduino led audio visualizer

The circuit is pretty straight forward. Six LED’s are connected through resistors to the six pins which support PWM (3, 6, 5, 9, 10, 11) and to a ground pin. I have everything crammed onto a tiny breadboard on my proto-sheild cause it’s cute and self contained. That’s just my style. PWM stands for Pulse Width Modulation and is the a way to control the brightness of LED’s as well as some other components. It is a digital output and produces the effect by switching on and off very quickly. The result can be visualized as a square wave. When you send a higher value to a PWM pin it will spend more time on than off. This blinking is faster than we can see so the LED appears to be changing brightness according to the amount of time it spends in the on position.

pulse width modulation graph

Read On »

Read On (Post Continues) »

3d sound form

Working in 3d in Processing is all well and good but does have it’s limits in terms of rendering. To get a better rendering of three dimensional forms created with Processing it’s possible to export them to a file that a 3d modeling program can read. From my experience, the exported file isn’t perfect, but with a little work it can be turned into a nice model. A Processing script generated a 3d grid based on sound, the three axes representing amplitude, frequency, and time. Using the DXF library, I exported the model.

This raw data is a little bulky and has a few issues. All the segments of the form were separate objects. After importing the script into Blender (a free 3d modeling and animation program) I selected all the objects, joined them, and then in edit mode removed doubles. This combines all the meshes if they are lined up. Then using the ‘make faces’ on auto will fill in all triangles and quads. The image above was also extruded to give it some form and has a subsurface modifier for a smoother look.

Post Page »

3d Sound GridAlthough Processing does not have the ability to process audio on it’s own there are a few libraries which can be used to add such features. I’ve been experimenting with the ESS library but you can find others from the processing libraries page. Gathering Data from live or recorded sound can be a powerful tool for artists and designers in creating interactive applications, audio visualizers, music videos, or anything else that could involve an interaction with sound. Getting the data is fairly straight forward and the script returns an array of data updated each frame. This demonstration with display the data very simply, however, the numbers could be applied to any attribute in any system to produce different effects.

Here are the steps to creating a simple script to get the spectrum data from a microphone into a processing sketch. Using pre-recorded sound is similar. Once the data is in the sketch it can be manipulated and used to generate graphics or effect other aspects of a program including complex forms in 3d space using the OpenGL or P3D libraries. Read On »

Read On (Post Continues) »

A variation on a script I’ve been working with to generate a 3d visualization of an audio spectrum. The color and position of the first row of cubes is based on spectrum values and then passed down the array with a decay factor. Created with Processing using the OpenGL library to create the 3d environment and ESS to gather sound data.

Another variation renders a 3d grid rather than an array of cubes.

Post Page »