All music has a mathematical equasion to it. Starting with the Major scale. The arpeggios of the major scale and there are many but the basics are 1 3 5 This arpeggio denotes whether it is a major or a minor scale and arpeggio. 1357 denotes a 7th arpeggio 13579 denotes a 9th arpeggio.
In the key of C the notes are: 1 2 3 4 5 6 7 8 c d e f g a b c
Each note equates to a particular frequency for instances a note often used to tune a guitar is A 440hz. Each not of a scale represents its own scale as well as its own chord so the whole algo is used again.