Fortunately, by the time Lamar agreed, he found himself in good company. The “Waves” soundtrack is full to bursting with some of the heaviest hitters in music, featuring songs from Kanye West, Radiohead, Frank Ocean and Tame Impala. That’s an impressive collection for any movie, let alone one bankrolled by A24, a specialty film studio with a hip reputation but a penchant for keeping budgets low.

So how did “Waves” woo so many top-tier artists?

“We didn’t allow them to see dollar signs,” said the veteran music supervisor Randall Poster, who worked with Meghan Currier to clear the rights for nearly three dozen songs for the film. “I think everybody knew going into it that we were going to spend a fair amount of money on the music, but what you try to impress upon them is that this is an artistic undertaking with a visionary director, and I think artists largely want to be involved in those kinds of projects.”

Shults had adopted a score-driven approach on his first two films, “It Comes at Night” and the critically acclaimed “Krisha,” but when it came time to write “Waves,” which follows a high-school wrestler (Kelvin Harrison Jr.) and his sister (Taylor Russell) as they navigate love and tragedy, Shults knew he wanted the movie to sound like the kind of Spotify mix his characters would make themselves. When he sent the script to his actors, he even embedded music cues in the file so they could listen to the songs he hoped to add to each scene.

“If you separated all the tracks into a playlist, there’s a narrative, and an arc is being told from track to track that mimics the movie,” Shults explained. “But there’s a fine balance, because if you do it wrong, it can be really on the nose.”

Still, he aimed high. Frank Ocean is one of the most elusive figures in music, but Shults still hoped to secure five of his songs, more than Ocean had ever cleared for a movie. Convincing him took months. “His team said it wasn’t looking good because he was in a creative bubble, and then they asked if I could reduce it to one song,” said the director, who confessed, “I started having a panic attack.”