Both Stevie Wonder and Beck found their way to the French Quarter for a bit of fun Saturday night after thunderstorms washed out their scheduled shows at the 2016 New Orleans Jazz and Heritage Festival.

Wonder performed a sort of stream-of-consciousness mini-concert at trumpeter Irvin Mayfield’s intimate Jazz Playhouse in the Royal Sonesta Hotel on Bourbon Street.

Beck showed up at Preservation Hall just in time to join a short second-line parade at 1:30 a.m. that also included members of Arcade Fire, My Morning Jacket and the Houston soul band the Suffers.

Wonder has a history of turning up at New Orleans music clubs when he’s in town. He apparently sat in at Mayfield’s club at least once before, in 2009. In 2015, he paid a visit to the jazz club Sweet Lorraine’s. He has also popped into d.b.a. on Frenchmen Street.

He had been slated to close Jazz Fest’s main Acura Stage on Saturday evening. After persistent and severe mid-afternoon thunderstorms forced festival organizers to pull the plug on the remainder of the day’s performances, he made a brief appearance on the Acura Stage. Using a bullhorn — the PA system apparently had already been shut down — he apologized for the cancellation and led a cluster of sopping-wet fans in a brief, a cappella sing-along of Prince’s “Purple Rain.”

It would not be the last time he sang “Purple Rain” Saturday.

Most of the 100 or so seats inside the Jazz Playhouse had been reserved long before a Wonder surprise appearance was even a possibility. Jazz fans had booked tables for what they thought would be a normal night at the club with Mayfield and members of his New Orleans Jazz Orchestra.

But as word got out that Wonder might show up at the Playhouse — Mayfield started alerting members of his staff about 5:30 p.m. — a crowd gathered in the Royal Sonesta lobby and in the adjoining courtyard. Standing room in the lounge was hard to come by as Mayfield led his band through a set of classic and contemporary jazz standards.

Tensions rose as people jockeyed for position. Some in the seats took offense that others were standing, blocking their view.

Mayfield took offense that some folks stood on their chairs.

“This is the last time I’m going to say it,” he scolded at one point. “If you stand on the furniture, you are going to be escorted out of the hotel.”

Hoping to re-establish positive vibes, he said, “When the energy is right, all kinds of special things can happen.”

They scooted through “Bourbon Street Parade” and led a “You Are My Sunshine” sing-along that segued into “I’ll Fly Away.” Anticipation mounted.

Surrounded by staffers, Wonder was finally escorted into the packed room about 10 p.m., and settled into a chair near the stage that had been cleared of its previous occupant.

“No videoing, y’all,” Mayfield said, to little effect. “No videoing.”

A harpejji, an electronic stringed instrument that is a sort of guitar/keyboard hybrid, was removed from its case and set up near the stage. Wonder eventually made his way to it.

“Let me let y’all know something real quick,” he said. “I’m on a time limit.”

When the Jazz Fest gig was canceled, he decided that “we’ve got to do a little something.”

Thus, he picked up where he’d left off at his brief appearance at the Fair Grounds: with “Purple Rain.” The audience, which continued to swell as more guests gained entrance, sang along.

“Irvin Mayfield on trumpet!” Wonder enthused after a Mayfield solo. Troy “Trombone Shorty” Andrews joined in as well, as did backing vocalists from Wonder’s band.

He interrupted “Purple Rain” to embark on a fresh course: snippets of the New Orleans classics “You Talk Too Much” and “Mother-in-Law,” followed by a few bars of his own “Signed, Sealed, Delivered.”

Mayfield and the NOJO members were scheduled to play big jazz band arrangements of Wonder’s compositions at the House of Blues on Sunday, so they were on solid ground backing him.

After “Signed, Sealed, Delivered,” he got up and headed for the exit. “That was just Stevie Wonder!” Mayfield announced. “Y’all make some noise. Only in New Orleans!”

The departure was just a ruse. Wonder returned to listen, and perform, more. He took a turn on piano, played a bit of harmonica and delivered one of his minutes-long monologues about peace, love and understanding.

Around the time Wonder’s caravan of black SUVs finally pulled away from the Sonesta’s side entrance at 12:30 a.m., the band the Lone Bellow — another casualty of Saturday’s Jazz Fest rainout — was onstage at Preservation Hall as the night’s surprise guest for the “Midnight Preserves” series. Other “Midnight Preserves” acts at the Hall over the past week included Elvis Costello, Sharon Jones, Nathaniel Rateliff & the Night Sweats and Irma Thomas.

Moments after the Lone Bellow concluded their set at 1:10 a.m., Beck entered the club’s carriageway. He joined other musicians and attendees in Preservation Hall’s rear courtyard.

At 1:30 a.m., members of the Preservation Hall Jazz Band emerged from the courtyard to lead a second-line parade onto St. Peter Street. Beck joined in the procession as a spectator.

He was not the only well-known musician in the march.

Arcade Fire frontman Win Butler, who has settled in New Orleans with Regine Chassagne, his bandmate and wife, is essentially an honorary Preservation Hall member at this point. Armed with drumsticks, Butler tapped out rhythms on trash cans as the procession made its way from St. Peter to Royal Street. It turned on Toulouse Street and stopped outside the music club One Eyed Jacks, where a line had formed for the late-night set by saxophonist Kamasi Washington.

The musicians formed a circle in the middle of the street and continued to play, blocking the trickle of late-night traffic. “Papa Was a Rolling Stone” inspired the dancers.

When the mini-concert concluded at 2 a.m., Beck headed north on Toulouse. As he walked, he recalled receiving word at the Fair Grounds that his Jazz Fest show was off.

“It was a bummer,” he said. “We were ready to play.”

But like Stevie Wonder, he found a late-night alternative.

Follow Keith Spera on Twitter, @KeithSpera.