Thanks to a surprise ruling by a federal judge in New York, the cost of the music we listen to in stores, bars, restaurants and on radios and digital services is about to go up.

Judge Lewis Stanton, of the U.S. District Court for the Southern District of New York, ruled the consent decree that BMI, a major American music publisher, operates under, does not prohibit fractional licensing.

BMI and ASCAP license music to radio stations, digital services, bars, restaurants and stores, which enables musicians and writers to be compensated for having their music played in commercial establishments and over commercial airwaves.

Both operate under consent decrees that date back to the 1940s. But before the judge’s decision a few weeks ago, both decrees were believed to prohibit fractional licensing – in which all co-writers of a musical composition would have to agree to have a work licensed.

Instead, they used full-work licensing, in which any co-writer could market the song as long as all the others were compensated. This made it far easier to license works – the average song has more than three co-writers and only one has to negotiate and agree.

This has held down costs considerably over the years by preventing minority writers from withholding consent and driving up costs.

BMI and ASCAP have sought changes to the consent decrees in recent years, but on June 30, the Justice Department, after an exhaustive, multiyear review, announced it would authorize no changes to the current agreements or their interpretations.

The rights organizations claim they’ve been permitted under the consent decrees to engage in fractional licensing all along. But the Justice Department disagreed, basing its findings on the exact language of the consent decrees, contracts between ASCAP and BMI and both songwriters and licensees, sworn testimony, and extensive legal precedence, including a Supreme Court decision.

In addition to the clear language of the consent decrees, the Justice Department weighed in the disruption such a move would bring to the market. It feared a move to fractional licensing would create the same extortion-type practices witnessed in the patent world, where minority owners hold up licensing to exact exorbitant compensation and others, known as patent trolls, seek to buy minority stakes and negotiate for higher returns.

All of these operators would be in on driving up costs for the music licenses businesses have to buy. At a point, the prices become too high for smaller businesses to afford it, and they will turn to other options.

BMI filed suit after the Justice Department ruling, claiming it was unfair and restrained earnings ability for music creators. After hearing oral arguments last week, Judge Stanton suddenly announced he did not think the agreements as written prohibited fractional licensing. The decision affects only BMI for now, but ASCAP, the other industry giant, operates under a similar arrangement and expects to have its agreement re-interpreted to permit fractional licensing now as well.

The Justice Department, which says it has significant legal precedent on its side, is considering whether to appeal to the Second Circuit Court of Appeals, which has ruled in its favor on this matter before. It should do so before the industry is overtaken by upheaval.

This decision could require thousands of legal agreements to have to be withdrawn, redrawn or otherwise changed. It will create unprecedented upheaval in a market that has functioned in much the same way for the better part of a century.

This only vaguely resembles anything anyone would recognize as a free market.

But it is as close as the industry ever has come – it replaced a system so prone to unfair trade practices that both parties worked for reform. And it certainly comes closer to honoring market principles than the extortive copyright trolling that almost certainly will result from the judge’s ruling.

The professional rights organizations – BMI, ASCAP, Universal and others – strongly support the court decision, of course. David Israelite, president and CEO of the National Music Publishers Association, called it a “huge win for songwriters and a huge win for the copyright rule of law.”

But Public Knowledge, a group that says it represents both consumers and musicians, says the Justice Department has it right and the court wrong.

“…Antitrust protections should not be removed at a time when the music publishing industry is more concentrated than ever,” Raza Panjawi, the group’s leader, said in a statement. “The state of the marketplace and recent bad behavior by publishers have made it clear that granting the music publishers the changes they requested would serve as an additional green for additional abuse.”

Obviously, a judge has rushed in where lawyers for decades have feared to tread. Another judge at the appellate level needs to come along and clean this up. Music fans everywhere are counting on it.