How to analyse a frequency from an incoming sound ?

edited July 2015 in Library Questions

Hi everyone,

I'm new here, if by any chances there is a thread about it, forgive-me please. (and ofc, link it)

So. I'm trying to create a program who would analyse each sound incoming, and will display it visually. But I've a few hardtimes to find the tools who could help me.

I tought I'd use Ableton Live to record each instrument/sound, then send data to Processing via OSC. But it appears Ableton doesn't support OSC. Anyway, I installed Max (and Max for Live) to do that. But I can't find anyway to send a frequency from the sound. I tried to understand Pure Data, or the FFT as well, but didn't found a trick to my purpose.

So, does anyone know a way to send a frequency from incoming sound to Processing please ?

Thanks ! (and sorry for my bad english, I tried my best)



  • Where does the sound come from? Processing comes with a sound library called Minim that has a FFT analyser (look in the SoundSpectrum example sketch). You can't select an audio input device, it always uses the system's default one.

  • Hi colouredmirrorball, thanks for your quick answer !

    The sound came from my external sound card. The idea is to use this in live situation. And I'd deal with multiple incoming sound, one for the voice, one for the bass, one for ... So I need to separate each entry of sound, and deal with them separately.

  • What is your operating system? On Windows you can select your default audio device, normally it should handle devices with more than two channels.

    There should definately be a way in Max but I don't have any experience with that at all. What do you want, the frequency spectrum or the most prevalent frequency?

  • I'm working on Windows and OSX.

    I'm searching for the most prevalent frequency, I guess ? For example, I need to know that the musician is playing a A = 440 hz, so I could assimile it to a red square.

  • That shouldn't be too hard in Minim provided you can get the inputs from individual instruments. Of course when the piano starts playing chords it becomes more complicated.

    See if you can:

    • get the SoundSpectrum example sketch to work with your sound card and understand how it works

    • get the individual audio channels' spectrum

    • determine the maximum values, you'll have to observe and tweak and fine tune your algorithm

  • @orizuru== if i understand you are in real time. So use dataline in instead of osc then :: fft then: average then do your visual processing job. i have done that... many times! && it works!

Sign In or Register to comment.