0

I am creating an Android application for musicians because I am in a band and see that I needed something of this sort, but could not find one that could do what I wanted, and was wondering how would someone be able to take input from a microphone. Turn that input into a file, and compare it with all of prerecorded sound files in a database to determine the note(s), or chord(s) that are being played. I'm not having trouble with getting the input, but I'm stumped on how one would be able to compare one sound file to another in terms of frequency or something of the kind. I haven't yet been able to find an answer that could really be used to help with the problem, nor have I been able to find a Java library that handles sound comparison. I know this is a extremely hard task to accomplish, but I also know it can be done and would like to have a go at it. If anyone could offer advice, a link to a library that could do such a thing, or even if someone already has done it and could show me exactly how to do it I would be extremely grateful. Thank you for your time, and any feedback is appreciated!

Noah
  • 1
  • 1
  • 1

2 Answers2

2

I recommend you check out the music-g API put out by Google. It's an open-source library written in Java that you can integrate with an Android app. It provides sound similarity metrics.

http://code.google.com/p/musicg/

Karim Varela
  • 7,562
  • 10
  • 53
  • 78
1

While I don't think we can close as a duplicate (as it isn't, technically), please do a search before posting. What you are asking isn't specific to your platform, so much as the kinds of algorithms you need to implement.

From my post here: How can I do real-time pitch detection in .Net?

See these references: http://cnx.org/content/m11714/latest/

http://www.gamedev.net/community/forums/topic.asp?topic_id=506592&whichpage=1

Line 48 in Spectrum.cpp in the Audacity source code seems to be close to what you want. They also reference an IEEE paper by Tolonen and Karjalainen.

Basically, you need to start with some FFT, but it is much more complicated than that. I think you will find that the near-impossibility of this task (especially for a whole band, a non-clear audio input source, etc.) will make this project not worth it. Psychoacoustics, particularly with distorted guitars, will make this very difficult.

There are tons of really solid posts on this topic here: https://stackoverflow.com/search?q=pitch+detection

Community
  • 1
  • 1
Brad
  • 159,648
  • 54
  • 349
  • 530