From a footnote on p282 of Oliver Sacks Musicophilia:
There have been very few systematic studies of music in dreams, though one such [pdf], by Valeria Uga and her colleagues at the University of Florence in 2006, compared the dream logs of thirty-five professional musicians and thirty non-musicians. The researchers concluded that “musicians dreams of music more than twice as much as non-musicians [and] musical dream frequency is related to the age of commencement of musical instruction, but not to the daily load of musical activity. Nearly half of all recalled music was non-standard, suggesting that original music can be created in dreams.” While there have been many anecdotal stories of composers creating original compositions in dreams, this is the first study to lend support to the idea.
The finding has an interesting parallel with findings on the ‘age-of-acquisition effect’ in language research.
It was known for years that things like the ability to name objects or remember words was influenced by the how common the word is, and how ‘concrete’ it is. For example, concrete words like tree, apple and house tend to be more robust than abstract words like hope, love or like.
Largely due to the work Andy Ellis it’s been found that many of these effects are actually a function of at what age the word was first learnt, with earlier words being more robust in terms of being more easily processed or accessed during cognitive processing.
The Uga study hints that a similar process may be at work with music.