So much can be accomplished though movie magic. Men can be made to fly and, through a technological breakthrough known as an “apple box,” Tom Cruise can be made to look almost as tall as his female co-star.

One skill no amount of special effects can help with is an actor’s ability to convincingly play a musical instrument.

This challenge is particularly daunting when your entire movie revolves around playing an instrument — in the case of Friday’s “Whiplash,” the drums. If those scenes don’t look good, the movie runs the risk of being associated with another musical instrument: a gong.

“Whiplash” stars Miles Teller as a jazz student at a competitive New York music conservatory. He longs to play the skins as well as his idol Buddy Rich, but his biggest challenge is coping with his abusive instructor, Terence Fletcher (J.K. Simmons in a performance that’s earning Oscar buzz). Fletcher verbally abuses his students and forces them to play until blood from their hands splashes across the kit.

No blood was spilt to ensure the music scenes were accurate — but it almost was. Compared with other instruments, it’s much more difficult to fake playing the drums. Unlike piano, for example, where an actor’s hands can be hidden from the camera, drumming can’t be cheated. If an actor is out of time, the audience will know. When the actor strikes the cymbal, the audience will know.

Go watch Tara Reid behind the kit in “Josie and the Pussycats” and you’ll immediately understand why the camera never lingers on her for more than a second or two. Reid once reported that her instructor, upon seeing her play for the first time, told her, “This is not going to happen.”

And it’s not just drumming. Watch Tia Carrere pretend to play bass in “Wayne’s World.” Her left hand stays frozen on the neck and her right fingers flick listlessly in the neighborhood of the strings. Lou Diamond Phillips doesn’t do much better as guitar great Ritchie Valens in “La Bamba,” and equally hilarious is Chow Yun-Fat pretending to smoothly blow the clarinet in “Hard Boiled.”

To get the drumming right in “Whiplash,” writer-director Damien Chazelle (himself a drummer) had the novel idea to hire a real musician. Nate Lang, an actor and a member of the New York band the Howlin’ Souls, plays Teller’s rival, Carl.

“Everything has to look correct, especially with jazz drumming, which is a very technical, graceful kind of drumming,” Lang says.

Lang, who worked for years with Chelsea’s Upright Citizens Brigade Theatre, was also tasked with training Teller. Lang has been playing drums since he was a small child and had taken lessons over the years.

Teller taught himself to play drums when he was 15, but favored rock ’n’ roll. Lang’s first job was to change Teller’s grip from what’s called “matched,” in which both hands hold the sticks the same way, to “traditional,” a grip used by jazz drummers in which the left hand holds the stick a bit sideways, almost like a chopstick.

The duo spent about two months working three to four hours a day in an LA rehearsal space. By the end, they began perfecting the songs from the film: “Whiplash” by Hank Levy and Duke Ellington’s “Caravan.”

The work paid off. “I think [the drumming] seemed pretty real,” says Jimmy Macbride, a local jazz drummer and a recent Juilliard grad who watched the trailer. “Usually they’re not really good about that in movies.”

To make the drumming appear real enough to pass with Macbride and other musicians, Lang practiced the songs in the movie to the point where they became second nature.

“I got to the point where if I hear ‘Whiplash,’ I have flashbacks, I’ve played it so much,” Lang says. “I have to get down on my hands and knees for a few seconds.”