Method for calculating musical note-based magnitude spectrum
Have you looked into a Chroma/pitch-class analysis? That sounds more like what you want overall (expect perhaps for the octave-folding/collapsing). 

Check out librosa's CQT-based chromogram. Code to generate plot below on github:


You can use the tuning parameter to tune the musical scale, but study the full paramter set.

tuning : float
    Deviation (in cents) from A440 tuning


Finally, checkout these examples showing "enhanced chroma", to say isolate harmonic content:


https://librosa.github.io/librosa_gallery/auto_examples/plot_chroma.html#sphx-glr-auto-examples-plot-chroma-py




Regarding performance of the CQT computation, the FFT + a kernel can be used to make the computation much faster. See Judith Brown &amp; Miller "Super" Puckette's An efficient algorithm for the calculation of a constant Q transform.