IIn the winter of 2004, Jonathan Pieslak, a composer and an associate professor of music at City College, was researching a paper on heavy metal when he stumbled on a Web site devoted to the death-metal band Slayer. (Their songs include “The Antichrist,” “Mandatory Suicide,” and one, written from the perspective of a terrorist, called “Jihad”: “Fuck your God erase his name /A lady weeps insane with sorrow.”) On the site, a fan had written that, during the Gulf War, the band received forty per cent of its fan mail from soldiers in the Middle East. The claim turned out to be an exaggeration, but Pieslak became interested. In April, Indiana University Press published his book “Sound Targets: American Soldiers and Music in the Iraq War,” which examines the role of music in military recruiting, combat, interrogations, and morale, and explains many things about Slayer’s appeal.

First of all: listening to heavy metal, with its double-pedal bass drums and tremolo-style guitars, Pieslak writes, is a good way to prepare mentally for a mission, because it “sounds considerably like the consistent discharge of bullets fired from an automatic gun.” Colby Buzzell, an M240 Bravo machine gunner who did a yearlong tour in Iraq, told Pieslak, “I’d listen to Slayer to get all into it.” Once, Buzzell said, a guy on his patrol rigged up his MP3 player to a Humvee, and the patrol blasted theme songs from old movies—a modern-day drum-and-fife brigade. He said, “Sometimes your motivation is down and you’re like, ‘I don’t want to play soldier today.’ . . . But then you hear ‘The Good, the Bad, and the Ugly’ theme song and you’re like, ‘Fuck yeah, hell yeah, I’ll go out on a mission today.’ ” For some in the Fourth Infantry Division, Lil Jon’s “I Don’t Give a Fuck” was an anthem—soldiers called it their “getting crunked” song, and they would chant its refrain until they were ready to leave the base.

At the Borders store in the Time Warner Center on a recent afternoon, Pieslak said that in another unit “Metallica was the group of choice. Then, when they got to Falluja, it switched to ‘Go to Sleep,’ by Eminem: ‘Die, motherfucker, die! / Unh, time’s up, bitch, close ya eyes.’ ” Pieslak, wearing Pumas, a T-shirt, and camouflage cargo shorts (no significance—just “what was clean”), had agreed to poke around the music section. Passing Classic Crooners, New Age, and Jazz (“You’re probably not going to see too many guys over there with George Winston CDs,” he said), he led the way to Rock, where he riffled through the “D”s. Dropkick Murphys. Drowning Pool. “Their song ‘Bodies’ is interesting,” he said, pulling out a CD that featured a woman holding a hand across her face, the word “SINNER” written across her knuckles. “It kept popping up.” Soldiers would use it both to get pumped up for battle and “to induce irritation and frustration among detainees.” (The detainees, apparently, preferred ’N Sync and Michael Jackson.) Pieslak said that a group of soldiers had made a music video in which they set their own footage and photographs to the song. They called it “Taliban Bodies.” A pair of Arkansas National Guardsmen, Pieslak writes, recorded an album in Iraq. One track, with apologies to Jimmy Buffett, was called “Mortaritaville”: “Wasted away again in Baghdad / One weekend a month, yeah, my ass / I’d like to kick my recruiter straight square in the teeth / But I know, ‘It’s my own damn fault.’ ”

Music, Pieslak writes, has always been a part of the military experience, from training cadences (“Soldier, Soldier Have You Heard”) to battle cries (Joshua’s trumpets, “Hakkaa päälle”) and “thunder runs,” in which troops descend in force upon a given area (in Baghdad, one team blasted Wagner, in homage to “Apocalypse Now”). In the book’s fourth chapter, “Music as a Psychological Tactic,” Pieslak examines a “sonic battle” between American troops—who blasted “Welcome to the Jungle,” by Guns N’ Roses, and “Hell’s Bells,” by AC/DC—and Iraqi mullahs, who tried to drown out the metal with chants of “Allahu Akbar” and Arabic music. Standing near the “J”s, he said, “Plato thought that different musical scales could have different effects on the human condition. We tend to have a misconception about music—that it is this thing that delights the senses, elevates the spirit. While I like that idea, it is only part of what music has been.”