top of page
Search

What Will Dream Songs Sound Like in The Era of AI Music?

Popular musicians have been dreaming of music and waking up to record the ideas for more than a century. Some of these dream songs went on to become major billboard hits.



Paul McCartney's song Yesterday, for example, came from a melody that he heard in a dream. When Paul regained consciousness, he recorded a short demo with nonsense lyrics about scrambled eggs.


“I had a piano by my bedside, and I must have dreamed it because I tumbled out of bed and put my hands on the piano keys and I had a tune in my head,” explained McCartney.
“It was just all there, a complete thing. I couldn’t believe it. It came too easy. I went around for weeks playing the chords of the song for people, asking them, ‘Is this like something? I think I’ve written it.’ And people would say, ‘No, it’s not like anything else, but it’s good.'" - NYTimes McCartney interview from 2020

McCartney's not alone in this experience. During this article, I'll share some more examples of dream songs from popular music.


I'll also be sharing exciting news about a new intercranial EEG technique that scientists have developed to record activity in the auditory cortex while people are listening to a song, in order to reconstruct that audio digitally with the help of a machine learning model.


These recent innovations beg the question -- will scientists eventually be able to capture music from our dreams as they emerge organically during REM states?


For the musicians reading this, we'll also include a full tutorial explaining how to capture melodies from your own dreams, using Meta's AI text-to-music model MusicGen to elaborate on the dream songs and generate several variations. This technique is an alternative to dream analysis. It expands on your ideas instead of using psychoanalysis to interpret or reduce them to simple explanations.


Table of Contents

  1. Using iEEG to reconstruct the music in our heads

  2. The Dream Song + AI Music Generation Technique

  3. "Dream2Song" MusicGen workflow summary

  4. Changing condition duration to increase novelty

  5. Famous dream songs and their backstories

  6. Beatles: Yesterday and Dream #9

  7. Satisfaction by the Rolling Stones

  8. Enterlude by The Killers

  9. Dream songs: medicine music of indigenous cultures


Using iEEG to reconstruct the music in our heads


On August 15th 2023, at team of computational research scientists, led by Ludovic Bellier at UC Berkeley, made a breakthrough in intracranial EEG (iEEG) and music, detailed in this article from the New York Times.


iEEG machine reconstructs music

Bellier's team analyzed a dataset of 29 patients who had listened to Pink Floyd's song Another Brick In The Wall and used machine learning to reconstruct a recognizable segment from the song. A full technical report can be found here.


So what does this have to do with dream songs?


Parallel efforts to record the dreams of sleeping patients have been bearing fruit. In May 2023, scientists from the National University of Singapore released a paper on Arxiv called Cinematic Mindscapes that detail a mind-to-video reconstruction technique using fMRIs.


By studying the cerebral cortex and co-training a masked brain modeling system with Stable Diffusion, Zijiao Chen and his team claim to have improved semantic classification of the brain activity from the previous state-of-the-art 45% to an impressive new 85% accuracy level.


As this kind of technology continues to advance, ML-assisted iEEG and fMRI processes could lead scientists to a newfound ability to reconstruct the music we hear in our dreams. Maybe.


We're years away from a commercially available product that musicians can strap on and use while they sleep. So for now, we'll have to stick with manual processes like the Dream2Song MusicGen workflow that I'll be sharing next.


The Dream Song + AI Music Generation Technique


To get started with this process, a song will first have to come to you in a dream. For those who aren't in the habit of dreaming about music, there are a couple simple things you can do to set the stage and signal to your subsconscious mind that you're interested and ready for the experience.


Oxford University published a research paper on music and dreaming in April 2018 proposing that people who practice on a musical instrument for long periods are more likely to dream of music.


Everyone dreams during REM, but not everyone remembers those dreams when they wake up. To accurately capture a melody after dreaming of music, it's important to have an audio recording device next to your bed. Dream journaling each morning when you wake up can help stimulate awareness of your dreams and is promoted by people who practice lucid dreaming.


I personally experienced one of these "dream songs" a couple of months ago. In the tutorial video below, I share details about the AI dream-to-music workflow that I've been practicing in order to build upon the initial idea that I heard while I was sleeping. The video includes an audio recording of the dream melody, played on a MIDI accordion, and three variations that were produced by MusicGen.



Dream song case study: Origin & technique


A few months ago, I dreamed that I was in a cafe in Paris, listening to a timeless chromatic melody. I woke up in the middle of the night and felt compelled to record it on my cellphone's voice memo app. In the morning, I listened back and transcribed it with a MIDI software instrument in my DAW (Logic Pro), using some simple chord accompaniment to give it harmonic context.


After bouncing the MIDI version of the song to MP3 format, I passed it through a HuggingFace space called SplitTrack2MusicGen, by Fffiloni. As I experimented with changing the text prompts, I was able to retrieve variations in over a dozen styles.


What follows is a step-by-step summary of the video tutorial provided above. If you don't feel like watching the whole video, I do recommend at least skipping to the end so you can hear concrete examples of how the dream song was transformed by MusicGen.


"Dream2Song" MusicGen workflow summary

How to use MusicGen

Above is a screenshot of the SplitTrack2MusicGen interface on HuggingFace. I've marked up every relevant point of interaction, so you have a visual reference to go along with this step-by-step tutorial.


Without further ado, here's the 12-step Dream2Music workflow.

  1. Keep an audio recording device by your bedside. Make sure it's easy to hit record so you don't lose the melody while fumbling around. Don't wait until morning to record it, as the music will probably be gone by then.

  2. I recommend using a MIDI instrument to record your melody. Then add the simplest chord progression under it that you can come up with.

  3. Bounce the MIDI track as a WAV or MP3 file without any effects (delay, reverb, distortion, etc). The cleaner your final output is, the easier time MusicGen will have understanding it and using it as a condition.

  4. Clone the SplitTrack2MusicGen space: When you use your own GPU, you have access to the larger models and will get better audio output quality.

  5. Upload your song to SplitTrack2MusicGen as the audio input. If it's longer than 30 seconds, click on the edit button to select the audio region that you want to pass in as your condition.

  6. Select the All-In option to bypass stem separation.

  7. Click on "load your chosen track" and wait for the track condition to appear.

  8. Type up a musical prompt. If you're having a hard time coming up with the right prompt to use, check out this article we published on the LP-MusicCaps music-to-text generator. Upload a reference song and then grab that music description to use as your song's music prompt.

  9. Extend the generated music duration to 30 seconds.

  10. Hit submit and wait 2-3 minutes.

  11. Continue tweaking the text prompts and regenerate until you begin getting the results you want.

  12. Pause the model when you're done to avoid racking up a bill on HuggingFace.


Changing condition duration to increase novelty


As I mention near the end of the tutorial video, there's a fascinating trick that you can experiment with, in order to extract greater novelty from the AI generated music output.


Below is a screenshot where I modified the duration of the track condition using the edit button on the initial input. As long as the "generated music duration" setting is set to 30, you'll get far more variation from the output than if you use a 30:30 ratio.


Dream Song workflow for changing duration

I recommend starting with 30 second track conditions with 30 second generated music duration for the output. It will sound closer to your original idea that way. Later on, when you've experimented with lots of different text inputs, changing the track condition length in small increments can be an exciting way to push the envelope further.


One of my favorite versions of the song was a jazz guitar trio arrangement that had completely reimagined the chord progression and bass. I used my ear to transcribe the bass line into a MIDI upright bass in my DAW and then recorded the rhythm and lead guitar tracks on an acoustic guitar.


Overall, I found the MusicGen part of the process to be exciting and exploratory, but re-recording it was the most educational step as a musician. It provided me with an excellent ear training exercise. Transcribing and performing the notes accurately expanded my perception of what was possible through new melodic phrasing and reharmonization.


Famous dream songs in popular music


Now that you know how to create full arrangements from melodies that you heard in your dreams, let's have a look at what other artists have done using a more traditional approach.


The website Songfacts offers a large collection of 149 songs inspired by dreams. You can drill down into any particular song to read its backstory.


Here are four main categories that I discovered while exploring what these artists had to say about their experience:

  1. Melodies, chord progressions and rhythms are heard in a dream

  2. Lyrics and phrases are heard in a dream

  3. Visual dream experiences inspire lyrics upon waking up

  4. Songs are written that explore the idea of dreaming in general

The fourth category of songs about dreams are apparently still considered a dream song, but it's not aligned with our definition.


Yesterday: McCartney's Dream Melody



I shared some details about McCartney's dream that inspired the Beatles song Yesterday. You can listen to the full song above. But he's not the only Beatle who turned music from their dreams into a hit. John Lennon described similar experiences that shaped his Let it Be and another solo release, Dream #9.



The lyrics to Dream #9 describe a dream he had of someone calling out his name and speaking a phrase that felt immensely powerful to him.


When you listen to the song, it does seem to have have an almost transcendental quality. As he sings "I thought I could hear", the song changes to a new chord progression and transports the listener. Modulating between keys and tonal centers is a powerful technique for emotional transformation.


I'm not putting it down, it's just what it is, but I just sat down and wrote it, you know, with no real inspiration, based on a dream I'd had.” John Lennon, 1980
“This was one of John's favorite songs, because it literally came to him in a dream. He woke up and wrote down those words along with the melody."

Here are the lyrics from Dream #9 that inspired the song:


"Somebody call out my name

As it started to rain

Two spirits dancing so strange

Ah! Bowakawa, pousse pousse

Ah! Bowakawa, pousse pousse

Ah! Bowakawa, pousse pousse"


It's common to hear nonsesnse words during dreams and hypnagogia. They seem like gibberish but carry a distinct feeling state with them. For John, the phrase Ah! Bowakawa, pousse pousse had no prior meaning. Instead of trying to interpret it, he used the words as creative material.


Writing lyrics around these dream-words and composing a melody is the classic approach. You can also try encoding the words into a melody or chord progression using the text-to-MIDI VST AudioCipher. This process allows you to bring any kind of words to life through the music, even if the listener doesn't know about its deeper origins. You can let the power of the word inspire you in the DAW.


AudioCipher word-to-midi

Satisfaction by The Rolling Stones



"'I can’t get no satisfaction,' went the melody, sung by Richards in a sleepy, half-conscious voice. After several repetitions, the music faded out and gave way to 40 minutes of snoring. Richards had apparently woken up with a melody in his head, recorded it with his acoustic guitar and then fallen back asleep." - American Songwriter article on Keith Richards


Enterlude by the Killers



When The Killers were working on their second album, singer Brandon Flowers remembered a dream he had about Kurt Cobain, a ship, clouds—and a ringing melody.


"It sounds ridiculous, but it was Kurt Cobain on a ship, in the clouds." said Flowers. "He was singing this melody and I remember thinking he sounded like Bob Dylan, so that made it even weirder. The melody Cobain was singing became the melody of Enterlude. " - KillersNews documents NME interview with the Killers


Journalists have covered this topic at length and provided several other examples from history. Take a look at these articles from American Songwriter, Mental Floss, and PopDust to explore further.


Dream songs: Medicine music of indigenous cultures


Secular culture doesn't take interest in dreams about music. These songs have no inherent meaning or purpose in our world. There's no reason to record them or pay any attention. As a result, they tend to vanish quickly after we wake up and we never give them a second thought.


The one exception to this apathetic stance is found among those with a broader interest in dream analysis. Websites like DreamLookup share accounts of people dreaming of music and what a musical dream might mean on a personal or symbolic level. You can find more examples on DreamGlossary or even on public forums like this thread on the Lucid Dreaming SubReddit.


While secular people fumble in the dark trying to make sense of what a dream song could mean, indigenous cultures have been listening and recording them carefully for millennia. Dream melodies are often referred to as medicine songs and they signal rites of passage or personal transformation. A good one might be passed down for generations.


Dream songs of the shipibo

The Shipibo tribes in the Peruvian Amazon have icaros, or "magic songs", treasured by the ayahuasceros and used to heal different emotional and physical ailments. You can watch a live performance of these songs in the video below:



In North America, the Ojibwa tribe hold a similar belief, as outlined in a research paper by professor Lee Irwin at the University of Charleston:


"An animal, often appearing in a dream as a human being wearing apparel indicating a particular creature, gives the dreamer a song or instructions or an implement with explanation for its use.
For the dream to be effective, the dream must be expressed through visible actions, for example, in a healing ceremony by using dream-given implements, which solicit the gift of power in ways that result in actual healing or other dramatic effects."

These stories and beliefs about dreaming of music are a part of each tribe's shared value system.


There's no need to believe in any metaphysical, religious, or spiritual concepts in order to develop a deeper awareness of music in dreams. We don't have to speculate about their meaning or build a narrative about what the songs are, where they come from, or believe in any magic powers that they might confer.


Of course, there's nothing stopping you from exploring those worldviews either. The purpose of this article was simply to examine the definite fact that musicians dream of music, and to explore the impact that machine learning could have on bringing these experiences more clearly into the world over the coming years.

If you find this topic interesting, I suggest checking out our article on musical synesthesia, where we explore other ways in which the subconscious creates unexpected bonds between sound and other sensory inputs like color, taste, and smell.

bottom of page