When we meet jazz icon Miles Davis in “Miles Ahead,” he is a nocturnal creature adrift between perception and reality. Volatile, suspicious, in hiding from the world for half a decade, he is thirsty for respect and to regain the title of world’s greatest trumpet player.

He is also an addict, impatient for the drugs he needs to be delivered. Don Cheadle plays the genius as a man who could improvise a unique sound because he sensed notes we don’t expect from music. Cheadle also directed, produced and co-wrote the film, taking us through the late 1970s when the music industry lost Davis, years before his comeback.

Even at the point where he was not creating new material, Davis was a fascinating character. Cheadle, a chameleon-like actor, goes beyond capturing the legend’s hushed, raspy voice, precise trumpet fingering, violent temper and showoff wardrobe. He digs in deep, giving us a genius we must respect despite his often despicable behavior. It is a portrait of the artist as a jazz-rock Howard Hughes.

The film is lightly plotted. It brings Davis to us through the perspective of Dave Brill (Ewan McGregor in comical loser mode), a fictional Rolling Stone reporter digging into an exposé about Davis’ disappearance and imminent comeback. He no sooner wheedles his way into the star’s Manhattan hideaway than Davis transforms him into a partner in a crime spree. Their whacked-out binge ranges from white-collar Ponzi schemes (collecting his huge retainer from Columbia Records without doing any work) to gangster-style raids into boxing matches and small music clubs.

The narrative adds in a caper story as the pair try to recover a stolen reel-to-reel tape that is the sole recording of Davis in years, being held hostage by a scumbag producer (Michael Stuhlbarg). It is at its most traditional when the lead’s thoughts drift back to his tempestuous romance with his ex-wife and lost muse, ballerina Frances Taylor (played by a very-believable Emayatzy Corinealdi).

Cheadle doesn’t follow the commonplace technique of tracking a music star on a rise to fame year by year. He follows Davis’ shifting memory, lost lovers, new risks, near-suicidal battles to get better contracts and better drugs. The character is funny and awful in well-written and filmed ways. Cheadle carries us from fantasy to flashback to documented reality. While the film’s thrilling public fights, gunfire and car chases didn’t happen exactly in this way or this order, they certainly happened.

Cheadle is wise to avoid the Wikipedia approach of most biopics. A man this complicated deserves a life story less simple. Cheadle asks us to listen for the hidden notes and undertones within the melancholy story. Jazz evolved until the restlessly inventive Davis ceased advancing it, and Cheadle pushes his exciting film forward the same way. To the very last sequence, a dreamlike performance between Davis and several contemporary jazz giants, it is impressive.