“Miles Ahead,” an ambitious, experimental biopic about jazz legend Miles Davis, actually states its mission twice over the course of the movie.

Basically: “If you’re going to tell a story, come with some attitude. Don’t make it all corny.”

The person saying it is Miles Davis, played by Don Cheadle, who also co-wrote and directed.

In the context of the film, he’s speaking to a fictional music writer named Dave Braden (Ewan McGregor), who has conned, charmed and strong-armed his way into Miles’ orbit for a few days in hopes of writing a comeback story that would end the eccentric musician’s half decade of dormancy.

While a little on the nose to be repeated, it’s a good line, and an even better goal in the murky and generally unrewarding territory of the dreaded biopic — especially for someone as elusive, multifaceted and just downright giant as Miles Davis was.

As Cheadle’s Miles cheekily says to Dave in that whispered rasp, “I was born, I moved to New York, met some cats, made some music, did some dope, made some more music, then you showed up at my house.”

Knowing well how a tell-it-all approach can be duller than a Wikipedia page, Cheadle eschews the cradle to grave approach and instead focuses in on two moments — a crazy few days in Davis’ “Howard Hughes of jazz” phase and much earlier during the romantic beginnings and fraught endings of his relationship with the dancer Frances Taylor (Emayatzy Corin­ealdi).

The story jumps from the past to the present very suddenly, employing an interesting visual technique that links the two moments in time through a character, let’s say, falling in the present and another continuing the motion in the past. It’s a unique take on the fluidity and imprecision of memory, but, more precisely it’s indicative of Cheadle’s ambitions to make the film feel as unpredictable and freestyle as Miles’ jazz.

Cheadle as an actor is not afraid to show Miles Davis for all his contradictions — his genius, his charm, his ego and his mania. His bold, studied and fully lived-in portrayal has attitude to spare too.

The “present” part shows a hyper-active Davis, hopped up on painkillers and hobbling with a deteriorating hip trying to collect a payment from the record company that he’s long since stopped producing for. It’s sort of a kitchen sink approach to the escalating events story that takes Dave and Miles everywhere from a college dorm room to score some cocaine to a high-speed shoot out. It’s particularly odd then that this portion is duller than the more traditional portrait of the past.

That section plays more like a languid, melancholy ballad as we peer into his courtship of Frances and the insanity, danger and obsessiveness that drove her away. Cheadle and Corinealdi’s palpable chemistry is an undeniable force here, and is a striking contrast to the occasional awkwardness of many of Cheadle and McGregor’s interactions in the present. In theory, it’s probably meant to be another evocation of jazz stylings, but in execution, it feels more like dead air.

Cheadle has an interesting vision here and his ambitions pay off on a number of levels — especially in his performance — but it doesn’t really come together as a coherent composition. Unlike in jazz, the disparate moments, sounds and styles struggle to coalesce in service of a whole that’s bigger than its parts.

“Miles Ahead,” a Sony Pictures Classic release, is rated R by the Motion Picture Association of America for “strong language throughout, drug use, some sexuality/nudity and brief violence.” Running time: 100 minutes. Two and a half stars out of four.