I've had this happen to me, although the music isn't always beautiful and the lyrics don't stay in my head after I wake up. it happened to me this morning, actually.
more often, I'll wake up with a snippet of pre-existing music in my head but I won't be able to remember where I had originally heard it. then it will bug me until I can figure it out, if I ever do.
not related to music, but related to this type of dream: intricate and unusual buildings, the likes of which I have never seen in photographs, on screen, or in person, often show up in my dreams. when they do, I'm usually running through them and it seems like I've dreamed that same building before and know where I'm going. after I wake up, and even years later, I still remember many details of the rooms and layout of these weird buildings.
I've had that happen too, I usually look it up and find it fast.
I also first learned there was a Fremont, NY after hearing about it in a dream.
Maybe this should be moved to general discussion, in case we stop talking about specifically music dreams.