Cleanest peak frequency (audio analysis)?

I’m working with audio reactive fx that respond to one audio stem (e.g. melody only), and want to get sound data (peak frequency) corresponding closely to musical notes. In other words, 440Hz = A4, 880Hz=A5 and so on for all notes.

Are there ways to ‘clean up’ peak frequency output from an audio analysis plugin so that data more closely follows dominant musical notes? ‘Do math’? Some external (lightweight) app, like a tuner?

Any tips and suggestions welcome!