Sometimes in a dream, but more often in pre-sleep, or if awakened during the night then trying to get back to sleep, I’ll imagine the fingerboard and bass lines.
Once, a solution to a very vexing problem at work, how to remove a very specific but large part of the mouse genome and put the remaining parts back together again so that I could eventually grow a mouse with that deletion and no others, came to me in a dream. This was early in the days of “knockout” technology, long before the advent of Crisper-cas9 gene editing, and before the entire mouse genome had been sequenced. The dreamt solution worked. “Fortune favors the prepared mind” Louis Pasteur.