Isn’t this what Chordify and/or Transcribe+ does? @PamPurrs I think I remember you posting about Chordify?
Edit - you might be interested in this thread: