Clifton Williams, a musical prodigy from Southeast Washington, blinks in the glare of center stage at the Apollo Theater, Harlem’s hallowed hall, and squints out over the 1,538 red-cushioned seats — and maybe into his future.

Winning isn’t everything, but at the Apollo on Amateur Night, as in life, there must be a winner. And now Williams, 22, with his parents and girlfriend in the audience, and his friends everywhere following online, hears the emcee’s words:

“Ladies and gentlemen, we have a winner! And the winner is . . . John Doe!”

It’s dress rehearsal late Wednesday afternoon, and the Apollo’s perfectionist producers are running through the possible scenarios. Williams is a finalist in the challenge to write a new theme song for Amateur Night, the weekly showcase at which the merciless and exacting crowd has been picking winners and losers, with cheers and boos, since 1934. That was the year Ella Fitzgerald and Pearl Bailey were discovered on this stage. Since then, a ridiculously awesome and eclectic list of idols has competed in this grandfather of talent smackdowns: Sarah Vaughan, Ruth Brown, Gladys Knight, Ronnie Spector, James Brown, Jimi Hendrix, Dionne Warwick, Luther Vandross, Lauryn Hill.

In a couple of hours, Williams and the other finalist, Daryl Brown, 25, of Boston, will find out who wins. They are rivals, and as it happens, they are friends.

This is only the second time in memory that the theme song has been changed, and the first time that the job has been entrusted to aspiring young musicians, with the winners chosen by public acclaim. The winning tune will surely be played hundreds of times for thousands of people in coming years, and it might go down in history. That’s worth more than the $5,000 prize money.

Williams’s path to this moment began when he was about 3 years old, banging on the piano at Charity Baptist Church in Southeast Washington, until his mother noticed that his little hands were making musical sounds, not noise. Piano lessons with a renowned local gospel singer followed, and they led to Duke Ellington School of the Arts in Northwest, where he was valedictorian. Then came a full scholarship to the Berklee College of Music in Boston, where Williams will graduate next week with a double major in music education and contemporary writing and production.

Along the way, it was practice, practice, practice, as much as three hours a day, even when the other kids in his neighborhood off Minnesota Avenue SE were outside playing. Practice, practice — on borrowed church pianos, because there was none at home, or on the little electric keyboard his grandmother gave him.

But the path doesn’t end here, does it? This is the Apollo, and the Apollo is legendarily a gateway and a launching pad.

“I feel like this is a stepping block into my destiny,” Williams said during a break in rehearsals. “I feel like I’m being welcomed into the real world and the music industry.”

After graduation, Williams is relocating to Los Angeles to try to make it as a songwriter, musician and producer, with his girlfriend, Jeniffer Criss, a singer who graduated from Berklee last year. She is competing in Amateur Night next week. “I hope his song is the one we hear before the show starts,” she said.

Brown, the other finalist, whose Boston-based band is called Unique Sound, hopes to carve a life as a touring musician.

“If I win this, my song could be played for 40 or 50 years, and no one can take that away,” Brown said.

But only one can win.

“I’m happy, and I’m already a winner,” Williams said of the experience of working with Apollo musicians and producers to craft his song into a performance-ready anthem. “Because I’m one step closer to where I need to be.”

Shirley Ables met Williams when she and her Joy Gospel Singers came to perform at Charity Baptist, where the Williams family worshipped, when Williams was about 8.

“He just wanted to play the piano so bad,” Ables recalled. “I said, ‘Bring that baby to me this week!’”

So Cheryl Williams brought her son to Shirley Ables Music Ministry for lessons, which he continued through high school.

His mother, a home health aide known as Miss Peaches in the neighborhood, remembers children coming to the door to ask Clifton to come outside.

“They would say: ‘Miss Peaches, why don’t your son come out?’ He would be up in his room playing his piano all by himself.”

Clifton has two sisters. His father, William Clifton Brodis, has a disability and doesn’t work.

At 17, while a junior at Duke Ellington, Clifton earned a spot performing on “From the Top,” the NPR radio show featuring young classical musicians. He played “Suggestion Diabolique” by Prokofiev. And he was a music director at Pilgrim Rest Baptist Church in Northeast, to earn money for his family.

He loved to enter contests. “It’s the quickest way to know if people like your music,” he said. “Wanting to be a songwriter and a producer, I need to know if people like the music I make.”

When the Apollo called for submissions earlier this year, 129 songs came back. More than 10,000 votes were cast online in the initial round. The producers took popularity into account, along with their own judgment of quality, and selected the finalists.

The theme song opens every Amateur Night. The current one is a bracing gumbo of styles, from funk to soul, to hip-hop to hard rock. The Apollo’s creative directors decided an update was in order. Williams wanted to write something groovier, but still up-tempo and danceable. For inspiration, he looked to a previous generation of artists — Aretha Franklin, Stevie Wonder, Marvin Gaye, Al Green, the Jackson 5. Many, if not all, were given a critical boost by performing at the Apollo.

“To use their approach to music definitely correlates to the legacy and the story of all the singers and musicians who’ve come through,” Williams said. “And that’s what Amateur Night is for — they come to try to make their way to fame.”

Friends at Berklee filled in on violin, cello, drums, guitar, bass and vocals. Williams submitted a video of the session to the Apollo.

When the song was named a finalist, the producers at the Apollo had some tips. They rented a studio and booked session musicians for Williams to produce a final version.

Welcome to Apollo . . .

It’s more than just a stage

It’s a legacy fulfilled, at the Apollo

Brown heard about the contest from Williams’s Facebook page. Williams encouraged him to submit a song.

Brown’s piece has a slightly less infectious hook than Williams’s, but is a little faster and funkier.

Future legends future stars

It’s time to show them who you are

Charles Mack, an Apollo producer who also will sing both songs, said Brown’s piece transports him to a New York City nightclub, while Williams’s takes him to Carnegie Hall. “I wish there was a way we could combine both songs and make that the new theme song,” Mack said.

During rehearsals, Williams counseled the Amateur Night Band players on last-minute tweaks to his song. He wanted it less mellow, more “pushy and jumpy.” He sang out the notes in a riff for the bass player to try. Yet the piano player from Southeast never touched a keyboard himself.

And now the moment of truth is at hand. Williams and Brown stand together in the wings, looking slightly sick. They hug. Nearby are two giant $5,000 checks — one made out to Williams, one to Brown. The crowd’s cheers will be given equal weight with a second round of online voting that has just closed.

The band plays the songs, first Brown’s, then Williams’s. The men are called to center stage, and the crowd is asked to cheer each in turn. The results on the Apollo’s famous Noise Meter screen are clear, and so is the online voting.

“Ladies and gentlemen, we have a winner,” says the emcee. “Clifton Williams!”

When he steps off-stage, the amateur performers waiting to go on look at him with a kind of awe.

“That song is smooth,” one says.

“Can we have $500?” says another.

And when Williams tells them, “All you guys have a great show tonight,” it is like a blessing not from another amateur, but from the Apollo itself.

“I just want to get to 60 or 70 years old,” Williams says, “and go to the show and hear the song I wrote when I was 22 years old. What an honor.”