Alex Rigopulos promised he wasn't going to treat this as some kind of victory lap, as a fist-pump in the sky to proclaim that his long-struggling company had gutted out a decade of failure to explode in unlikely success. But, man, he could have. On a sweltering evening this July, the Who (yes, that the Who) was about to play a private concert for his company's 1,500 invited guests -- press, partners, investors -- at the rented-out Orpheum Theatre in Los Angeles. Harmonix Music Systems, the company Rigopulos co-founded 13 years earlier, was on fire. He and co-founder Eran Egozy and their patient investors had made millions of dollars, and millions more were on the way. The company's video games, Guitar Hero and Rock Band, which let players perform real rock songs on fake instruments, were pumping life into a panicking music industry, an industry that just a few years back only occasionally took the time to return Harmonix's phone calls. Tonight, the company was introducing Rock Band 2, in advance of its official release in September.

Rigopulos didn't dare think of this event as vindication, though. "You always feel like you're on the brink of failure," he had said in his office a week before the Who concert. Failure, after all, had chased his company for so long. He and Egozy had launched Harmonix in 1995 fresh out of graduate school, with a cool piece of demo software they had written, a dreamy business plan about bringing the bliss of playing an instrument to nonmusicians, and no truly marketable ideas.

Could you design a better blueprint for years of frustration? It came like a slow beating: a decade of scraping by as the founders struggled to turn their idea into a viable product and began sacrificing pieces of their vision (and their company) to stay afloat. A decade of learning that ingenuity comes in two flavors: the kind where you invent mind-blowing technology (that was the easy part for two guys with master's degrees from the Massachusetts Institute of Technology) and the kind where you build a legitimate business around it.

The aroma of a rocking party -- booze and sweat and perfume -- drifted across the Orpheum's lobby as Rigopulos schmoozed and tried to be everywhere. The Harmonix CEO, 38, is tall and fine-featured, his uniform an untucked dress shirt and a suit jacket over slim-cut jeans. Until seven years ago (when a receding hairline made it look too silly), he had a ponytail. At open bars, businesspeople squeezed shoulder to shoulder for drinks, and many lined up to play Rock Band 2. They sang and jammed like teenagers on plastic guitars and drums, performing songs like Bon Jovi's "Livin' on a Prayer" and Survivor's "Eye of the Tiger."

And then...Rigopulos was nowhere.

Downstairs, past a security guard and a velvet curtain leading into a VIP-only area, then through another doorway in a back barroom, there he was, alone, lost in thoughts and a bit of bourbon, pacing, looking at the floor, his arms folded over his chest. It was quiet. In 15 minutes, he would be getting onstage to say a few words before the Who came on.

"I'm not introducing the band," he said. "I just want to take a moment to thank everyone for sticking with us." Maybe this was an emotional night, after all.

Soon, up in the theater, the houselights dimmed, the background music faded, and silhouettes appeared onstage. It wasn't Rigopulos -- it was Roger Daltrey, Pete Townshend, and the rest of the Who. Townshend cranked four staccato power chords to begin "I Can't Explain," and the crowd erupted. Rigopulos didn't get to make his thank-you speech.

"The band was ready to go on," he said afterward with a shrug. "I didn't want to hold things up." The night had been 13 years in coming, after all.

If you weren't among the people whose money Harmonix had been burning through, the company appeared to burst onto the scene with a billion-dollar success. In late 2005, Harmonix and RedOctane (a company that briefly ran out of money while funding Harmonix's creation of the game) released Guitar Hero. The game reached $1 billion in North American sales faster than any other video game in history and became a pop culture phenomenon, with celebrity fans, magazine covers, TV cameos -- the whole Hollywood movie montage.

Guitar Hero comes with a plastic guitar that looks like a Fisher-Price version of a Gibson SG. Players press big, colored buttons on the guitar's neck to try to match colored dots that cascade down a TV screen in time with the music, mostly classic rock songs such as Boston's "More Than a Feeling" and the Ramones' "I Wanna Be Sedated." For example, during the crunking opening of Deep Purple's "Smoke on the Water," the famous da-da-daaa, da-da-DA-daaa, if you don't hit the blue button with your left pinky and press the strum bar lever at exactly the right time with your other hand, it goes da-da-daaa, da-da [silence] daaa. If you get it right, though, the effect is that you are really playing the awesome guitar riff of a song you have heard a million times on the radio since you were 15. It's shockingly fun. You score points based on the accuracy of your playing.

Last November, Harmonix introduced Rock Band (this time the guitar is a faux Fender Stratocaster), adding to the ensemble a drum kit and an optional bass guitar and vocals (the game can tell if you are singing on pitch). It is another monster hit, selling more than 3.5 million units so far at a list price of $169, a stratospheric amount for a home video game. Viacom now owns Rock Band; Harmonix's founders sold their company in 2006 for $175 million, with the possibility of another $200 million in earn-outs. Harmonix still operates autonomously, in Cambridge, Massachusetts, with bigger budgets for product development and marketing and concerts by the legends of rock.

It all easily might never have happened. "We were on the brink of death, I don't know, 10 times over those 10 years," Rigopulos says. Harmonix missed the cash gusher of the Internet bubble almost entirely while it pursued ideas that bombed miserably, one after another. In 1999, the year an online pet store fronted by a sock puppet raised $50 million, Harmonix was laying off staff. Its founders sometimes give the impression of still being a bit shaken. Last year, when fawning organizers of a video game conference asked Rigopulos to give a speech about "living the dream," he wistfully marked up a PowerPoint chart of Harmonix's annual profits and losses. He labeled the company's breakout year, 2006, as "The Dream." The years 1995 through 2005, shown almost entirely in red ink, were "The Part Before That."

Tokyo Big Sight is a sprawling exhibition hall on the man-made island of Odaiba in Tokyo Bay. In mid-1999, Rigopulos and Egozy were inside at the annual Karaoke Festa trade show, watching their dream die again. They had decided a year earlier that the pot of gold for Harmonix was in Japanese karaoke. So they had leased a costly branch office in Tokyo and put their company's meager cash resources toward developing contacts in the industry. Now, here they were, in the booth of karaoke company Daiichikosho, exhibiting next to a vendor whose product made it possible to order French fries and soda through a karaoke machine. Rigopulos and Egozy thought their gizmo was cooler: a computer joystick glommed onto a real guitar and wired to a karaoke player. Using the joystick, a person could improvise music that sounded like a guitar, while another person sang a popular tune. (The guitar was purely for show, and the joystick jutting out of it when people wore the guitar looked perverse.)

In the booth, they watched as businesspeople politely tried out their invention, nodded, and moved on to test the French fry system. Nobody was having much fun. The smiles seemed forced. Toward the end of the show, Egozy looked around and couldn't find his business partner. Rigopulos was gone. He had realized before Egozy that their idea was doomed and had gone back to the hotel. Karaoke in Japan had nothing to do with improvising a guitar performance, and it wasn't going to. It was another year wasted. About $7 million of investors' money was gone.

It was time to rewrite the business plan again.

Rigopulos calls the early years at Harmonix "the dark ages." For four years, they were making no money, he says. "And to be clear, I don't mean we were earning no money. I mean we had near zero revenue. We were raising money and spending it, building stuff that no one actually wanted to pay for."

They were obsessed with an idea. It started with "Growing Music From Seeds: Parametric Generation and Control of Seed-Based Music for Interactive Composition and Performance," Rigopulos's 80-page master's thesis in 1994 at MIT's Media Lab. The paper had something to do with encoding the essence of music into software.

Rigopulos had grown up outside Boston, messing around with computers and playing drums in a Led Zeppelin/Pink Floyd cover band. As an undergraduate at MIT, he majored in music and co-founded a Balinese percussion orchestra. For his graduate studies, he was assigned to share an office with Egozy, who was a year behind him. Egozy, 36, is a gifted computer scientist, a T-shirt-and-sneakers guy with wire-frame glasses and a grin that seems to say I just changed your grades on the school computer. His family had moved to the U.S. from Israel when he was 12. He is a virtuosic clarinetist who plays in a classical ensemble (though he admits the first album he bought was Van Halen's 1984). The two prodigies clicked.

Some of their peers were working on sophisticated "hyperinstruments" -- hot-rodded cellos and violins and such; one project involved putting computer sensors all over Yo-Yo Ma's cello. "We were interested in the other 99.9999 percent of the population who aren't expert musicians," Rigopulos says.

What if they could take the rush they felt when they played music and package it for popular consumption? They created a computer program that applied basic musical rules to allow anyone to improvise solos by moving a joystick while popular music played. It sounded somewhat funky, and people seemed to have fun with it. "We decided that after we finished our degrees, we had to start a company to try to bring this concept to the world," Rigopulos says. Like so many would-be entrepreneurs with a treasured idea, they were unprepared for a world that didn't really care.

Dude, get up! There's an investor coming!"

It was spring 1996 at the rent-controlled apartment in Cambridge that Egozy shared with two roommates, and Rigopulos had arrived to wake him up. Rigopulos frantically tossed dirty socks and paper into the closet. Egozy folded his futon into a couch and booted up his Mac. A few minutes later, an investor looking to place $25,000 or $50,000 arrived for a demo of The Axe, the name Rigopulos and Egozy had given to their music improvisation software. They can't remember his name; he didn't invest, and more than one Series B financing meeting happened in Egozy's bedroom.

Rigopulos (still living in his parents' attic) was CEO, and Egozy was chief technical officer. They had started Harmonix with $100,000 from friends and family and were now pursuing every other funding contact they could. After losing in MIT's business plan competition, Egozy thought one of the judges' names sounded familiar. He went to the Alpha Delta Phi fraternity house, where he had lived as an undergrad, checked the photos of alumni on the wall, and recognized brother Brad Feld.

"I was completely entranced by Eran and Alex," recalls Feld, now managing director of Foundry Group, a venture capital firm in Boulder, Colorado. "They were incredibly passionate about both music and technology and had tons of ideas." Feld, who had recently sold his own tech company, committed $25,000, made some calls, and delivered a round of $500,000 from angel investors who didn't expect a quick return. And so began the slow beating.

In the Media Lab, it had been enough for Rigopulos and Egozy to create magical demonstrations. That was the end product. It took them years to learn that technical awesomeness was no longer enough. "We had this naive assumption that if we made something that had a lot of 'Wow, how'd they do that?' factor, it would sell," Rigopulos says.

In 1997, Harmonix, which had grown to a staff of about 25, self-published The Axe. A few reviewers marveled at it, and it sold about 300 copies. Rigopulos and Egozy spent months working a deal in which Intel might bundle a demo of The Axe with Intel-based PCs. Once people tried it, they'd be hooked! During a call with Intel that wasn't going well, the automated conference system ran out of time and hung up on everyone. "We tried calling back," Egozy says. "No one picked up. There was no follow-up e-mail. That was the last time we ever spoke to those people."

Rigopulos revised the business plan every year, always building around the core vision of letting nonmusicians make music. "The introduction section didn't change, but what we were going to do changed from year to year," he says. "It was this exercise in fiction writing."

Still, Rigopulos and Egozy were well pedigreed and impressive, and there was a lot of money looking for technologically sophisticated start-ups, and Harmonix raised about $10 million in 10 years. Financing would arrive just in time. "There were at least a couple of rounds where if we didn't get them closed before the next payroll, it would have shut down the company," Rigopulos says. The founders whittled away their equity to stay alive. Soon, Rigopulos and Egozy owned "way less" than half of Harmonix (they won't be more specific). They had few qualms about it; it was do or die. "Cash is oxygen. Cash is life," Rigopulos says.

The investors didn't want control, and that allowed Rigopulos and Egozy to continue getting clobbered by reality. In 1998, Harmonix won a deal to put its Axe technology in a music-making exhibit at Disney's (NYSE:DIS) Epcot. It was a technical marvel, as usual, and the job cost about three times more to do than it paid. The same year, Japanese giant Softbank (OTC:SFTBF) invested $2 million. In 1999, the Taiwanese computer maker Acer also invested $2 million. By then, some investors were asking things such as whether the company might consider changing its name to and how it planned to get "eyeballs." A plan that finally had an Internet component, a website with play-along music, quickly failed.

The vision and the software had hit a wall. The company was burning through $1 million to $2 million a year. Sales were nil. "To a large degree, my sense of self-worth was tied up in the company," Rigopulos says. "Everything we were doing was built upon a founding premise that the world was full of people who feel this urge to make music. We certainly felt it. Every time we were smacked in the head by one of these failures, I found myself questioning -- Do we actually have something in common with the rest of humanity? This was like our life's work, and we were just facing defeat at every turn."

A few months back from Japan in 1999, they laid off 10 of their 25 employees.

The floor above the Walgreens in Cambridge's Central Square used to be a Harvard University Japanese studies library. Now it's filled with rockers, the employees of Harmonix. Fake and real instruments lie everywhere. Many of the former library rooms are soundproofed. Meeting rooms are named after defunct Boston rock clubs like The Rat and The Channel.

Dozens of the 250 or so employees are musicians, many active in Boston-area bands. Daniel Sussman, who produced Guitar Hero and oversees the four factories in China that are making the components for Rock Band 2, plays guitar and sings for the Acro-brats. Dan Teasdale, lead designer for Rock Band 2, plays bass for Speck. Harmonix was a music company from its start and always hired musicians.

In 2000, it became a game company.

A game has a goal. The players keep score; they can compete. If they are teenagers and young adults, as are most people who buy video games, they can become obsessive. What Rigopulos and Egozy had been trying to sell for five years was a kind of interactive art. Now they were ready to get behind something else: fun.

There wasn't a U.S. market for music video games in 2000, but games at least had a revenue model. The video game business is like the book business. Publishers pay an advance for creation of a game and cover the costs of packaging, marketing, and distributing it. A game developer like Harmonix gets the advance -- often $2 million or more per game -- and pockets as profit whatever isn't spent to create the game, then hopes it sells well enough to produce royalties.

In Japan, Rigopulos and Egozy had noticed video games in which players tapped out musical beats. They thought these new rhythm-action games were dumb, actually. Harmonix had crafted algorithms to crack music's code, and here, in games such as Beatmania, kids were mindlessly smacking buttons with their palms. But the kids were having fun. After four years of failure, Rigopulos and Egozy swallowed hard.

But they still hadn't learned. The first game they prototyped, called Frequency, was a complex, thinking person's button-masher. You would race down a tunnel whose walls represented instruments -- guitar, drums, bass, synthesizer -- and press buttons to activate layers of sound. Frequency intimidated people. Of eight publishers Harmonix contacted, all said no except Sony (NYSE:SNE), which agreed to publish Frequency for its PlayStation 2 in 2001. "We were finally able to sell something other than stock," Egozy says.

The game sold poorly, and a 2003 sequel, Amplitude, did about the same. In a focus group, when Sony gave testers advance information about Amplitude, only 2 percent said they were interested -- the lowest score Sony had ever recorded, Rigopulos was told. After playing the game, 69 percent said they were interested -- the highest score ever. Rigopulos called Sony excitedly when he heard the results. No, he was told. You don't get it. The expensive part is getting people to try it. Egozy recalls dryly, "Sony said to us, 'We love you, but we're not going to give you another couple million bucks to make a music game that no one wants to buy.' "

No one was returning calls. There was no next plan. So when Japan's Konami did call, asking them to make a karaoke game for the U.S. market, Rigopulos and Egozy sucked it up and said, "It's a gig." Karaoke Revolution was Harmonix's simplest product yet -- and its most popular. It allowed players to score points by singing pop songs into a headset or microphone. Harmonix was getting better at not spending every cent of its advances. In 2004, the company's 10th year, Harmonix made its first dollar. "We were eking out like a 2 percent profit," Egozy says.

So here's where the vision had led. The founders had sold the bulk of their company to outsiders and after 10 years were making a minuscule profit with games that had essentially nothing to do with their original vision. How much did they need to wander from the mission to succeed? They rationalized: At least karaoke was music. What to do, though, when Sony called again in 2003, looking for a game for its new interactive camera -- and explicitly said, No music at all. They took the gig. EyeToy: AntiGrav involved riding on a virtual hoverboard. It got lousy reviews. And, as 2005 began, it became Harmonix's best-selling product ever.

The success was a punch in the gut. "We were like, God, are we just idiots?" Rigopulos says. "Are we a game company? Are we a music company?" "We were thinking, Is our entire company mission statement basically a complete flaw?" says Egozy.

They struggled. Perhaps Harmonix was not a music company after all, just a company filled with musicians who created games that were...quirky. Mission statement? Things change. Maybe Harmonix Music Systems should become Harmonix Game Studios.

"It was really at our sort of darkest moment in terms of self-doubt that the third chapter in our history began," Egozy says, "when we were contacted by RedOctane about making a guitar game."

For brothers Charles and Kai Huang, helping non-musicians experience the bliss of musical performance meant nothing in particular. The Huangs were in Silicon Valley, watching friends and classmates get rich from dot-com companies, and they weren't tied to a vision any more complicated than wanting a piece of their own. It turned out they were the exact spark Harmonix needed to ignite.

The Huangs had the start-up bug in their blood. Their father had started a tools business in Taiwan, and in Sunnyvale, California, he began a company importing auto wheel covers. Charles Huang went into the family business after graduating from the University of California at Berkeley in 1992 and learned about manufacturing in China. Kai graduated from Berkeley in 1994 and went to Accenture as a supply-chain consultant. In 1998, the brothers started a company selling corporate firewall systems, and it flopped in a year. In 1999, they started RedOctane as an online video game rental service. It never really took off.

Finally, they zigzagged into something profitable: making dance pads. There was a new game called Dance Dance Revolution, in which players scored points by following dance-step instructions on the screen. The home version required players to buy a pad to stomp on in front of their TV sets. The Huangs started manufacturing the mats in China and selling them. Margins were great. By 2001, RedOctane was turning a profit. By 2004, it reached $9 million in sales. But the Huangs knew they wouldn't conquer America with Japanese pop dance mats. They had been fans of Harmonix's games and the way they used rock music to connect with American players. "And if you were going to do a rock-based game and make a peripheral for it, you had to start with the guitar," says Kai Huang. "It was sort of a no-brainer."

A guitar? A little electric guitar that attaches to a video game so you can shred to Black Sabbath's "Iron Man" and have it seem real? Are you kidding? Can it have a whammy bar? the Harmonix guys asked.

"Why? What would a whammy bar do?" the Huangs responded.

We don't know yet, but it has to have a whammy bar, the Harmonix guys said. Because whammy bars are cool.

There was almost no reason to think Guitar Hero was going to solve either Harmonix's identity crisis or its economic trouble. Music games were a niche market -- not one had ever sold really well. RedOctane was "this tiny company that had no money and no publishing expertise," Rigopulos recalls. A normal game was $39 or $49; with a plastic guitar, this would have to be at least $69. The box would be gigantic, requiring shelf space a retailer could otherwise use for 20 or 30 games. A guitar video game wasn't even original -- there had been a guitar game in Japan a few years before.

But not with American rock. Rigopulos and Egozy looked around their office. Musicians were everywhere. Something in the mix of desire, desperation, and lack of parental supervision said go, go, go.

They set a stingy $1 million budget and a tight nine-month schedule to get Guitar Hero into stores for the 2005 holidays. Harmonix's 60-odd employees would create the game. RedOctane would make the guitars and fund the project as publisher. The Huangs went looking for money and couldn't get a dime. One investor who turned them down later told Charles Huang he thought, "That's a great game. Too bad these guys are going to go out of business trying to sell it." And that summer, RedOctane ran out of cash.

"I remember talking to my wife and saying, 'Honey, I want to take out a second mortgage on the house to fund Guitar Hero,' " Charles Huang says. "She asked me, 'Where will our kids live if the game doesn't sell?' I said, 'I think it'll sell.' " Maxing out credit lines, the Huangs scraped together $1.5 million to fund and market the game.

Harmonix sprinted on multiple fronts, including assembling a wish list of face-melting guitar songs, then seeing which they could afford to license. Original recordings were prohibitively expensive, and some labels didn't return calls, so Harmonix licensed composition rights only and hired a studio to record favorites by Black Sabbath, Bowie, Boston, and other artists. Songs by the bands of Harmonix employees filled out the Guitar Hero playlist.

The only big retailer to carry Guitar Hero when it was released in November 2005 was Best Buy. "I think the first order was for something like 8,000 units," Egozy recalls. "And then apparently, like one week later, they placed a second order for 80,000. Once they placed demo kiosks in the stores, their initial inventory blew out in days."

New games often sell well in November and better in December, then fall off dramatically. January's sales of Guitar Hero were better than December's sales. February's were bigger again. Rigopulos looked at the February data and wondered, What's going on? On YouTube, he typed Guitar Hero -- and thousands of videos that people had made of themselves playing Guitar Hero came up. Something new was happening, finally.

In the last two months of 2005, Guitar Hero did about $15 million in sales, more than the previous 10 years of sales at Harmonix combined. And the train kept a-rollin'. Bars started having Guitar Hero nights. Real rock stars started playing. The raunchy cartoon South Park devoted an episode to the craze titled "Guitar Queer-O." A pitcher for the Detroit Tigers, Joel Zumaya, missed the American League Championship Series in 2006 with an unexplained wrist injury. Yes, he had played too much Guitar Hero.

This, at last, was the bliss. The music industry has been so worried about emerging technologies, but it turns out that fans don't just want to steal MP3 files -- they want technology to transport them deeper inside the things they love. Fantasy sports boomed by letting anyone "own" a team. Blogs allow everyone to be the media. This was music's ride inside.

In 2006, Harmonix and RedOctane released Guitar Hero 2, and the franchise overall did $180 million in sales. That year, the first royalty payment arrived by wire in Harmonix's bank account. Bookkeeper Kris Fell told Rigopulos and Egozy the amount, and they just looked at each other. It was more than they had raised in the history of the company, suddenly just there.

As quickly as Harmonix and RedOctane had come together, they were pulled apart. In 2006, the game publisher Activision bought RedOctane for $99.9 million -- and because RedOctane was the publisher of Guitar Hero, the name went with it. Not long after, Viacom bought Harmonix and placed it in its MTV Networks division. The time was right, Rigopulos sensed. "Not just because of the exit opportunity, the financial factors," he says. When success comes, "you know as an entrepreneur that the category is about to be flooded with intense competitors." He knew he would need a giant partner to stay alive when success came.

He was right about needing a war chest. Later this year, Activision will debut Guitar Hero: World Tour, which will have drums, bass, and vocals, just like Rock Band. Activision this summer released Guitar Hero: Aerosmith. To lock up exclusive use of the Aerosmith catalog in a music game, Activision reportedly paid the band a better royalty rate than it had received for any of its albums.

That can't possibly make sense, but somehow it does. The music labels are calling now. Global music sales dropped 8 percent in 2007, and these games are a safe way for a technophobic industry to sell its classics yet again. A new generation of kids is humming "Iron Man." Songs that have been included in Guitar Hero and Rock Band have surged in sales on iTunes and elsewhere. So, yes, the first Guitar Hero game used remakes of songs -- "as made famous by" Z.Z. Top or Judas Priest. But Rock Band has "Gimme Shelter: The Rolling Stones." Rock Band 2, released in mid-September, has classics by AC/DC and Bob Dylan and included the world premiere of a song from the Guns N' Roses Chinese Democracy album.

Even from the days of The Axe, Rigopulos and Egozy imagined special software-playable versions of songs that might be sold separately. Now, players of Rock Band (and Guitar Hero) can download added tracks to play on their Xbox and PlayStation 3 systems, most at $1.99 per song (twice the price of an iTunes track). Already 21 million Rock Band downloads and 20 million Guitar Hero downloads have been sold. By year's end, more than 500 songs will be available for play in Rock Band. The Who's greatest hits are available for Rock Band, and there are rumors the Beatles' catalog is in play. MTV, which owns Country Music Television, is thinking beyond rock. Egozy envisions a day when all new albums will be released in normal format and a game-playable format. He and Rigopulos will be there trying to make it happen. The money is fine, thanks -- especially given that they get royalties from Guitar Hero -- and they have room to breathe and create without wondering who will pick up the check.

Rigopulos never did get onstage during the concert to thank everyone. The band did it for him, sort of. Townshend snapped a guitar string during his solo on "Pinball Wizard" and got a laugh, asking, "Does this ever happen in the game?" And Daltrey thanked the crowd of Harmonix employees and supporters in his own, emotional way. "We're too old to get on the radio," Daltrey said. "Thank f--- for you lot. Thank f--- for anything where music's getting heard."

Rock is dead, they say. Long live rock.

Don Steinberg is a writer and guitar player who lives in Yardley, Pennsylvania.