When people listen to a piece of music they like, these three steps happen very quickly: In the 1st step, the reward system in the brain is activated, and in the 2nd step, the happiness hormone dopamine is produced there in greater quantities. In the 3rd step, the dopamine now present in the brain produces intense feelings of happiness. Unpopular music, on the other hand, does not make people happy because no dopamine is produced when we listen to it.
Music is one of the strongest stimuli that directly influence emotions, because music can make us feel friends and make us cry. In addition, music awakens positive and negative memories and triggers high emotions, so that music is used quite specifically in advertising and to create moods in feature films.
Listening to previously unknown music also sometimes makes people happy, for which it is often enough that the music is very appealing and that there are several repetitions within the pieces of music. Many listeners find the melody familiar even at the first and second repetition, so that often a spontaneous popularity arises and this music makes happy already at the first hearing.
Even more than listening to music you like, singing or playing a musical instrument can have an effect on your feeling of happiness, because when you produce your own popular music, parts of your brain and body are additionally involved in listening to music.