With musical biopics, so often the most crucial element — the music — becomes a solo act, accompanied by little to nothing in the way of strong visual corollaries to that music. You get the outline of a tormented genius’ life, and a misguided, reverential sense of respect, but no cinema.

Don Cheadle’s “Miles Ahead,” in which the first-time director also stars as jazz great Miles Davis, is a disarming exception. It’s squirrelly and exuberant, and it moves. The script, co-written by Cheadle and Steven Baigelman, takes 1979 as its jumping-off point. Davis is in a creative funk with a bad hip and one too many drugs — medicinal and recreational — in his system.

advertisement | advertise on newsday

Into this funk comes a hungry music journalist eager to tell Davis’ story, or chronicle his downward spiral from close range. The self-described Rolling Stone contributor, a fictional person, is played by Ewan McGregor, opposite Cheadle’s wary, terrifically detailed portrait of the trumpet player in crisis. They score cocaine, meet with record company executives and scramble to recover a stolen demo tape of Davis’ most recent music. It should be said, a lot of this is made up, even more than usual for a musical biopic.

The movie dives in and out of the past, by way of some elegant, arresting transitions; in one scene, Polaroid photos taken of Davis and a sometime girlfriend in bed blur into a montage of Davis’ wedding photographs from years earlier. The temperamental jazz legend strong-arms his first wife (Emayatzy Corinealdi) into quitting her stage career. Though the movie downplays the worst of his spousal abuse, and the thuggish side of a violently modal personality, the film’s time skips are handled with notable skill.

Cheadle the actor never once tries to make us “feel” for Davis’ predicament, or explain every aspect of his bad behavior, any more than it tries to explain his musicianship. The star of “Miles Ahead” is too busy, too invested, in imagining the dramatic and blackly comic possibilities in what the 1979 Davis might have been like, behind closed doors, waiting for something to bring back the muse.