Composer and playwright Lin-Manuel Miranda has written and recorded a new song to help raise money for hurricane recovery efforts in Puerto Rico. Sales of the track, "Almost Like Praying," will go to the Hispanic Federation's Hurricane Relief Fund. It features an all-star cast of Latinx artists, including Jenifer Lopez, Marc Anthony, Gloria Estefan, Fat Joe, Ruben Blades, Luis Fonsi, Rita Moreno and many others.

In a conversation with NPR Music's Felix Contreras, Miranda explains why he chose to sing the song in Spanish, how he assembled the vast cast of contributors and why he borrowed the song's title and instantly recognizable hook from a line in the West Side Story classic, "Maria."

You can hear the song below and the full interview with the play button at the top of the page, and read edited highlights below.

On why he incorporated the song "Maria" from West Side Story into "Almost Like Praying":

"I've got a musical theater brain. Some people have different kinds of brains — math and science — that's what I've got. I was very aware even as it was happening that this was the worst hurricane to hit Puerto Rico in a hundred years, and I knew that "Maria" would forever have a different connotation on the island as a result of that. And that's my favorite song from West Side Story. So I began thinking about that song and the lyrics and a way to flip it into something positive. So really the first call I made before I even started writing the song was to the [Leonard] Bernstein estate and to Stephen Sondheim asking for permission to quote that lyric."

On why he used the names of 78 Puerto Rican towns for the song's lyrics:

"For Puerto Ricans who live all over the world, who have a connection and family on the island there was a terrible silence several days where we were just waiting for word. And my Twitter feed my Facebook feed was just filled with family members listing the names of towns where their families were living. 'And from my grandmothers in Lares, my uncle is in Vega Alta. Has anyone seen them? Has anyone heard from them?' And I thought, well the only lyric that really unites us and that makes the most sense for a fundraising song is if I can somehow write a lyric that includes all 78 towns in Puerto Rico so that no one feels left out and no one's town feels forgotten. There's been a lot of heartbreaking stories coming out of Puerto Rico. But one of the ones that broke my heart was actually not the story but the headline. The headline in The [New York] Times on Sunday was, 'Many Towns In Puerto Rico Feeling Forgotten,' and that broke my heart. But hopefully we raise a lot of money for a lot of aid and a lot of relief for the humanitarian crisis that we're in. But also, hopefully, these towns never feel forgotten again."

On singing "Almost Like Praying" in Spanish:

"I've been following Luis Fonsi's [who wrote and sang 'Despacito'] career since I was in college and he was singing salsa. So it's been just joyful pride to see that song have the success it's had. But it also opens an avenue because there are a lot of people who don't speak Spanish who still love that song and so it also gives you permission in a way. Like, I can write a song where the lyrics are the names of these towns and if the beat is hot and the voices sound great then we're OK and we're still off to the races."

On how he got other famous artists to contribute to the track:

"Honestly I broke my Rolodex and when my Rolodex failed me I consulted Twitter. That's the honest answer. You know, some of these people are old friends: Gilberto Santa Rosa sang at my wedding. You know, Rita Moreno has been a friend for many years. And so you make those calls first. Everybody said 'yes' having not heard the song. They just they felt as helpless as I did and they were trying to do as much good as I'm trying to do and make as much noise as I'm trying to make. And so you know I will never forget I D-M'd Luis Fonzi on Twitter and he just wrote back, 'Bro. Two words. I'm in,' having not heard anything he just was in."

On being frustrated but hopeful with recovery efforts in Puerto Rico:

"I would much rather be writing a song than jumping up and down and making noise. So this is our way of doing that. It's also, I have to say, despite the humanitarian crisis going on on the island, despite the difficulties, despite the slowness of the U.S. government's response, I've never had more faith in people and American people and people all over the world. My Twitter feed is full of kids breaking their piggy banks to donate. People saying we were going to go on vacation, now we're going to use that money and send it to Puerto Rico instead. People taking their weekend to package supplies. It makes me cry to think about it. And if the government's response were commensurate with the people's spirit and compassion we'd be on the road to recovery and ending this crisis so much faster. So it's this weird dichotomy of being frustrated like everybody else and jumping up and down and making noise, but also being incredibly hopeful about the human spirit."

Copyright 2017 NPR. To see more, visit http://www.npr.org/.

LULU GARCIA-NAVARRO, HOST:

Lin-Manuel Miranda was watching Hurricane Maria devastate Puerto Rico and was moved to help. The genius behind the musical "Hamilton," writing songs is Miranda's specialty. The result, a new song called "Almost Like Praying." And Miranda got some famous friends in on the track. Rita Moreno, Ruben Blades, J. Lo, "Despacito's" Luis Fonsi and others lent their voices. All the proceeds from the song go to hurricane relief on the island. As for that title, "Almost Like Praying" - sound familiar? Miranda says he connected Maria the hurricane to the song "Maria" from "West Side Story."

LIN-MANUEL MIRANDA: (Singing) Say it loud, and there's music playing. Say it soft, and it's almost like praying. It's almost praying. It's almost like praying. It's almost like praying.

You know, I was very aware, even as it was happening, that this was the worst hurricane to hit Puerto Rico in a hundred years. That eye just sat on the island for a long time. It's a Category 5 hurricane. And I knew that Maria would forever have a different connotation on the island as a result of that. And that's my favorite song from "West Side Story."

(SOUNDBITE OF SONG, "ALMOST LIKE PRAYING")

RUBEN BLADES, JUAN LUIS GUERRA: (Singing in Spanish).

MIRANDA: (Singing) It's almost like praying.

RUBEN BLADES: (Singing) Puerto Rico.

JENNIFER LOPEZ: (Singing) Puerto Rico. (Singing in Spanish).

MIRANDA: For Puerto Ricans who live all over the world who have a connection and family on the island, there was a terrible silence, several days where we were just waiting for word. And my Twitter feed, my Facebook feed was just filled with family members listing the names of towns where their families were living and from. My grandmother's in Lares. My uncle lives in Hatillo. My uncle is in Vega Alta. Has anyone seen them? Has anyone heard from them? And I thought, well, the only lyric that really unites us and makes the most sense for a fundraising song is if I can somehow write a lyric that includes all 78 towns in Puerto Rico so that no one feels left out. And no one's town feels forgotten.

MIRANDA: You know, some of these people are old friends. Rita Moreno has been a friend for many years. And so you make those calls first. And to a person, everybody said yes having not heard the song. I was recording with Rita Moreno, and she said, is Gloria Estafan on this? And I said, I don't have Gloria Estafan's number. And she whips out her phone. She goes, here's Gloria Estafan's number. And the next day, we're recording Gloria Estafan.

(SOUNDBITE OF SONG, "ALMOST LIKE PRAYING")

BLADES: (Singing) Puerto Rico, Puerto Rico, Puerto Rico.

MIRANDA: I hope it provides catharsis. It certainly provided catharsis for me to write it. And I also hope the names of these towns will never be forgotten. And I hope that people have a catharsis. To quote the kids, they cry in the club, And then we get back to work because we have a lot of work to do.

(SOUNDBITE OF SONG, "ALMOST LIKE PRAYING")

MIRANDA: (Singing) It's almost like praying.

GARCIA-NAVARRO: That's Lin-Manuel Miranda talking about "Almost Like Praying." All proceeds from the purchase and online streaming of the song, go to the Hispanic Federation's relief efforts in Puerto Rico.