Basic sound input.

The amplitude isn't normalized or expanded. It looks good on music that has a lot of dynamics, not so good on pop. Try "So What" on Kind of Blue. You may need to adjust the input gain, since the app doesn't do it for you.

The pitch estimation is just with zero-crossings; it works great if you whistle into it, but not for recorded music with multiple instruments. I would next try the spectral centroid.

You have your Xcode project settings set to indent using spaces, yet apparently are using another editor that indents with tabs. You might want to adjust that and reindent everything. I'm sorry to bring something so tedious to your attention, yet it must be said.