The keyword here is "Music Information Retrieval". If you're interested in knowing more there is a few high quality tutorials out there. Don't be afraid of "research looking" papers. They're often pretty accessible. For instance:
http://www.cs.uu.nl/groups/AA/multimedia/publications/pdf/is... (A SURVEY OF MUSIC INFORMATION RETRIEVAL SYSTEMS)
Or a longer PDF: