I did this recently for piano for a piece of software that I'm working on off-and-on and here is my method:
- first convert to midi from audio (either using google's AI tool or my own)
- tally all of the notes in bins
- pick the key that would lead to the most economic visual representation (least number of sharps and flats)
This simple method seems to work remarkably well for the limited case of piano music. For more complex music it would probably not work because the first step would be very difficult.
- first convert to midi from audio (either using google's AI tool or my own)
- tally all of the notes in bins
- pick the key that would lead to the most economic visual representation (least number of sharps and flats)
This simple method seems to work remarkably well for the limited case of piano music. For more complex music it would probably not work because the first step would be very difficult.