Photo: Justin Stephens

High in the Hollywood Hills, in a cramped home music studio stuffed with a dozen keyboards, a rack of electric guitars, a messy pile of pedals and power cords, a tambourine, and a cowbell, Dr. Luke is trying to get inside your head. He knows how to get in there. He’s been in there before. He might even be in there right now.

Dr. Luke—born Lukasz Gottwald in 1973 in Providence, Rhode Island—is the music producer responsible, in whole or in part, for the following chart-topping songs: “Since U Been Gone,” by Kelly Clarkson (2004); “Girlfriend,” by Avril Lavigne (2007); “Right Round,” by Flo Rida (2009); “Tik Tok,” by Kesha (2009); and “I Kissed a Girl,” by Katy Perry. That last song, by most counts, was the unofficial 2008 Song of the Summer—a title conferred by a loose consensus of critics, bloggers, radio D.J.’s, and teens with very loud car stereos. This year’s Song of the Summer battle is shaping up as a bout between “Your Love Is My Drug,” from Kesha, a 23-year-old party girl who spells her name with a dollar sign (Ke$ha), and “California Gurls,” the new single from Katy Perry, a former gospel singer who’s now a kind of candy-coated cross between Betty Boop and Kesha. “California Gurls” itself is a diabolically confectionary ode to sunshine, melting Popsicles, Sex on the Beach, and Daisy Duke shorts, and it recently ascended to the top of the Billboard Hot 100 and the iTunes best-seller list. Both of these summer-song contenders, by the way, are also produced by Dr. Luke.

In short, if a recent radio hit was catchy, bubbly, infectious, maddeningly unavoidable, and featured an invocation to raise or wave your hands in the air, there is a very good chance that Dr. Luke was involved in its creation. In an age when our musical tastes are famously fractured and our listening habits supposedly unfathomable, Dr. Luke produces pop songs that millions of people embrace and that no one can escape. He does this partly by turning out earworm hooks and rocking beats, like any successful producer. But he also does this by sitting in his studio, listening. He’s a prodigious, even unparalleled, listener. And what he’s hearing these days—again and again—are tomorrow’s No. 1 hits.

The summer song, that unabashed blast of aural bubblegum delivered straight to the pleasure center of your brain, may be the last bastion of our collective musical experience. Even if you didn’t run out and buy “I Kissed a Girl” on iTunes or download it as a ringtone to your cell phone two years ago, I can’t imagine you didn’t hear it somewhere, constantly, whether on the radio, or at the gym, or leaking from your kids’ bedroom or from the earbuds of the guy next to you on the subway. Whether you love these songs or hate them, the very fact that we strive to coronate a Song of the Summer reflects a persistent desire to share one last listening experience—to still bob our heads, or wave our hands, or even turn up our noses, in unison. Neal Medlyn, a New York performance artist, hosts “Our Hit Parade,” a monthly show at Joe’s Pub in which downtown performers adapt the week’s top-ten songs. “These songs are these really amazing machines, which the thinking crowd often doesn’t give them credit for,” he says. “It’s like they’re mathematically devised to get in your head and make you love them.”

Right now, no one is assembling these machines more expertly than Dr. Luke. In fact, the cases both for and against him can be built on the exact same evidence: that his ability to turn out consistent chart-toppers suggests something repetitive and formulaic. “If you look at his discography, there are so many gigantic songs,” says the music critic Maura Johnston. “He clearly has this formula that works. A friend said to me, ‘I can’t get ‘California Gurls’ out of my head. I hated it at first. But it totally overtook me.’ ” A Dr. Luke song reliably involves tension-building verses followed by a soaring, strap-yourself-in chorus (a poppified take on the old grunge approach); no end of bleep-blorp synthesizing (both instrumental and vocal) borrowed gleefully from eighties electro-pop; and an unapologetic, don’t-even-think-you-won’t-be-humming-this-all-summer hook. He’s successfully cracked the secret to what once seemed like a musical oxymoron: the aggressively sunny song that melds “the veneer of rock and the sheen of pop,” in the words of Sean Fennessey, a critic for Spin and the Village Voice, who adds, “It’s this amazing weaving of different genres. And you can’t really see the seams.” Of his work, Dr. Luke says simply, “I want to make songs that reach a lot of people and are fun and spread joy. You can make depressing music, that’s cool, and maybe I’ll want to do that sometime. But for now, I want fun stuff.”

Photo: From left, Carlos Alvarez/Getty Images; Jeff Kravitz/Film Magic; Brian Ach/WireImage

Luke is a thin, handsome, 36-year-old guy with an alert manner but a laid-back demeanor. He’s produced a lot of hip-hop, but now he works primarily with spunky female solo artists, with whom he seems to have an easy rapport. Once, while producing with Avril Lavigne, he asked her to pepper-spray him, just for fun. (“It’s actually not as bad as you’d think. Getting tased is a little different.”) When we meet for lunch at the Chateau Marmont, a short drive from Luke’s house in the Hills, he arrives wearing white flip-flops, light-gray jeans, and a pink T-shirt with a record player on it. He’s a lifelong New Yorker, transplanted to L.A. two years ago; refreshingly, he’s one of the few expats I’ve encountered who doesn’t pay wistful lip service to the culture and pace of the East Coast. “The New York I grew up in is gone,” he says bluntly. He bought a $4.69 million house that overlooks the vast canyon of L.A. and that he’s currently remodeling; right now, there’s a mattress on the ground, a slew of framed ascap songwriting awards—he was ascap’s 2010 Songwriter of the Year—leaning on a wall, and an obstacle course of keyboards on the living-room floor. At the Marmont, when he spots a particular light fixture that appeals to him, he snaps a photo on his cell phone. “That’s kind of cool: nice and simple,” he says. He’s very detail-oriented—“I analyze songs, think about what made them work, why they did work. I think about that all the time”—as well as a proud traditionalist; as everyone else obsesses over ringtones and digital downloads, he believes strongly in radio and record charts. He can rattle off the current chart position of any of his singles and says “the biggest driving force to having a hit song in this country is radio. Absolutely.” So far, his devotion to old-time religion has served him well. When we leave, he asks to borrow a couple of bucks so he can tip the valet (Luke drives a bling-free Prius), as he only has a wad of hundreds stuffed in the front pocket of his jeans.

Lukasz Gottwald originally wanted to be a drummer. But his parents—“understandably,” he says—didn’t want a drum kit in the house. So at 13 he took up his older sister’s guitar. He grew up in a garment-district loft with an architect father and an interior-designer mother who had a taste for the Stones, Ornette Coleman, and free jazz. Luke listened to Madonna and Run-DMC, but despite his natural proficiency with the guitar (“I was pretty dexterous”), he was never interested in starting a band or becoming a rock star. He was more of a technician. He’d listen to bad music over and over, if there was a guitar part he admired, so he could figure out what the guitar player was doing right.

After attending the Manhattan School of Music, he landed a job as a house guitarist on Saturday Night Live in 1996, picked up supplemental gigs playing on jingles, and spent his nights D.J.-ing and working on remixes. He was making a good living but soon started thinking, I don’t want to do background music. I want to make songs that reach millions of people. One night while D.J.-ing a house party, he met Max Martin, the Swedish producer of several huge hits for Britney Spears and the Backstreet Boys. Luke was drafted to give him a tour of New York clubs, and they struck up a friendship. “But that was the extent of our relationship,” Luke says. “Knowing how big he was, the last thing I was going to do was be like, ‘Hey dude, will you check out my tape?’ ”

Nonetheless, Martin became a mentor and then a collaborator, enlisting Luke to play on a few tracks. In 2004, they co-wrote a song called “Since U Been Gone” and sent it to Kelly Clarkson, an American Idol winner who’d had trouble establishing a post-Idol identity. Much of her music had been syrupy ballads or generic pop anthems, but Luke and Martin had the idea to pair her with an angry breakup song full of crunchy grunge guitars. “I had played that song for a lot of other people who passed on it,” Luke says. “I tried to get it to Pink, but I couldn’t reach her. But Kelly Clarkson was unexpectedly the exact right artist.” The song, a huge hit, represented a breakthrough (for Clarkson); a comeback (for Martin); and an attention-grabbing calling card for a producer who, during a hip-hop session with Mos Def, had picked up a nickname: “Dr. Luke.”

“Tell me if this is too loud,” Dr. Luke says, jacking the volume to a level you might describe as bowel-loosening. We’re in his studio and he’s cued up one of his latest tracks, “Dynamite,” by the young British singer Taio Cruz. As he listens, his leg moves rhythmically, almost spasmodically, beneath his desk. With his face a few feet from the now-throbbing speakers, drowning in sound, he’s like a man returned to his natural element: Aquaman in the ocean or Captain Ahab in the salt spray at the prow of his ship.

Luke has an arsenal of potential radio hits either on the air or in the launching tube—at one point in his studio he says, “What other songs have I done in the past year?” then opens his own Wikipedia page and scans down the list of tracks—but he has particularly high hopes for “Dynamite.” He says, “When I gave it to Taio, I told him, ‘Listen. This song is not yours. You have to earn it.’ Because I felt from the beginning that this was going to be big.” A pounding, synth-heavy party-starter, “Dynamite” is exactly the track you’d want the D.J. to drop at the moment you enter the club. The lyrics, as with most Dr. Luke songs—“I came to dance / I hit the floor ’cause that’s my plans / I’m wearing all my favorite brands”—are basically about how fun it is to hear a Dr. Luke song. From “Tik Tok”: “Don’t stop / Make it pop / D.J. blow my speakers up.” From “Party in the U.S.A.”: “I put my hands up / They’re playing my song / I know I’m gonna be okay.”

Dr. Luke wrote “Dynamite”—sort of. It’s not entirely correct to say he writes his songs, at least not in the romanticized sense of a lonely dude scratching notes while strumming away on an acoustic guitar. Rather, he assembles songs. He curates them. He hears a song before it exists, then he figures out who can best help him bring that song into existence.

In this case, he created a basic beat track with his fellow producer Benny Blanco. (Dr. Luke has a slate of producers signed to his company, Prescription Songs.) The track was originally intended to go to the rapper Flo Rida, but it wasn’t a good fit as a rap song, so Luke sent it to Sweden, to Max Martin, who wrote half of a hook for the chorus. Luke wrote the other half, then sent that track to Bonnie McKee, a lyricist. Then Luke started looking for the right vocalist to attach.

“I feel like I have a good grasp now, but that could change any minute. Three months from now, my sound could be over.”

He plays me a few different early versions of “Dynamite.” In one, a singer laid vocals over the beat around the theme of “double it up,” but it fell flat. Another vocalist tried the song in a reggae-dancehall style, which Luke hated. A producer wrote a melody over the original track, but it was weak; listening to it, Luke grimaces. “I would call this a failed-hook attempt.” He seems almost offended by weak beats. He can’t exactly explain why one groove “moves” while another falters. He just knows by listening. “Certain people are amazing songwriters. I don’t really know that’s my skill,” he says. “It might be more knowing what song is right for which artist and what to do—like, don’t do it like that, do it like this. Making the right judgment calls.”

He tells the story of “Right Round,” the song he created for Flo Rida. At the studio, Luke listened with Flo Rida to a track he had made and one submitted by another contender. “I was like, ‘Dude, I am not telling you this because I’m going to get paid. I’m telling this for you. Mine is a better version of the song.” Flo Rida wasn’t convinced. Later, some women showed up at the studio, and Luke recalls saying, “ ‘Why don’t we ask the girls what they think?’ And we played my track and they were like, ‘Absolutely that one.’ ” The song went quadruple platinum.

“A hit song is the right song, with the right artist, at the right time,” Luke says. Described this way, a hit might sound like mostly luck or happenstance. To Dr. Luke, it’s more like an intricately managed miracle. “It’s a million things going right, and any one thing can derail it. So I want to make sure the right decisions are being made—or, more important, that the wrong decisions aren’t being made.” This often means orchestrating the work of six or seven different collaborators and listening carefully to assemble the right beat, the right hook, the right singer, the right sound. “He’s a really good editor, that might be the best way of putting it,” says Maura Johnston. “He can look at a song from a certain high-level view and see exactly what’s working and what isn’t.” Of course, many super-producers have enjoyed their own moments, from the Neptunes in the early aughts to Timbaland teaming with Justin Timberlake. “I don’t think Luke is changing the tempo and tone of music in the way that someone like Timbaland did,” says Sean Fennessey. “But there’s a professionalism and clarity to the delivery of his songs that’s incredibly appealing. I think he’s kind of a genius. I’m curious to see how much longer he’ll be able to do it. There’s not a lot of guys who stay this hot.”

Luke hopes that, if that moment comes, he’ll be the first to recognize it. “I feel like I have a good grasp now, but that could change any minute. Three months from now, my sound could be over. My one hope is that, if my shit ain’t working, I’m not going to try to keep doing it.” He’s relentlessly self-critical, a trait he traces to his father. “My dad’s really critical. So I’m self-critical. There are some people in the music business who are incredibly talented—probably more talented than I am—but they aren’t self-critical at all. They usually don’t last too long.” Luke’s father is currently ill with cancer and on a raw-food diet, so now Luke’s on a raw-food diet, too; “It’s a little bit of solidarity,” he says. And he’s keeping very busy. There is no end of people who want a piece of the Dr. Luke sound. “I often think about secretly producing under a different name. Just to see how it’s perceived.” When he started writing music, his greatest thrill was to hear one of his songs on the radio. Now his great thrill is to hear one song on one station, then turn to another station and hear that same song, or another one of his hits, playing there, too. “That’s pretty nice,” he says. “It makes me feel like what I’m doing isn’t meaningless.”

Driving away from Dr. Luke’s house, I wind down a twisty road and back into L.A.’s sluggish traffic. In just over an hour of listening to KIIS FM while inching toward the airport in rush-hour gridlock, I hear “Tik Tok,” “Right Round,” and “California Gurls,” twice. It’s easy to imagine that, across the city, a million other people in their cars are tuned to the same Dr. Luke songs, all of us alone, listening together. “That defines what’s so good about pop music,” Fennessey tells me. “It can be a lonesome experience with headphones, but it’s also going to concerts, and driving in a car with friends, and an exchanged look when you both hear a song. People still want to go to parties and dance to a record together. It’s elemental, and Luke’s tapped into that.”

During the last leg toward LAX, “Dynamite” comes on the radio.

I turn it up.