I will try to explain to my best understanding how music works.

Music is a balance between pattern and randomness.
What makes music sound good is the overtone pattern people easily remember and easily can tune into it.
overtones are based on a fundamental frequency which is chosen arbitrarily as a higher note people can sign to be 440 hertz, “A” or “Lah” note. note “A” meant to be the first note,

Then there are steps(intervals)-that are steps on the overtone harmonic series.
The music is A demonstrated step(interval) on the overtone harmonic series.
By demonstrated I mean that there are at last two notes are played from one series.
Like to make a note on it, then to make a step from there up or down and play another in this series.
In music there is a combination of two or more parallel intervals on harmonic series, interleaved,
Then it sounds good.

The problem with choosing notes, If they are too close together (less than 2 semitones, like 1 semitone) they sound bad. Because it is harder for human to distinguish. If they are too distant (like 3 or more semitones). It is hard to guess accurately intuitively the step up or down. so if the steps are not from the overtones then the steps in music usually are move 1 semitone and 2 semitones apart from previous sound. and That’s all.

there are patterns of combination between sounds so they would not be too close together they are called modes or scales. A scale or a mode is a combination of two shorter patterns. a single shorter pattern is like:

long (2) long (2) short(1) ,
long (2) short(1) long (2) ,
short(1) long (2) long (2) ,

and you take two of them for the twelve notes.
so it is like

[long (2) short(1) long (2) , short(1) long (2) long (2) ,]

which make a scale

to choose notes that are not too close scale is used, usually, the way to combine intervals(on the overtone) in parallel is by moving 1 or 3 or 5 or 8 steps (up or down) on the scale(notice it is ‘steps on the scale’, not semitones)

what gives a scale its mood is how soon you hit the stressing notes the, short(1), the 1 semitone apart notes.

music is made of layers of “hooks”. hooks are based on catchy rhythm. after there is a rhythm – that rhythm is colored with notes.

In songs usually, there are 3 words of a strong concept added to a hook as the syllables of the rhythm. in songs, there are many hooks with many words.

to understand basics watch “why these notes”:

https://www.youtube.com/watch?v=P7oEADUPdpA&list=PLaWo8XUTSW6dZIpyP8UWIy_qCJ8o1Kcrb

he not always explains too well,

in the 1st, he tries to prove a point that notes we play are natural phenomena,
this is the supplemental material:

what he wanted to demonstrate, from 1:10 to 5:00 :

https://www.youtube.com/watch?v=yYf9ij7S5Zs?start=70&end=300

explanation:

+

maybe there are more
in those mooc’s about mathematics in music https://www.mooc-list.com/tags/music-theory

 

 

https://github.com/ryanatkn/ear-sharpener