Finding notes played in an audio clip
It sounds like you are trying to perform something between MP3-to-MIDI or music to score sheet transcription. As far as I know, this both remains


an active research topic, with emphasis in robustness (to noise, instrument) and real-time, see for instance:


Automatic Music Transcription: Challenges and Future Directions, 2013
Robust Real-Time Music Transcription with a Compositional Hierarchical Model, 2017
Learning Features of Music from Scratch, 2017

a handful of existing software, like


Notation Software, Converting Audio files to Sheet Music
ScoreCloud Studio, Music notation software for everyone
AnthemScore, Automatic Music Transcription Software