tags:

views:

751

answers:

5

I don't suppose anyone is aware of any libraries that allow you to detect the current pitch (that is, in notes) received by the microphone in Mac OS X? I'm assuming it'd be a mixture of Objective-C and some provided lib. Or else in Java for multi-platform goodness?

A: 

Well, you could use Aubio after recording a sample from the mic, or find a way to pipe to it.

lfaraone
A: 

Don't know of any specific liibraries but Praat does do pitch analysis, runs on OS X and can be scripted.

RobS
+1  A: 

musical DSP solutions are difficult. finding something particularly GOOD and packed in a library and for free is very optimistic. (the music software industry being as competitive as it is...)

a useful repository of source code can be found at http://www.musicdsp.org/

otherwise, Miller Puckette's Fiddle~ code does pretty much exactly what you describe. it is not a library, though (it is an extension to PD). but the source is available AFAIK

good luck,

|K<

kent
A: 

Transcribe is excellent. It will show you the pitch of a recording, and show you which piano keys.

If you are looking to write this yourself, have a look at FFT (Fast fourier transform) algorithms. Its actually quite easy to implement. Id do the FFT (which converts a signal into its frequency components) and then just pick out the top one.

jgubby
+1  A: 

There are some code snippets here that describe auto-correlation for pitch.

http://www.iwillapps.com/wordpress/?p=212

http://www.iwillapps.com/wordpress/?p=214

Also, this is a great "explanation" on two types of pitch detection http://cnx.org/content/m11714/latest/):

  1. time-domain autocorrelation
  2. frequency-domain harmonic product spectrum.
zeroinverse