Not as in "how to compose music" but as in "how music is written down". The history of music notation is fascinating. The creation of an alphabet to write down language was much, much easier as we know because that was accomplished by about 1000 to 800 BC with the inclusion of signs for vowels. There was ancient music notation, but it was so imperfect we have little idea how ancient music actually sounded. Here is a photo of the Second Hymn to Apollo, chiseled on a stone at Delphi:
Here is a modern attempt to create a performance. The text is there of course, and the basic melody is there, but the rhythms and 90% of the arrangement--all that percussion, for example and any notes other than the basic melody--is pure speculation:
The music notation is the row of signs above the lines of text in the photo. It wasn't until Guido of Arezzo (992? - 1050) invented the staff--a set of horizontal lines--that the exact notes were defined. Brilliant and very simple idea: pitch, or the frequency of vibration of different sounds, was graphically shown as height. But the real problem was rhythm. It took another five or six hundred years to work out how to clearly and simply indicate rhythm. The score that decorates the head of this blog is written in one of the many complicated and difficult systems that was tried. Music notation is still developing today as composers find new things they need to indicate, but the basic system has been in place since 1600.
It works so well that a highly-trained musician can walk into a studio and play their part at first sight. When you hear the soundtrack of a movie, it is most likely that it was recorded in a single two and a half hour session by studio musicians. They probably only played it once. Amazing, huh?