The Hamilton star reveals why he incorporated David Bowie and a hint of The Little Mermaid in his new music for Disney's Moana

If you listen closely to one of Lin-Manuel Miranda‘s original songs in Disney’s new animated film Moana, you’ll hear a tribute to both David Bowie and The Little Mermaid.

That song is “Shiny,” written by Miranda and performed by Flight of the Conchords star Jermaine Clement. In the film, Clement plays a villainous crab named Tamatoa, who’s keen on preventing protagonists Moana (Auli’i Cravalho) and Maui (Dwayne Johnson) from obtaining a key piece of equipment for their quest to save Moana’s people. “Shiny” is Tamatoa’s explanation, in song form, about why he refuses to give the heroes the tool they need.

Get push notifications with news, features and more.

Miranda explains to PEOPLE how the Bowie-infused song, with a hint of Mermaid‘s “Poor Unfortunate Souls,” came to be.

“As soon as they said Jermaine Clement I got really excited,” the Hamilton star says of finding out Clement would be playing the villain. “I knew about Flight of the Concords before anybody. My hip-hop group Freestyle Love Supreme opened for Flight of the Concords at the Aspen Comedy Festival in 2004. I’ve known of Jermaine’s gifts even before the TV show. Their Bowie tribute, which they did back at the Aspen Comedy Festival was so brilliant, I said ‘Oh, I’m writing that.’ The world had already been mourning Bowie, I’d been listening to Bowie on a loop. I was like, well I’m writing a glam rock tune for this crab, this jewel-encrusted crab.”

For the rest of the soundtrack, which Miranda co-wrote with composer Mark Mancina and Samoan artist Opetaia Foa’i, Miranda says he relied on the creative team behind the film to help get him into the headspace of all the South Pacific-dwelling characters and to write music for them.

“The creative team, it was so important to them that this film reflect the values and the culture and the specificity of what it feels like in that part of the world,” says Miranda. “What it feels like on the water and that extended to the musical contributions. Opetaia led the charge and I think we took the lead from him in terms of the rhythms and tempos and harmonies that really make it sound like it’s from that part of the world and then you build from there and that’s the fun.”

One exception was the song “How Far I’ll Go,” which is 16-year-old Moana’s angsty, “I’m independent” song.

“I wrote the lyrics to ‘How Far I’ll Go’ in my childhood bedroom,” Miranda reveals. “I’ve done that a couple of times before. If I’m writing a teenage character and I need to connect with that angsty part of myself that feels like the future is forever away and everything is life or death, I can just go and lock myself in my childhood bedroom. My parents live a few blocks from where I live. That’s how I wrote ‘How Far I’ll Go.'”