As a follow up to the Arduino Audio Input tutorial that I posted last week, I wrote a sketch which analyzes a signal coming into the Arduino’s analog input and determines the frequency. The code uses a sampling rate of 38.5kHz and is generalized for arbitrary waveshapes. I’ve also turned the LED attached to pin 13 into a clipping indicator, so you know if you need to adjust your signal’s amplitude as you send it into the Arduino.Some project ideas for the code presented here include:pitch reactive projects- change the color of RGB LEDs with pitch, or make a lock that only opens when you sing a certain pitch or melody audio to MIDI conversion- get the Arduino to translate an incoming signal into a series of MIDI messages. See my instructable about getting the Arduino to send and receive MIDI for lots of example code to get started audio …
http://www.instructables.com/id/Arduino-Frequency-Detection/