This example works fine on macOS. It shows a real-time view of the mic audio signal in the frequency domain. To detect the pitch you will have to find the peaks and transform them into note information.
For the GUI part, I’d recommend QML. This examples shows, how to embed GR graphics in a QML window.