• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Anyone know of any pitch recognition DSP libraries ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone know of any pitch recognition DSP libraries ?


  • Subject: Re: Anyone know of any pitch recognition DSP libraries ?
  • From: Ian Ollmann <email@hidden>
  • Date: Mon, 26 Nov 2007 13:20:05 -0800


On Nov 26, 2007, at 12:06 PM, email@hidden wrote:



2) For a given frequency value f in Hz, the closest corresponding MIDI note can be calculated via:

m = round( log2((f / 8.1757989156)^12 ) )

If m is of integer type, lround might be more appropriate before.

I'm assuming this ^12 is exponentiation. You might also be able to simplify things a bit here :

	log2( x^12) = 12 * log2(x)

so..

	m = lround( 12.0 * log2( f / 8.1757989156) )

...seems like it would be less likely to overflow spuriously for f > ~13300 (single precision), and we don't have to call pow().

You can also save a divide:

	const float c = log2( 8.1757989156 );
	m = lround( 12.0 * (log2( f ) - c )

Ian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: User-land CoreAudio driver and Leopard
  • Next by Date: Re: Buffer Size in Audio Units
  • Previous by thread: Audio Units and Software Monitoring
  • Next by thread: Help with monitoring system-wide audio
  • Index(es):
    • Date
    • Thread