Before a meeting with Pandora listeners, company founder Tim Westergren sits at a Steinway at the Avenue D Jazz and Blues Lounge in Miami. Before Pandora, Westergren filled his days playing piano. (Michel du Cille/The Washington Post)

“I know what mood I’m in. So, so, you could have a color dial! So, you have red, blue. So, I’m in an angry mood — red. Blue? I’m just chillin’ out with a glass of wine.”

Tim Westergren nods. He smiles. A hmmm-lemme-think-about-that-one sort of smile. Now here comes a matronly sort with a stack of CDs. Easily twice the age of the fast-talker. Medicare-eligible, she says. She can’t sleep. The CDs help. She shuffles them into Westergren’s hands. Play them, she pleads.

And they keep coming. A dozen, two dozen. More. A willowy, 20-something hipster who says his profession is “socialite.” A retired nurse with a thing for Eric Clapton. That kid with the skateboard.

They’ve all filed into a downtown blues club for a town-hall-style meeting with Westergren about Pandora, the phenomenally popular Internet radio service he founded and has willed through more than a decade of creative sparks and fizzles, serial business crises and serial bouncebacks. Friends remark about Westergren’s evangelical love-embrace of his creation, and on this night he has talked until a fine film of sweat dampens his hair and forehead.

When Pandora listeners talk to Westergren, he hears opinions on how he could improve the product. When Westergren talks to the listeners, he sometimes is sending a message to Washington. (Michel du Cille/The Washington Post)

He’s still talking half-an-hour after the meeting ends, encircled by listeners snapping smartphone pics. Still talking as the band playing the club that night starts its set. He’s communing directly with Pandora’s fans, but he’s directing his message as much at Washington, where he’s enmeshed in a pendulous fight over royalties that could reconfigure the way we listen to music online.

Lately, he’s prone to show up with some frequency on Capitol Hill, slipping into a blue blazer that doesn’t fit quite right and that he sometimes leaves with an in-law in Northern Virginia because he’s got no use for it back home in the San Francisco Bay Area. Jeans and baggy, long-sleeve T-shirts are more his style.

Westergren’s squabble over royalties has chafed at raw spots in a music world wary of artists getting scammed. There have been recriminations and accusations, dissing and dishing. Once Westergren embodied nothing more than the struggling musician, the long-shot entrepreneur. Now he’s confronted by critics who want to portray him as the guy who crossed over, the suit — even if he seldom wears one. This is how the game gets played at this level, when you’ve made it, when you matter. Will it be Musician Tim or Wall Street Tim?

Internet radio pays artists exponentially more for each song played than satellite and cable radio — services such as SiriusXM, Music Choice and Muzak. Pandora has long sought to alter that imbalance. Westergren wants Congress to lower the amount Pandora pays — arguing that the reduction would leave more money to innovate and expand its business. Ultimately artists would benefit from the increased exposure, especially the vast number of performers who don’t get airtime on AM or FM stations, he argues. They might even someday create a “musician’s middle-class,” he argues.

A coalition of performers and record companies is trying to block Pandora’s plan, accusing Westergren of “double talk” and “dishonesty,” and of greedily hurting artists by trying to drastically cut the compensation they receive.

When you’re Tim Westergren, and you’ve got more than 69 million active users listening to more than 1.5 billion of hours of music in a month and your product is embedded into the dashboard of 80 or so new car models, you don’t have to confine legislative lobbying to Washington (and political fund-raisers). Instead you go on the road, where his company forged an unusually intimate bond with its customers, hundreds of whom show up for each of his town halls. If he’s going to win, he’ll do it in places such as the Avenue D Jazz and Blues Lounge on a rainy night in Miami.

Onstage, he looks more like a guy about to slide behind the keyboard than a corporate pitchman. He’s both, actually. That afternoon, he tapped out a few notes on a piano to an empty house. “It’s a Steinway; I couldn’t help it,” he says.

Westergren is tall and slim with tousled brown hair. He’s a youthful 47-year-old with a laid-back manner and an evenly modulated, nonconfrontational, pedagogical speaking style. Guys in the audience are “dude.”

He anthropomorphizes his cyber-child, a “music genome project” that analyzes the component parts of a song and is fed into a computer program that matches similar songs and makes recommendations for listeners. “Pandora has an attitude,” he tells his Miami audience, “and sometimes gets upset.”

The overwhelming majority of Pandora users access the service at no cost, though a tiny percentage pay a small fee for a version with no ads. Users can create individualized stations based on a single artist or song. The idea is to help them discover new music with similar characteristics, a process that gets even more personalized by offering users the option to customize their stations by giving a song a thumbs up or thumb down. Pandora has logged 22 billion thumbs and counting.

Once, a user wrote Westergren furious that a Celine Dion song played on his Sarah McLachlan station. Westergren and the ­Dion-hater e-mailed back and forth for a long time, then silence. Later, a single-line e-mail arrived: “Oh my God. I like Celine Dion.”

Musical DNA

His routine in the late 1980s and early 1990s was simple: Piano all morning. Pick up somebody else’s kids in the afternoon. Piano all night. Repeat.

Not exactly the typical sitch for a Stanford University political science graduate. But somehow it felt right. In college, Westergren had done some teaching and worked with at-risk children. Now he was the nanny — or manny, as he puts it — for a family in Palo Alto, Calif.

He was the transplant in a state archetypally filled with them — a Minnesota executive’s son, the product of an elite prep school. He had a degree that made little sense for him, and a vague idea that playing music for a living would be better than anything else.

After five years of that, he formed a band called Yellowwood Junction and wrote earnest, melodic pop tunes with titles such as “Mom and Dad.” Sometimes there was no money for hotels, so they slept in the van or crashed on sofas in clubs.

Stardom didn’t happen, and Westergren veered into composing soundtracks for middling films. The directors lacked the vocabulary or frame of reference to articulate what they needed.

A singular, original notion came to him while he was tripping on psychedelic mushrooms: He could identify the genetic makeup of songs and use that information to make matches with other works.

In Northern California during those days, tech was booming, and “everyone was an entrepreneur,” Westergren recalls over breakfast one morning at the Mandarin Oriental hotel in Southwest Washington. He formed a company with two friends and brought on a musicologist, Nolan Gasser, who didn’t exactly fit the profile of a rock-and-roll tastemaker. Gasser was studying Medieval-Renaissance music and working toward a dissertation about the Marian Motet Cycles of the Gaffurius Codices.

Westergren entranced Gasser with a vision of “this moral component of what this sort of endeavor could entail . . . from artist to fans more directly.” Gasser took the idea with him on an academic research trip to Milan. By day, he pored over materials at the Fabbrica del Duomo in Milan; in the evenings, he dissected Led Zeppelin, Blue Oyster Cult and Buffalo Springfield.

When Gasser returned, he and Westergren typed their analyses into a clunky Microsoft spreadsheet they called a “matching engine.” They picked a Beatles song, either “Eleanor Rigby” or “Norwegian Wood” (they can’t remember which) to test it. Slowly, it sputtered an answer: a song called “New York Mining Disaster 1941” by the Bee Gees.

But it did work. The more they tinkered, the more they believed. Even the Beatles-Bee Gees mashup that made so little sense at first seemed to compute because this wasn’t the later, saccharine Bee Gees, but the earlier, bluesier Bee Gees.

“Our big challenge was the lexicon; literally ‘the Word,’ ” says Westergren, who rattles off phrases such as “compositional dominance.” “You felt a breakthrough moment when you found the word. Then you forgot the time before you had the words.”

They settled on five genomes — pop/rock, hip-hop, jazz, world and classical. Their office in San Francisco, and later in Oakland, swelled with hip-hop rhymers, classical music performers and jazz guys who spent days listening to music and analyzing each song based on more than 400 characteristics.

The project was thriving, the business wasn’t. Pandora’s leadership “originally thought raising money was going to be much easier,” Gasser recalls. A possible investor sneered, “So you’ve basically got the ‘no-model’ business model,” Westergren recalls.

Westergren maxed out 11 credit cards, taking on more than $300,000 in personal debt. Stress sent him to the hospital with heart palpitations.

The company’s finances were so dire that Westergren had to stop paying staff, asking them to defer salaries, which he didn’t realize was against California labor law. “When you aren’t paying everybody on a monthly basis, yeah, it can cause some tension,” Gasser recalls.

“Pretty much everybody took off,” says Steve Hogan, who now oversees 25 music analysts as head of music operations. At the nadir, Hogan was the only staff analyst left.

In 2004, an infusion of venture capital saved the company — the result of what Westergren estimates was at least his 349th pitch. But to keep his company alive, Westergren has had to sign most of it away to financiers. He now owns only about 3 percent of the stock.

Later that year, the company hired a new chief executive, Joe Kennedy, a former E-Loan and Saturn executive. Westergren had been trying with only limited success to license his music genome to businesses that sold music. Kennedy, who stepped down last month after nearly a decade at the company, developed the idea of using the music genome in an Internet radio service, Westergren says, and he also wanted to dump its name, Savage Beast Technologies. Westergren asked Gasser for ideas. He came up with . . . Pythagoras!

At lunch one afternoon, Kennedy scribbled P-a-n-d-o-r-a on the back of a Billboard magazine. All the wives and partners of top company officers had the same reaction: “But bad things came out of the box!”

Then there was the matter of the cyber­squatter who owned the URL; Pandora bought it cheap. And the defunct Idaho cover band that owned the trademark, Pandora’s Box; they hired a private investigator to find the former members and made a $5,000 deal for the name.

Easier to spell than Pythagoras.

Slowing the growth

Pandora grew fast — faster than its ability to monetize the service. But, less than two years after launching, it was about to run headlong into a threat that could have killed it.

In 2007, a federal panel — the Copyright Royalty Board — issued a ruling that would have raised the royalty rate paid by webcasters so high that it would have forced them out of business. Drama ensued. Op-eds were crafted, members of Congress raised a fuss. What resulted was a deal: Pandora, other music streamers, performers and the recording industry agreed to a new set of rates, and Westergren declared “the royalty crisis is over.”

The pace of Pandora’s growth was hypercharged by smartphones. Its iPhone app doubled its user base. What Pandora needed to do was slow down. In 2009, the company enacted a 40-hour-a-month listening cap, a way of limiting how much it paid in royalties without having to sell more ads that might have driven away listeners. There was an uproar. Westergren says he got four death threats.

Pandora lifted the cap in 2011 but reinstated it this year for mobile users. This time, it has more than legions of users to satisfy. It also has stockholders. The company went public with a $230 million stock offering in late 2011, a decision that left Westergren — even with his diminished stake — with stock worth more than $20 million.

Wall Street analysts don’t love the stock; scan the headlines and you’d assume “troubled” or “struggling” were part of Pandora’s trademarked name. Like many tech companies, Pandora is finding it tougher to make ad dollars on mobile devices than desktop computers.

Rush clapped when Westergren, who was sitting by his side, told the audience that Pandora pays half its gross revenue in royalties that are split between performers and recording companies. By comparison, the satellite radio company SiriusXM is obligated to pay only 8 percent, and AM/FM stations, which pay royalties to songwriters, pay nothing to artists.

Four seats to Westergren’s right, another panelist, Ted Kalo, fumed. Kalo, the director of a group called MusicFirst that represents a coalition of artists and the recording industry, knew that a Pandora-backed bill that would cut the company’s royalties had been introduced in Congress that morning. Kalo considered the bill a betrayal of their previous deal. Later, in an interview, Kalo blasted the “audacity” of Westergren for not at least mentioning it before leaving the panel early to catch a flight home.

Two Democrats — Sen. Ron Wyden of Oregon and Rep. Jared Polis of Colorado — and Republican Rep. Jason Chaffetz of Utah introduced the Internet Radio Fairness Act. They popped the bill on Congress’s last day in session before breaking for the run-up to the presidential election. It had all the hallmarks of a move intended to stimulate public debate — and, perhaps, to flush out the opposition — since the chances of passing a complex bill in a single day are nil.

The bill would change the standard by which Internet radio royalty rates are set. Currently Internet radio companies like Pandora come under a standard called “willing buyer, willing seller,” which theoretically should mimic the amount companies would pay if they negotiated with artists individually; Pandora executives want to switch to the standard applied to SiriusXM, Muzak and cable radio stations, which allows the federal panel that sets rates consider whether the rates would be “disruptive” to a company’s bottom line. Kalo asserts that the switch would cut rates more than 80 percent; Westergren acknowledges that he wants rates to go down but says there’s no way of knowing how deep the federal panel would cut them.

Internet radio royalties are tiny. In 2012, Pandora’s royalty payment was about a tenth of a cent each time a song was played, so when you leave it on for an hour, you’re costing the company about 1.65 cents. Yet Westergren projects that big stars such as Drake and Lil Wayne make $3 million a year from Pandora alone, and even a lesser-known artist, such as gospel star Donnie McClurkin, pulls in $100,000. Executives at SoundExchange, the nonprofit group that collects royalties, accuse Westergren of spreading a distortion because 90 percent of artists receive less than $5,000 a year in annual digital royalties.

After the introduction of the Pandora-backed bill, Westergren and Pandora are both the instigators, and the target, of a public campaign, complete with a deluge of competing calls and e-mails to Congress. MusicFirst attacked the proposal in a two-page Politico ad citing the opposition of 133 artists, such as Vince Gill, Bonnie Raitt, Maroon 5 and Britney Spears.

“A charitable explanation is that they were ill-advised about the strength of having a large e-mail list of subscribers,” Kalo said in an interview. “A less charitable explanation is that they’re trying to build the value of their company in a substantial way before they cash out.”

Westergren dismisses the barbs as “propaganda.” “There’s a very concerted effort to make us into a caricature: the insensitive Wall Street-funded barbarians at the gate,” Westergren says one evening. “I’m a big boy. I think, ‘How do we defend against this?’ As opposed to, ‘Oh, I’m injured.’ ”

At the bottom, hope

Westergren remembers holding a glass of wine — a beautiful red — in one hand, a Kobe beef burger in the other. On that night a few years back, inside a swank Las Vegas hotel suite where investors were courting him, it was as if his consciousness lifted out of his body and he could look down on himself. He couldn’t believe how good he had it — a company he loves, no more heart palpitations.

“The vision is coming true,” he says at a tucked-away table in a taco joint around the corner from the club where he held his Miami town hall meeting. “I just want to marinate in it.”

Westergren tells audiences that they don’t know the whole story of Pandora’s box. Yes, it was full of bad things. But at the very bottom there was something else: the spirit of hope.

On this night, Westergren is full of just that.

He’s talking about unleashing data to help bands build an audience. He envisions generating enough profits to pay for engineering a heat map based on Pandora Zip code information that would show small bands where to find their fans. He has been meeting discreetly with bands to talk about the idea for a month. Maybe they could fill some clubs. Stop sleeping in vans.

He’s talking about figuring out a way to spread Pandora to other countries, about reaching a global audience of billions, not millions. He’s talking about changing the way people listen to music.

The funny thing about that last goal, though — he’s already achieved it.