Miles Davis changed the face of jazz several times, and his influence wound up extending far beyond that  genre. Don Cheadle didn’t just make Davis the subject of his first film; he portrays Davis (in the ‘50s and ‘70s) and co-wrote the script. Music biopics tend to lead to extremely dreary films. Even “Straight Outta Compton,” a depiction of a group best known for their song “Fuck the Police,” managed to sanitize N.W.A.’s misogyny and offer up a #BlackLivesMatter version of the group. Cheadle’s “Miles Ahead” isn’t a conventional biopic. It spirals around in time. One suspects Cheadle has seen some Alain Resnais and Nicolas Roeg films, if not Hou Hsiao-hsien’s “The Puppetmaster.” As an actor and director, he brings his A-game. As a writer, he proves sadly lacking.

Cheadle manages to be fully convincing as both the young and spry ‘50s Davis and the burnt-out and pained ‘70s Davis. The film is set towards the end of Davis’ five-year retirement from music, when his addiction to cocaine and hip pain sidelined him. The young Davis is depicted in flashbacks and reverie. The middle-aged Davis sees the cover of his album “Someday My Prince Will Come” in an elevator and suddenly imagines himself back in the ‘50s. His whispery voice remains a constant. The film suggests that an attack by two cops outside a jazz club is the turning point that made Davis into the bitter middle-aged man who beats his wife and dominates the film. In the ‘70s, many purist jazz critics – funny how they tended to be white men – saw Davis’ electric music as a betrayal of albums like “Kind of Blue” and “Sketches of Spain.” In a subtle way, Cheadle makes the point that Davis’ vision remained constant over a 25-year period.

One of the pleasures of “Miles Ahead” is that it contains wall-to-wall Davis music, spanning his entire career through 1975. It doesn’t fool around. Indeed, it opens with the screaming electric guitars of his penultimate pre-retirement album “Agharta” and uses quite a bit of Davis’ ‘70s music as well. His first full dip into abrasive jazz-rock fusion, “Bitches Brew,” was a hit, eventually going gold. The young rock audience that embraced it quickly abandoned Davis, although his sidemen formed more popular groups like the Mahavishnu Orchestra, Weather Report and Return to Forever. Fusion offered the possibility of combining the technical complexity of jazz with the playfulness and accessibility of psychedelic rock, but most of its promising groups succumbed to prog-rock wankiness or smooth-jazz bland-out within a few years. Davis himself didn’t. His entire ‘70s work still sounds fresh. The DNA of hip-hop groups like A Tribe Called Quest and the Roots, as well as post-punk landmarks like the Talking Heads’ “Remain In Light” and Public Image Ltd.’s “Metal Box” can be found there. In fact, I’m sure there are  forms of music yet to be invented which have their roots in Davis albums like “On the Corner” and “Get Up With It.”

However, back in the ‘70s, jazz critics called “On the Corner” one of Davis’ worst albums and called for him to make another “Kind of Blue.” They didn’t seem to understand that he was as mercurial a figure as rockers like David Bowie or Bob Dylan. (Early in “Miles Ahead,” Davis calls up a college radio station playing “Kind of Blue” and disses the album.) Decades before N.W.A., he titled the first song on his best-selling album “So What” and played with his back to the audience.

It’s great that “Miles Ahead” recognizes the brilliance of Davis ‘70s work. Unfortunately, it succumbs to the demands of the marketplace in a particularly bland way. In interviews, Cheadle has acknowledged that he needed a major  role for a white actor in order to get European distribution. Thus, Dave enters the picture. It would be one thing if he were a fully fleshed-out, three-dimensional character, but all we really learn about him is that he owes his ex-wife alimony. There’s something potentially subversive about the way Davis treats him  like a servant, using him as a chauffeur and getting him to score drugs, but their relationship fits a very familiar “48 Hours”-cum-“Pulp Fiction” interracial buddy narrative.

In fact, the caper story represents a lost opportunity to give the biopic a jolt. While it’s largely invented, Davis really was in a very crazed headspace during his “retirement”, a slave to his addictions and his hip pain. Cheadle has pointed out anecdotes like a story about Davis “robbing” a corner deli at gunpoint with his manager and then giving all the money back as justification for the scenes of Davis and Dave driving around New York in search of his stolen tape. The problem is that they never feel real. The scenes of the middle-aged Davis sitting around his apartment, serving up attitude to Dave or just cringing in pain and waiting for his muse to return, have a believability that eludes the rest of the film. As a crime film, “Miles Ahead” resembles a mid-‘90s Tarantino imitation.

“Miles Ahead” ends in triumph: Cheadle playing a concert with great jazz musicians like Wayne Shorter and Herbie Hancock, who really are veterans of Davis’ bands. But as talented as the individual musicians are, the music they play sounds like a pale imitation of Davis’ ‘70s work. Davis eventually got back to work, but his ‘80s music is a comeback only in commercial terms. He finally engaged in the trend-hopping of which his earlier critics had accused him. It’s not totally without merit, particularly the 1981 tour that produced the live album “We Want Miles.” (According to Wikipedia, Cheadle saw Davis on that tour.) But the discipline and – most importantly – fire of an album like “Agharta” was gone, replaced by Cyndi Lauper covers. Acknowledging the compromises Davis made seems to be beyond Cheadle’s vision of his greatness, unfortunately.