A last-minute deal Thursday averted a courtroom showdown over live music between Buffa’s and the flashy former trash company owner who owns the house next door, setting the stage for a two-month trial run of limited performances at the Esplanade Avenue bar.

The compromise seeks to find a middle ground between the longtime neighborhood bar and Sidney Torres IV, the former owner of SDT Waste and Debris Services, who has argued that music at Buffa’s is too loud and can be heard from his home.

“I think it’s a good compromise,” Buffa’s owner Charles Rogers said. “It gives Sidney what he wants and gives us what we need to have.”

Under the compromise, Buffa’s will stop presenting live music on Mondays and Tuesdays. The rest of the week, it will allow live music on a reduced schedule:

On Wednesday nights, music will end by 9 p.m.

On Thursday, music will be permitted until 9 p.m. until a sound-dampening curtain is installed, at which point unamplified two-piece bands will be allowed to keep playing until 11 p.m.

On Friday, the music must stop by 11 p.m.

On Saturday, live music is allowed until midnight.

Live music will be permitted on Sunday before 3 p.m., to allow for jazz brunches.

Torres, who has lived in the mansion next to Buffa’s for 17 years, filed a lawsuit earlier this summer alleging the city erred when it granted the bar a permit that allowed it to host live music.

Leading up to the hearing, Buffa’s gathered affidavits from musicians and patrons to bolster its claim that live music was a regular feature at the bar going back to the 1980s. Establishing that would have been more than enough to qualify for the permit, which requires showing a 10-year history of music at the bar.

Both sides suggested Thursday that they would have prevailed had they gone ahead with a hearing.

Torres said the evidence gathered by Buffa’s would not have been enough to show that live music was a regular feature at the bar for many years. However, he said his goal was to limit and not eliminate live music at the bar.

“My position never was to stop music at Buffa’s,” he said.

For his part, Rogers said he agreed to the compromise in order to be a good neighbor. The bar previously has made adjustments to its schedule and improvements to its soundproofing to reduce the problems the live music caused for Torres.

“It’s a requirement for the way we do business as a family that we’re neighborly,” Rogers said.

Many Buffa’s supporters who packed the courtroom — some of whom perform at the bar and will see their regular time slots eliminated by the deal — were disappointed with the restrictiveness of the agreement. Leaders of the Music and Culture Coalition of New Orleans, which has fought efforts to restrict live music, also said they were concerned about the circumstances surrounding the agreement.

While compromise is “generally a good thing,” the fact that this agreement came as the result of a lawsuit could set a bad precedent or inspire others to use similar tactics, said Hannah Kreiger-Benson, who works with the coalition.

The compromise calls for Rogers and Torres to return to court in 60 days to discuss and potentially change the compromise, though it is not clear what that might entail.

“Let’s get through the 60 days and see how it affects our business and his quality of life,” Rogers said.

Follow Jeff Adelson on Twitter, @jadelson.