"We are the music makers, and we are the dreamers of dreams,” declares Willy Wonka in Charlie and the Chocolate Factory. (Though Wonka popularized it, the line comes from an 1873 poem by Arthur O'Shaughnessy.) What do these two activities really have to do with each other?
Etymologically speaking, the answer is: quite a lot! The Old English drēam had multiple meanings—including “joy, pleasure, gladness, rejoicing frenzy, ecstasy”—but the word also signified, by extension, anything that elicits such feelings.
Thus, the word drēam could refer to music, musical instruments, and musical phenomena such as melody or harmony. (This semantic overlap of music and pleasure corresponds remarkably to the Chinese character 乐, which can be pronounced either lè, meaning “happy,” or yuè, referring to music or musical instruments.)
The verb drieman meant to rejoice or be merry, but also to play an instrument in a joyful fashion. A drēamere was a musician—as Willy Wonka knew—and long before anyone had a “pipe dream” (an opium-fueled delusion, attested 1870) the word pipdream meant the music made by a flute or other wind instrument. Put that in your horn and smoke it!