In one of the multitude of gripping scenes in “Whiplash,” Andrew Neyman (Miles Teller) propels himself to the point of a mental and physical breakdown as he furiously and repetitively practices a drum piece.

His knuckles and the crease between his thumb and forefinger drip blood on the cymbals as his skin cracks from the force of his movements, driven by frustration and desire for perfection.

The young jazz musician, a student at a fictional New York conservatory — modeled on Juilliard — always envisioned a future as a Buddy Rich-level drummer. But the fearsome tutelage of the school’s jazz ensemble instructor Terence Fletcher (a simmering J.K. Simmons) has twisted Andrew’s ambitions into a dangerous psychological game.

Writer-director Damien Chazelle drew from a similar — if not quite as dramatic — scenario from his time as a drummer in his competitive high school band in New Jersey and in 2011 began work on a short film that he brought to Sundance in 2013.

The hearty reception to the then-18-minute short — also starring Simmons but not Teller — led to $3.2 million in financing from Bold Films for Chazelle to expand “Whiplash” into a full feature.

The film received the top audience and grand jury awards at Sundance earlier this year. It opens wide Oct. 31.

Chazelle, at only 29, has managed to not only craft a movie that makes music the anchor of a tense, gripping thriller, but coaxed award-worthy performances from eternal character actor Simmons and “Divergent” star Teller.

Fellow director Jason Reitman — an executive producer of “Whiplash” — suggested Simmons to Chazelle, who was “kind of at a loss” about whom to cast as the manipulative Fletcher.

“It was one of those ideas I immediately loved,” Chazelle said. “After many years of doing gentler roles, it was time to take J.K. back to ‘Oz’ territory.”

Simmons, with his wonderfully elastic face, starred as a neo-Nazi inmate in the HBO prison drama, but most recently has been seen in the canceled sitcom “Growing Up Fisher” and Farmers Insurance spots.

Teller, meanwhile, was always on Chazelle’s mind, even before the director realized that the budding star knew how to play drums.

“It was one of those lucky things I learned late in the process. I just figured we’d have to teach him,” Chazelle said.

But, while Teller had chops as a rock drummer, he practiced hours a day for three intense weeks to master jazz drumming (the style is instantly noticeable in the opening scene by the way Teller grips his sticks).

Although Teller didn’t have to learn to read music for the film, he “learned stuff in weeks that it took me years to learn,” Chazelle said with a laugh.

Casting calls for local musicians for the on-screen ensemble were posted at area music schools, so Teller’s Andrew was surrounded by actual players.

Chazelle said he had many conversations with musicians about the levels of mental abuse that is often attached to such intense musical competition.

“This behavior, like Fletcher’s, is more prevalent than we think, but the schools turn a blind eye when they get results,” Chazelle said. “That kind of cruelty and bullying, it’s a big part of the jazz tradition.”

While the movie provides some emotional whiplash, it takes its title from the complicated 1973 jazz piece from composer Hank Levy.

“It was the first song the band was playing my first day of practice, and I remembered seeing the chart and not being able to make heads or tails of it,” Chazelle said, reminding that Levy’s penchant for tricky time signatures makes the song sound as if it’s 4/4 time, but it’s in 7/8 and then 14/8.

“It’s just a weird kind of piece and I remember that feeling of being scared of that song, so it seemed apropos,” he said.

The other primary piece played in the film is Duke Ellington’s “Caravan,” a standard from 1937 that “was definitely more fun to play,” Chazelle said.

But Chazelle, who is working with Teller on his next project, a musical with original songs, has mostly put his own drumming days in the rearview mirror.

“I’m not as good as I used to be,” he said by way of reasoning, “and the neighbors appreciate it.”