Music as we appreciate it is clearly a very human thing. Music invariably tells a story. Sometimes very simple - three blind mice, even without the words has a story arc of the melodic movement over a simple chord progression.
Rhythm is clearly bound to the movement of our bodies. Most basic rhythms are dances. Changes to rhythm can bring tension and release, and in that we get back to an element of telling a story. Someone singing a song with a story is perhaps the purest music we have ever had or will have.
Helmholtz created one of the first serious analysis of what makes the notes of the scale in terms of human hearing. Prior to that there was analysis that was little more than numerology. The Pythagorean scale based upon the 3:2 ratio was an early one. Helmholtz based his work on the idea of beats, and frequency ratios that sounded rough versus those that didn’t. He worked up a function that incorporated some of how the ear operates - in particular sensitivity of the organ Corti, with scaling for low frequency beats, and applied to an estimate of the strength of the beats between two partials of different notes. This gets you a graph of consonant and discordant frequencies over an octave.
As a good approximation, there is less roughness at frequency ratios that mostly line up with the notes in the diatonic scale, and also some others. Helmholz himself notes that the estimate is only approximate, and really only a first order approximation. But it does a remarkable job of predicting useful notes in a scale. Helmholtz also spends a lot of time working though scales from other cultures and also deriving things like the 53 note scale, with attendant notation about the roughness of the constituent notes.
(Helmholtz’ work is astounding in the breadth of analysis he brings to the subject of music from a scientific point of view.)
You can take Helmholtz’s roughness function and plot a 3D version where x and y are both frequency scales, and thus create an estimate of two note harmony. And the results are very good - with many conventional harmonic relationships directly outlines complete with an estimate of how consonant they are. SO again, from an analysis of the internals of hearing we see a structure of music arise.
Once you have a basis of notes in a scale, harmonic relationships, you get chords, chord progressions. From there you just need to add rhythm. With a dose of creativity with the tools provided you are ready to get yourself pretty much up to the Baroque period of music. The Classical period expanded the possibilites, and took music out from the Church and into the salon. Music became ever more entertainment. Much of it was cheery. This ignores folk music and other music of the masses, which could be anything but cheery. (Or John Dowland’s music - he being the first EMO musician.)
The idea that you can tell a serious story, one with a range of emotions and talk to the human really didn’t take hold in the western cannon until Beethoven. He unleashed the romantic period, a period where music theory didn’t change much, still 12 notes in the diatonic scale. (And we play both kinds of scale here, major and minor. All the other modes seeming left behind with the Greeks.) The rest of the world continued on with a wide variety of scales, forms and rhythms, many of which make western music look primitive.
Adding emotion understood that the choice of harmony, melody and rhythm could elicit emotional responses. And these could be anything. In the west it took us into Brahms, Wagner, Mahler. Then all hell broke loose after WW1. Music gets deconstructed, atonality rises, worse - dodecaphonic music appears (music to be appreciated on the printed page more than when heard.) Music splinters in the west and a huge amount of experimentation occurs that further dives into how music interacts with humans. Minimalism, Ambient - music that pushes the boundaries, and yet stays undeniably music. Music that explores how the brain responds to slow changes in structure, or music that is expressly designed to not require one’s attention. And into music that has no definable rhythm or even short term structure, but is still clearly music. IMHO music of a form that our minds latch onto the structure of - with out brains insatiable desire to find structure and correlation. Classical music tends to signpost where it is going with its clear structure and rules. Minimalism, Ambient and their ilk remove the signposts and require the minds of the listener to do the heavy lifting - which all by itself is pleasurable.
Opera is another thing. Adds song to powerful music and typically with a mix of ridiculous and tragic story lines, usually moral tales of the time. Hard to pick apart the drama from the music sometimes. Mimi waiting for her lover to return. Or the total genius of Wagner. Listen to Sigfried’s death and funeral march. Nothing comes close to conveying the human tragedy of the death of a hero. (Although Sigfried was hardly a hero - he was an idiot, but that is just the story, not the music.)
In the modern world music can range from the wild extremes of the math rock death metal of Meshugah, to Steve Reich, Phillip Glass or Brian Eno, modern classical such as John Adams, Michael Nyman to modern horrible pop music. Modern opera just gets ever more horrible story lines and sometimes still manages great music. Breaking the Waves - fabulous music - everything modern opera should be. Awful story. (Heroine, as usual, dies at the end, just in a modern horrible manner.)