Sound analysis and images

edited December 2014 in How To...

Hi everybody, I start this question by saying I'm not so good at prgramming, and this is the first time I have to use processing, so I found some problems in realizing my project. I need a code that can analyze various sound parameters and draw a different image depending on the sound; for example, different frequency values draw different shapes, and the intensity changes the stroke weight, or the color. I found some methods to analyze sound with minim (like the fft analysis or the beat detect), but I don't want to represent the waveform of the sound, I want processing to analyze the numeric values of the parameters and draw different shapes. Anybody knows some methods to do this thing? Thank you very much :)


  • You'll have to formulate your conditions carefully. When exactly do you want a particular image to be drawn? When a value inside a certain frequency interval in the FFT spectrum reaches a threshold? Or when a value is at least some fraction of a peak value in another frequency interval? Then you can loop over the frequencies and search for the maximum values in each interval you specified and act accordingly. Something like that.

    If you provide code we can help more.

  • I need something like you can load different songs/tracks/recordings, and for every track a different image appears, depending on the values of the tracks; for example, for a certain range of frequency values there's an image, for another range another one and so on. Same thing for the stroke weight and the color: I'd like to associate different ranges of values of the parameters to different weights/colors. The image which is generated at the end is only one for each track, it doesn't changes while the music is playing, so I guess I'll have to work with average values and ranges. I'm sorry if I can't explain my project very well, because we are a group of italian students who never worked on programming, so we're not sure about what we have to do... thank you for the help!

  • So you mean you want to "recognise" a song?

    Does the image need to be processed in real time or is it allowed to take a while to render?

    Either way you're just going to have to try. Can you calculate the peak height in a certain frequency? Can you calculate the average peak height over the whole song? What values do you typically get and how to convert them to meaningful parameters for the image? It might help to write a couple sketches that visualize the average values in frequency intervals while the processing is being done.

  • do you want have pre-made images like cat and tree? or make the drawings on the go?

    is it one image per song or multiple images?

    is it a fixed canon of songs or shall it work with every song?

    do you want to choose an image suiting the mood of the song?

Sign In or Register to comment.