No one knew John Legend was coming.

At least, the students from Duke Ellington School of the Arts didn’t know. The singer-songwriter came by the Kennedy Center on Tuesday morning to participate in the launch of the center’s “What’s Going On . . . Now” project, a national arts and digital media initiative to inspire young people to engage in their communities through the arts and to commemorate the 40th anniversary of Marvin Gaye’s “What’s Going On.” Gaye performed the song in 1972 for the Kennedy Center’s inaugural season, which began the year before.

The project will culminate in two concerts at the Kennedy Center on May 3 and 4, at which Legend will perform along with the National Symphony Orchestra and Sharon Jones and the Dap-Kings.

The Duke Ellington School of the Arts Show Choir, along with a small band of other students, was rehearsing for Tuesday night’s performance at the Millennium Stage. In their blue jeans and bright T-shirts with a few stripes of hot-pink hair, they were a shock of vibrant color in the tan-floored and white-walled space. Legend later said the room reminded him of his high school choir room.

They were practicing, of course, “What’s Going On.”

Mother, mother, there’s too many of you crying . . .

Fingers snapped, feet tapped, the two boys on saxophone danced in place and singers nodded along like the tune was a hot new track they’d just discovered, not a song that was released when their parents were in grade school.

Brother, brother, brother, there’s far too many of you dying.

And then Legend walked in. “How are you guys doing?”

The reply was an incoherent jumble of aahs and oohs and giggles, with a couple whispers of “Oh my God!” thrown in.

“You sound good,” Legend said, sliding onto the piano bench. “Can I play with you?”

Julian Spires, a 17-year-old junior on the keyboard, said he felt as if his heart were beating to rib-cracking proportions. But then, he said, “it was chill, relaxed. [Legend] brought this energy like, ‘I’m one of y’all. . . . To be able to sit there but be nervous, but calm . . . it was awesome.”

After the rehearsal, Legend discussed the song and the program. “The Kennedy Center presented this idea, and I couldn’t imagine saying no. This album has been really influential to me. And to do it here, in D.C., where [Gaye] is from, that’s quite humbling.”

The project, he said, encourages the students “to know more about their musical and cultural history so they understand the legacy that they are living. . . . And I like that it’s called ‘What’s Going On . . . Now’ because as they think about now, as they think about what they can do in their communities to make their communities better . . . I think this song, this album and this whole project can inspire them.”

Teenagers will be able to upload art of their own — music, videos, poems, anything, really — to, where they can ruminate on how the issues in Gaye’s song still seem relevant. The Kennedy Center will review submissions, and some will be selected for display on the site. Of those chosen, two young people will win a trip to the Kennedy Center and tickets to the concert May 3.

The educational side of the project costs $250,000 and is funded largely by David and Alice Rubenstein through the Rubenstein Arts Access program. The performances May 3 and 4 are funded separately.

“We came up with this concept, that the themes of that album — war, addiction, poverty, the environment — are issues kids are dealing with today,” said Darrell Ayers, the Kennedy Center’s vice president for education. “So wouldn’t it be great to hear from students about what’s going on now? And this album that was so inspirational to people in 1971 can inspire the next generation.”