Musical note recognition in APONG - How do you do something like this?

http://developer.anscamobile.com/showcase/apong

For those of you who haven’t installed it, it’s essentially Pong, except that you move the paddles up or down by singing or playing the musical notes C through G.

Though the game itself is somewhat glitchy, the idea is brilliant. I can think of a hundred different applications for it, but how in the heck do you implement this level of sound recognition into your code?

[import]uid: 68619 topic_id: 27787 reply_id: 327787[/import]

I don’t know the Corona audio API very well so I can’t tell you exactly how but the basic concept is you would analyze the incoming frequency to find the pitch. You would then compare the pitch to determine what note is actually coming in. You can find graphs that will show you which frequency is what note but it follows a pattern(each time it doubles it’s the same note at a different octave) so you could save yourself some that way.

object:getTunerFrequency() might be the API thing you would want to use so I’d look into that. good luck [import]uid: 147305 topic_id: 27787 reply_id: 112580[/import]

I wrote an app using these audio APIs called Music Man, it is on the app store.

Here is the chart I use to convert to musical notes. Corona gives you Hertz which correspond to notes.
http://www.phy.mtu.edu/~suits/notefreqs.html

Here is my app which is like a real life guitar hero type thing. The notes scroll and you have to play the real note.
http://itunes.apple.com/us/app/music-man/id497188018?mt=8

You have to call object:getTunerFrequency() over and over again to detect what note is being played. Like in a timer.

Also note that the audio detection API is only supported for iOS and not android. [import]uid: 59735 topic_id: 27787 reply_id: 113234[/import]