Polyphonic Pitch Detection - Open Source Library Research
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I am looking for an open source code that is able to detect multiple simultanous pitches at the same time (chords played by a keyboard instrument, for example). This means, I play something, and the algorithm must be able to tell what simultanous notes were played, by just listening, in real time.

The code must be open source, and preferably needs to be written in Javascript or a language that can be ported to javascript, such as C++.

NOTE: Do NOT submit the first results you find in google. I need someone that can do a deep research and find the precise library needed. Do NOT post research papers or articles explaining algorithms. In such case search for that algorithm you found. I need code, tested, implemented, that works.

The best answer with the best research, will win the bounty.

IMPORTANT: Your answer must be submitted with a link to *pastebin.com, and set it to **expire in 2 weeks*. It is very important that you do NOT post the answer as a comment, so after the bounty is awarded, all answers remain private to me. Just post the link to your full pastebin.com answer, with an introduction. Thank you.

*TIP will be given in addition to bounty if your answer is REALLY helpful *

Requirement: Library must have a commercially compatible license such as LGPL, MIT, etc.

awarded to grajat90

Crowdsource coding tasks.

3 Solutions

Thanks Imran for the research. Unfortunately libraries with GPL cannot be used commercially, so I basically have just one choice from the ones you sent me. Do you think you find additional libraries that have a commercial compatible license (e.g: LGPL, MIT, etc). If you find the right library I will award you the bounty + a tip. Thank you!
georgefountain 1 year ago
Winning solution

I hope this solves your problem:

1. These are some c++ solutions:


2. This is a program I made/modified for your use but the drawback is that it is in python (however, I have included a solution to get javascript) :


**Both the links are set to expire in two weeks as you wanted and the pastes are unlisted.

Please reply to my solution.
grajat90 1 year ago
Hi grajat90. Your solution looks fantastic! Thanks for taking the time to create something in GitHub. The library you modified is able to detect any type of chords or just minor and major? And can you tell me more about Python to js? How we really make the library work on js? Thanks!
georgefountain 12 months ago
And if we were to use a C++ library. Is it possible to use emscripten to covert to js? Do you know how to do it? Thanks
georgefountain 12 months ago
  1. The python library is supposed to detect all the chords, however, without using machine learning, it is very hard to get very high accuracy levels as the algorithms are not going to be perfect without optimization.
  2. I see you cannot use the python library by just converting that easily. If you are looking for an easier approach, I would recommend calling the python script through a javascript ajax request, purely for ease of use. If you still want to convert python to js, its going to involve a lot more work as many libraries are not even possible to convert to js due to incompatible operations.
grajat90 12 months ago
3- You can use emscripten to transpile c++ to js. It's actually better than converting as you get near native js speeds and a much less chance of error. Its actually easier than you might think. Visit this link https://www.sitepoint.com/getting-started-emscripten-transpiling-c-c-javascript-html5/ Please revert if I was helpful. Thanks!
grajat90 12 months ago
Hello georgefountain, I am a bit concerned about the bounty. I mean you know if you don't give any person bounty within 48 hrs after expiry, it goes to a random solution. I mean only if you think my solution was helpful, could you please consider me for the bounty? I think you would understand. Thanks!
grajat90 12 months ago
Your answer was fantastic! I am still analyzing your solutions. Please contact me at this email https://pastebin.com/zy1RLYx7 AT gmail.com. Thank you :)
georgefountain 12 months ago
Thanks georgefountain. Please do analyze my solutions. I'd be happy to assist you anytime. Thanks!!
grajat90 12 months ago
Thanks! Please send me an email to the address I provided you so I can have your contact. Thanks :)
georgefountain 12 months ago


I have listed my findings in the pastebin below:

C++ Libraries


Interesting Find


View Timeline