Prince always had lofty goals for his memoir.

He wanted it to pay tribute to his parents, teach people to harness creativity, and help end racism.

Unfortunately, the legendary Rock and Roll Hall of Famer died in 2016, only three months into the writing process with co-author Dan Piepenbring, then a 29-year-old Paris Review editor who was a major Prince fan and sometimes drummer. He had never written a book before he was chosen for the project.

Despite Prince’s death, Piepenbring was so moved by the material the “When Doves Cry” star had already written that he wanted to find a way to publish it. The result is The Beautiful Ones (Spiegel & Grau, Oct. 29), a collection that combines Piepenbring’s explanation of how the project came together with Prince’s handwritten thoughts about his parents, previously unpublished photos and handwritten lyrics from the vault in the artist’s Paisley Park home in Minnesota, and his treatment for the movie Purple Rain.

Piepenbring took a break from the media blitz surrounding the book’s release to talk about how and why he pulled it all together.

How does it feel for the book to finally be out?

It’s kind of crazy to see it in bookstores. For the longest time, I was convinced that it would never be released. So to actually be able to hold it in my hands and turn the pages is still kind of a marvelous feeling. I kind of feel superstitious about it sometimes, and I worry if I turn my back on it, it’s gonna disappear. ... There was always an air of impossibility surrounding it, but fortunately Prince had a way of making you feel like you could do impossible things. ... He really had such grand ambitions, but they never seemed outsized. I mean, he’s the man who recorded “Purple Rain,” after all. He’s the man who learned to play 27 instruments, or whatever, when he was still a teenager. So when you’re in his company, you feel like you can do no wrong and these almost outlandish things are suddenly very attainable.

Do you think he chose you to work on this because you felt that way?

Yeah. I think that was a part of it. I know he didn’t want someone who wanted to shove him into a template. Memoirs, especially celebrity memoirs, can feel very formulaic. There’s always a redemption story or some kind of rags to riches archetype. They kind of trade in a few set molds. And he wanted nothing to do with that. He wanted something that would feel completely unusual from the first page to the last and would accomplish more than just relaying some stories from his life.

You spoke to Prince just days before he died. What was going through your mind when you heard of his death?

I was just so crushed, shocked really. Something about the fact that he died at Paisley Park made it especially difficult to register for me. ... I found it hard to understand. Like the words didn’t make sense. And to hear about it on a commuter train in Connecticut made it all the worse. ... Everything about it felt wrong.

I can imagine. How long did it take before you started working on the book again?

It was just a matter of months, fortunately. ... He had entrusted me with some of the memoir pages he’d written. So I had them in my possession and I remember just reading them over and over again, trying to figure out if they would ever come to light. It seemed to me like I had to find a way to get them out into the world. But, of course, publishing them on their own as a kind of pamphlet wouldn’t be very Prince-ly. He was not a man of pamphlets. So it was incumbent on us to find some way to frame these pages.

[Editor] Chris Jackson, [publisher] Julie Grau, [agent] Dan Kirschen, and I—the four of us … were just going through Paisley Park room by room, literally treading lightly. I think we were almost on tiptoes as we would cross various thresholds. To our delight and immense relief, we found that Prince really saved so much, that he was kind of a conscious documentarian of his own life and legacy. So we were able to find things that really resonated with everything we talked about with him. And slowly but surely we could start to sequence a book.

Is there something specific you cut that you still wish made it in?

There were a few pages of jokes that he had written for Purple Rain in his notebook ... The one I remember most clearly is a bit of dialogue that’s like: He’s so old, his Social Security Number is 3.

Glenn Gamboa is a freelance writer in Brooklyn.