There is still no mathematics of a simple melody never mind more complex musical structures. Music as we know it has two main dimensions: tonal space and arrow of time (tonal chronotope).
The tonal space is perceived as the phenomenal tonal gravity. However, the gradient of tonal attraction is non-linear (unlike the linear distribution of frequencies in a musical scale) and the tonal space is cyclical. There are some other interesting details of the tonal space but the non-linearity and cyclicality are the most important features of the tonal space.
The perception of tonal distances in music is mildly synesthetic. It would be awesome to find an algorithm for visualization of tonal topography.