LONGPORT, N.J. — The hills are still alive, even during an unending pandemic.

That’s what Atlantic County resident Doug Farrell and his friends and family wanted to convey to their beach town of Longport on Saturday as they donned homemade costumes and filled the streets, if not the hills, with The Sound of Music.

Lip-synching behind face masks, Farrell and friends staged a musical in the crosswalk at Longport’s only lighted intersection, dancing to numbers from the beloved show whenever the walk sign came on.

Stopped drivers watched in confusion and wonder, many smiling, laughing, or singing along. Farrell, dressed as the character Maria, ran up to a group of motorcyclists and handed them flowers. His grandchildren handed out programs and held up a sign identifying the show as a crosswalk musical.

“I really believe that our little town of Longport, because of COVID, needed a little joy today. So we wanted to spread a little joy,” said Farrell, 69. “Everybody had these big smiles on their faces. They were so happy that they were part of the audience, and especially when they got to join in, because everybody knows those songs.”

Their performance was inspired by a segment called “Crosswalk the Musical” on The Late Late Show with James Corden, in which the comedian rushes stars in and out of crosswalks during red lights in hurried but spectacular renditions of musicals such as Les Misérables, Frozen, and, yes, The Sound of Music. Farrell loves the comedian and said he studied Corden’s videos leading up to his own show.

“All eyes are on you. Once you get out there, I mean — a lot of people are a little hesitant to make the first step off the curb, and I said, ‘Come on, we’re together. We can do this,’” said Farrell, who has had multiple myeloma, an incurable blood cancer, for 15 years. “Life for me is all about: Don’t hold back, let’s just kick it in gear and let’s have some fun.”

His troupe used the crosswalk at 33rd and Atlantic Avenues for four numbers: “The Sound of Music,” “Do-Re-Mi,” “Edelweiss,” and “So Long, Farewell.” Farrell’s three children, four grandchildren, and friends provided support; one blasted the music from a speaker and another was in charge of calling out when the stoplight changed.

“It wasn’t the swirling winds on the top of the mountain,” Farrell said, “but when we hit the first step off that curb to that song, you know, ‘The hills ...’ that really charged my energy up ... and I knew everybody with me was feeling all that power, too.”

Some passersby asked for more songs and whether the group would stage another show, according to Farrell. He said that they would consider doing another, and that they had chosen The Sound of Music for their first because the music is so well-known.

“Things like this restore my faith in people. They put smiles on so many faces,” said Patricia Meagher-Walker, 69, of Mays Landing, who passed by the show on her way to the beach.

Her niece, Kelli Kammer, 56, also of Mays Landing, added: “This so much made my day. I love The Sound of Music and it was so fun seeing this.”

The beloved classic offers a story of hope and love amid the Nazi threat of World War II. For Farrell and his wife’s generation, he noted, the coronavirus pandemic has been the “most serious time in our lives.”

“Let’s face it. A bomb dropped on all of us in mid-March,” said Farrell, a retired podiatrist who has lived in Longport for 39 years.

Their crew had been talking about the idea since Christmas, but they decided the show must go on this summer because of the gloom brought by the pandemic. “People need direction, and ... you don’t want people walking around glum and depressed all the time.”

In recent weeks, they held Zoom meetings to prepare. They planned their safety precautions, including social distancing and masks, chose songs, discussed what they would do if the police showed up to shut it down (they didn’t), and practiced in Farrell’s driveway.

Aware that singing has been shown to spew more potentially infectious droplets than talking, the troupe did not sing, wore face masks most of the time, and spaced themselves apart.

As the organizer and self-appointed “James Corden,” Farrell took on the star role of Julie Andrews’ Maria in an apron and blond wig, but he also played Capt. von Trapp, strolling into the street with a guitar for “Edelweiss.”

He couldn’t pass that special song up. He remembers his little girl playing the movie over and over, watching Christopher Plummer strum the guitar and choke up as he sings that song. And six years after being diagnosed with his cancer, Farrell danced to “Edelweiss” with his daughter at her wedding.

In the movie, von Trapp sings it as a farewell to Austria before his family attempts to escape the Nazis waiting to pull him into military service.

“He first says, this is a love song. ... It’s a love song between anybody and their country. And I think that’s really so apropos to where we are right now,” Farrell said. “If we could all find a song or a moment to all sing in a crowd together ... I think that would be a wonderful thing.”