Composer Benjamin Wallfisch has a vast amount of experience scoring films, from “Hidden Figures” and “Blade Runner 2049” to “It” and “The Invisible Man.” Yet nothing had quite prepared him to score “Thirteen Lives,” the true story of the rescue of a dozen boys and their coach from a flooded cave in northern Thailand in 2018.

“It turned out to be one of the hardest scores I’ve ever worked on,” Wallfisch says. “Everything you thought might work, just didn’t work.” Plus, COVID restrictions prevented him from traveling to Thailand to research the music. So he flew instead to London and worked closely with director Ron Howard for more than three months to come up with the unusual soundscape for the film.

Howard hired Wallfisch, in part, on the recommendation of Hans Zimmer (with whom the director had done nine films including “The DaVinci Code” and “Rush”). “I felt like music could help with defining the culture,” Howard says. “I knew that we didn’t want it to be traditionally bombastic action music. I wanted to make sure the movie was chilling, suspenseful and scary, but it also needed to be subtle and cool and interesting.”

Says Wallfisch: “The music really had to be something completely fresh. It’s a story of unimaginable heroism, but I couldn’t write heroic music, and we didn’t want to have any of the tropes of a suspense and tension score. Everything had to be very carefully considered.”

He was taken with the idea that the Tham Luang caves were in a mountain range named after Princess Nang Non, and that the silhouette of the mountains looked like a sleeping woman. The locals believed that the princess was angry and the rain that flooded the caves, trapping the young people, were her tears.

The composer began by contacting Thai musicologist and vocalist Natt Buntita, who discovered a traditional song (“Soh Long Nan”) from the Chiang Rai province where the Tham Luang caves are located. “It’s hundreds of years old,” Wallfisch notes, “about the flow of a river being similar to the flow of life, always going in one direction.”

Wallfisch added “little echoes” of that song “just to connect us to this idea of the mountain having a voice.” Buntita sings it under the end titles.

In addition, the composer managed to arrange for three other Thai soloists to perform and improvise in a Bangkok studio on traditional instruments: the two-stringed saw duang, the national instrument of Thailand; the khlui, a bamboo flute; the phin, a lute; and the khaen, a mouth organ.

“I was very concerned about overly sentimentalizing the film,” Howard says. “I didn’t want it to be cloying or manipulative in any way. I wanted an urgent sense of a kinetic drive, a little chaotic.”

So, Wallfisch determined, “the score had to be quite experimental. So much of the movie happens underwater. So what would it sound like to have these Thai instruments and voices warped, slowed down, reversed, and made to sound in a kind of underwater texture?”

In addition, he acquired oxygen canisters, scraped them, tapped them and sampled the sounds of air escaping the valves. “All of these things were incorporated into the rhythmic parts of the score,” he says. Adds Howard: “The more abstract, the more unsettling it was for us, almost like an artifact of the cave.”

Another element of the story that intrigued Wallfisch was the presence of two British divers, Richard Stanton and John Volanthen (played by Viggo Mortensen and Colin Farrell), whose daring and creative thinking helped save the boys. So he incorporated English piano and cello soloists, along with the strings of the Chamber Orchestra of London, which provide the most traditional sounds in the score.

Wallfisch says he “tried to capture the spirituality of the people. There is something incredibly beautiful about the place, a serenity and a reflective feeling.” Says Howard: “It was a process of discovery. Ben’s creative endurance was remarkable.”