It doesn’t seem fair that some musicians can become so well versed in their craft that they can actually tap into their own subconscious to dream up parts—or the entirety—of a new song to add to their already impressive catalogs. But here are 15 examples of famous musicians who did just that.

1. THE BEATLES // "YESTERDAY" (1965)

Paul McCartney awoke one night, went from his bed to a nearby piano, and played one of the most covered songs in music history for the very first time anywhere. He spent months asking people if they had heard the tune before, believing that he must have unconsciously plagiarized the tune from someone. Once he determined that he had indeed come up with it on his own, he started to work on the lyrics.

2. THE ROLLING STONES // "(I CAN’T GET NO) SATISFACTION" (1965)

Keith Richards came up with the legendary riff and the words “I can’t get no satisfaction” after waking up in the middle of the night and recording it onto a cassette tape (before falling back to sleep). The band was worried that the hook sounded too similar to “Dancing in the Street,” but went ahead and recorded it in a studio anyway.

3. THE JIMI HENDRIX EXPERIENCE // "PURPLE HAZE" (1967)

Hendrix once told an interviewer that "Purple Haze" was based on a dream of his in which he walked under the sea before a purple haze surrounded him. In another interview, he said the song came to him in a dream after reading a sci-fi novel, believed to be Philip José Farmer’s book Night of Light.

4. THE BEATLES // "LET IT BE" (1970)

Paul McCartney’s mother, Mary, died when he was just 14 years old. As The Beatles were on the verge of breaking up, Paul had a dream “between deep sleep and insomnia” about Mary, who reassuringly told him to “let it be.” The next day he started writing the song on his piano.

5. JOHN LENNON // "#9 DREAM" (1974)

McCartney wasn’t the only Beatle to turn dreams into music (though he was the only one to do it while the band was still together). After hearing "Ah! böwakawa poussé, poussé” in a dream, John Lennon turned the gibberish into the chorus for this solo tune, which peaked at #9 on the Billboard Hot 100 Chart.

6. QUEEN // "THE PROPHET’S SONG" (1975)

The lyrics to this eight-plus-minute number came from guitarist Brian May’s fever dreams while dealing with hepatitis (from a tainted needle). It’s the longest song with lyrics that Queen ever recorded.

7. RUSH // "LA VILLA STRANGIATO" (1978)

The 12-part instrumental came from guitarist Alex Lifeson’s nightmares. Lifeson was known for his vivid bad dreams while the band was on tour, and would wake up his bandmates describing them.

8. THE POLICE // "EVERY BREATH YOU TAKE" (1983)

Sting woke up in the middle of the night with the line "Every breath you take, I’ll be watching you" in his head. He went to his piano and wrote the song in 30 minutes.

9. TODD RUNDGREN // "BANG THE DRUM ALL DAY" (1983)

Rundgren claimed that most of this song, including the entire chorus, came to him in a dream. He hurried to his recording studio to record everything he remembered hearing.

10. ELVIS COSTELLO & THE ATTRACTIONS // "HONEY, ARE YOU STRAIGHT OR ARE YOU BLIND?" (1986)

After dreaming up the song, Costello recorded it on a cassette player in his kitchen. Since there was no guitar around for the demo, he slapped the counter to accompany his voice.

11. R.E.M. // "IT’S THE END OF THE WORLD AS WE KNOW IT (AND I FEEL FINE)" (1987)

The lyrics came from a dream Michael Stipe had where he was at a party similar to one he had attended when he was 19 years old in New York City. In the dream party, all of the attendees had the initials L.B. (Lester Bangs, Lenny Bruce, Leonard Bernstein), and like in real life, the only food was cheesecake and jelly beans.

12. BILLY JOEL // "THE RIVER OF DREAMS" (1993)

Joel woke up one day singing what would become the title track to his 1993 album, and it “wouldn’t go away.” He took it as a sign that he should work on it.

13. JOHNNY CASH // "THE MAN COMES AROUND" (2002)

Cash had a dream that he met with Queen Elizabeth, who told him he was like a thorn bush caught in a whirlwind. When he read something similar in the Book of Revelation years later, he was inspired to write a song about it. The idea to use mariachi horns in “Ring of Fire” also came to the musician while he was sleeping.

14. THE KILLERS // “ENTERLUDE” (2006)

Brandon Flowers dreamed of Kurt Cobain singing on a floating ship. He sounded like Bob Dylan, and the melody he was singing became the melody to “Enterlude.”

15. FLORENCE AND THE MACHINE // "IF ONLY FOR A NIGHT" (2011)

While sleeping in a camper van in Germany, Florence Welch was visited by her deceased grandmother in a dream. The singer remembered holding onto her grandmother’s legs and crying as she gave her life advice, then translated the experience into song.