Arduino midi controller (but special)

recently i looked into getting a keyboard midi controller. we already have a piano but a piano doesnt have ports, so, i looked into getting a keyboard. however, keyboards are expensive, and i would prefer NOT to spend hundreds - potentially thousands - of dollars on somthing that would just be a little convenience thing for when i write songs. so, now i had the idea to take a microphone, run the frequencies through a couple calculations and output a midi or usb signal compatible with musescore and maybe garageband. i would have some switches on top for whether to output notation or audio or none at all, and maybe a couple potentiometers for tune and stuff like that. im not very experienced with audio though, and have no idea how to give a usb signal, never mind one thats compatible with other programs.

as you can probably tell by my description, im quite inexperianced in this field. i would like advice on which calculations to use in order to round to a perfect frequency, how to give a usb signal (thats compatible with other programs), and maybe some part suggestions. thanks!

You've chosen one of the most difficult problems in audio. Even programs costing loads of money with the full resources of a top-end PC to work on only get it right about 85% of the time. Any real music note contains lots of different frequencies and just identifying them all then working out which one is supposed to be the "note" takes a lot more than "a couple calculations".

If you're talking about an electronic piano then maybe there is a way to get inside and work out which note is being pressed then go from there. That is done fairly often.


I think this would require months of research and development, maybe years. With the greatest of respect, I think it's a non-starter.

I don't think keyboards are expensive, so long as you buy secondhand. Look at this one, for £50 (UK pounds):

This is identical to mine, which I use for MIDI development work.

If you want an insight into the problems of pitch detection, this paper might give a hint of the real world performance possible:

Its an old paper, but the cutting edge hardware back then is a rough match to cheap microcontrollers of today in performance :slight_smile:

Slightly more modern take: