Draw with sound.

I don’t know if it is apropriated to ask it here or if this question was asked before(I searched the forums, didn’t find anything)

Well I’m playing with the example apps and an idea ocured to me. Is it possible to draw rectangles on a canvas with some sound detected by the microfon. For example if the program start with a blank black canvas and there is function that waits for some sound from the mic. When the sound is produces the program draws a rectangle on a random position with his height and weight calculated by the volume of the sound made(the louder the sound the higher and wider the rectangle).

Basically my question is - Is there a function that listens for this kind of events, I browsed through the API and the only thing partialy relevant is audioReceived, but from what I see it captures the audio in packages. Which is not what I want…

Hi
usually to make sound responsive visuals/animation people use values from a FFT analysis. FFT is a sound spectrum analysis and will give back the amplitude of different frequencies.
OF has a built in method to get this information on sound files being played called ofSoundGetSpectrum()
to do this on sound from a microphone its a little trickier but there are a couple addons to do so if you search the forum a little bit. I also have a couple classes i use to do this and can send you an example if you want.

hope it helps

Rui

BTW: are you this->www.gmunk.tv gmunk?

[quote author=“pelintra”]Hi
usually to make sound responsive visuals/animation people use values from a FFT analysis. FFT is a sound spectrum analysis and will give back the amplitude of different frequencies.
OF has a built in method to get this information on sound files being played called ofSoundGetSpectrum()
to do this on sound from a microphone its a little trickier but there are a couple addons to do so if you search the forum a little bit. I also have a couple classes i use to do this and can send you an example if you want.

hope it helps

Rui

BTW: are you this->www.gmunk.tv gmunk?[/quote]

Thanks for the reply! In a reverse order…
No… I’m an ordinary Computer Science student with an interest in generative art and interactivity. :smiley:

As for my question I’ll look these thing more and will write again to update on the problem. Thanks again for the reply!

An example will be helpful.

Thank you.