There is two types of music:
DIEGETIC MUSIC
Diegetic music and extradiegetic music. It is known as extradiogetic music to which it sounds while the events of the film occur, although only the viewers listen and not the characters. That is, it is not part of that (fictional) world where events and situations occur.
example: "Lemonade Mouth", it's one of film, when the protagonists sings in the film, for them is an diegetic music.
INCIDENTAL MUSIC OR NO DIEGETIC
The music that usually sounds at the beginning of the movies may be called incidental music or stage music. The term applies less to film music, as it is more often called cinematic music, soundtrack or sound environment.
example: "Troya", in a scene of this film , this have one battle between Hector and Aquiles, while they are fighting, it sounds one music, for this is an incidental music or no diegetic music.