The mathematics of music