Andre D. Wagner / Universal Pictures

It happens in a matter of seconds: A white cop points his gun and fires. The bullet grazes a young black woman’s leg, and her partner turns to the officer in shock. Amid the confusion, the gun changes hands, and a familiar script is upended as the uniformed man falls to the pavement. So begins the dramatic arc of Queen & Slim, the first feature film from the director Melina Matsoukas.

The movie follows a black couple whose prosaic Tinder date turns deadly when they’re pulled over by a racist police officer. Under normal circumstances, the pair would never have seen each other again. But the encounter forces them to go on the lam together, and their second “date” a few days later is among the film’s most affecting sequences. After the duo leave New Orleans en route to Cuba, Slim (played by Daniel Kaluuya) spots a roadside club, pulls over, and begs Queen (Jodie Turner-Smith) to dance with him. Both understand that taking time away from their planned escape could be fatal. But Queen relents, and the couple dance under dim blue lighting while jazzy tunes play and black patrons smile at them. Their attraction to each other builds with the music; Turner-Smith’s reluctant Queen loosens up, and Kaluuya’s anxious Slim briefly lets himself live in the moment.

The dreamlike scene is shaped by Queen & Slim’s most evocative element: its music. Where the film is often bogged down by heavy-handed references to real-life police violence and other serious themes, the music floats. As Queen and Slim dance in the bar, the soundtrack conveys the urgency of their union with more grace than the clumsy dialogue deployed elsewhere in the movie. Music is woven throughout with an impressive ear for black American artists’ complex relationships to the country they inhabit, and to other black people. The lush score was composed by Dev Hynes, who also contributed a song to the soundtrack under his recording name, Blood Orange. Written by Lena Waithe, Queen & Slim is an ambitious work that emphasizes both the quotidian beauty and lurking danger in its central couple’s circumstances. While the film’s attachment to its own message threatens to overtake its subtle successes, that excess is absent from Queen & Slim: The Soundtrack, a compilation of 16 tracks, most tailor-made for the project. Layered and compact, it’s far more propulsive and moving than the movie it’s tied to.

Matsoukas, who executive produced Queen & Slim: The Soundtrack along with Waithe and the Motown Records president, Ethiopia Habtemariam, has an extensive background in directing music videos. For more than a decade, Matsoukas has honed her craft working on Beyoncé’s “Formation,” Rihanna’s “We Found Love,” and Whitney Houston’s “I Look to You,” among others. It’s not surprising, then, that the music of Queen & Slim spans genres and generations while still feeling cohesive. The album begins with a bang: The new industry heavyweight Megan Thee Stallion lends her bravado and lyrical acumen to “Ride or Die,” the infectious VickeeLo-assisted opener. It’s one of the most defiant songs on the project, delivering more on Queen & Slim’s promise of a modern black Bonnie-and-Clyde story than the film itself does.

A few other tracks on Queen & Slim have more narrative power than the movie. Most notable is “Getting Late,” an impossibly seductive new number by the Internet musician Syd, whose syrupy vocals describe a slow-building romance: “Didn’t know it then / Who woulda thought we’d ever fall in love / Like that, that.” The song is more sultry than the movie’s only sex scene, which squanders the emotional connection that Queen and Slim have nurtured over the course of their escape. Kaluuya and Turner-Smith play the intimate moment with passion, but Matsoukas makes the jarring choice to splice in footage of an anti-police-violence protest happening elsewhere at the same time. As a result, the couple’s singular love scene is anxiety-inducing rather than sensual. And perhaps that’s the point—but the film’s visuals and scenes of connection suffer when they’re juxtaposed with gratuitous depictions of violence.

Sometimes the songs that appear in the film are enough to elevate the story momentarily. A track from Matsoukas’s longtime collaborator Solange is an affirmation of Queen and Slim and the southern landscape they drive through. Despite the hostile circumstances the duo face, “Almeda” (from Solange’s atmospheric March album, When I Get Home) is perfect road-trip music, its chorus a reminder that “black faith still can’t be washed away / Not even in that Florida water.” The song is joined by another Houston bop: the Mike Jones, Paul Wall, and Slim Thug classic “Still Tippin’,” which also appears on the soundtrack and serves as a trenchant acknowledgment of the central characters’ resistance.

The record relays a tremendous sense of loss too, with a sequence of songs that culminates in a mournful ballad by the ethereal singer Moses Sumney. “Am I vital / If my heart is idle? / Am I doomed?” Sumney asks on its elegiac chorus. “Cradle me / So I can see / If I’m doomed.” Though it wasn’t made explicitly for the soundtrack, “Doomed” captures the inevitability of the characters’ demise with haunting precision. The reclusive Lauryn Hill ponders the afterlife on her own contribution, the singer’s first solo track in five years. On “Guarding the Gates,” Hill stretches her famed vocals to gospel-like effect: It’s not a perfect return to the Miseducation days, but the song still feels like a natural progression for the artist.

Some of the soundtrack’s best new offerings come from younger musicians. “Collide,” a collaboration between the British soul singer Tiana Major9 and the Atlanta hip-hop duo EarthGang, is a smooth love song about sacrifice and longing. The Atlanta rapper Lil Baby offers a reflection that’s more meditative than his usual repertoire; on “Catch the Sun,” he waxes poetic about romance, fatherhood, and his upbringing. On “Yo Love,” the Long Beach rapper Vince Staples shows off his soft side when paired with the Atlanta singer 6lack and the North Carolina–bred Mereba. Taken together, this trio of songs in particular reinterpret the film’s conclusion: They sketch out a vision of a world in which Queen and Slim might’ve had a chance to grow alongside each other, in a rendering that’s more delicate and illuminating than the movie as a whole.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.