Think about all of those Hollywood depictions of the American military, from Stripes to Full Metal Jacket to Cadence. In almost every one, a bunch of guys will jog past the camera at some point, singing and stepping in unison.

The first time that happened was in 1944, when a particular rhythm infiltrated the segregated Army. The cadence was credited to a soldier named Willie Duckworth. As told on a V-Disc, one of the inspirational recordings made during World War II by the U.S. military and sent to troops overseas, Duckworth was "chanting to build up the spirits of his weary comrades."

Until just this spring, Bobby Gerhardt served in the Army as a wheeled vehicle mechanic. He says he has spent more than nine years marching to, running to and calling cadence. His favorite to call follows the rhythm of Duckworth's now 70-year-old composition, though with updated lyrics.

"When I joined I had no idea how anything worked. Everything was brand new," Gerhardt says. "For me, hearing that first cadence the very first time was awesome. Because you always wanted to hear what the next verse was. So you always wanted to keep up so that you could hear the person calling the cadence so you knew what to say back to them."

The infectious appeal of cadences is used to motivate and coordinate people who might not have anything else in common. But they also do something more fundamental.

"The main purpose that I was always taught with staying in step and keeping up with the cadence, was that it would help your breathing and help your cardio if you could run and sing and manage your breath at the same time," Gerhardt says.

Cadences get a group of people doing that in unison. They rely on the call-and-response action of work songs, so they come from a long tradition. Richard Rath, an associate professor at the University of Hawaii, and author of the book How Early America Sounded, says slaves brought work songs here, and they developed to help deal with dangerous jobs.

"Like pounding rice in a mortar and pestle, where one person has to scoop the rice out and two other people are pounding with big pestles — if somebody messes up, they get scrunched," Rath says.

But a little deviation, lyrically or rhythmically, can make the cadence more effective. Bobby Gerhardt cites one cadence in particular that appeared in the 1960 Elvis Presley movie G.I. Blues.

"It's kind of off-step. And it's kind of in-between a step, but once you have a group of people marching to that cadence, it puts a big smile on your face because it's a cadence that no one's calling around the rest of the base," he says.

It's not the marchlike one-two of the standard military cadence. It's syncopated — the emphasis is on the offbeat. And that can put a spring in a soldier's step or help a worker move faster. Richard Rath says syncopation and complex rhythms made music more useful to workers than the bosses realized. Say you're rowing a boat on a rice plantation and singing to pace yourself.

"If you're rowing on the twos and the planter says speed up, you speed up the song and then row on the threes," Rath says.

It's resistance through rhythm.

Pvt. Willie Duckworth, raised by his sharecropper grandparents in Jim Crow Georgia, knew something about that. And the concept isn't foreign to Gerhardt.

"I had a couple of 'em that I'd always call, because they kind of pushed the envelope of what we were allowed to call," he says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.