Do you by any chance work with Max 5 or Max for Live ?
I flail with Max, and have no experience with M4L. But since M4L includes all the Max built-ins, I may have one helpful hint for you. Here’s a bit of IanniX’s example patch, with my little addition:
The object [ftom], f-to-m (frequency-to-midi), may be what you want here. In this example, I run [ftom]’s output to a [numbox] set to display the midi (with C4 as center) value for the incoming freq values. I hope this helps.