Steve Albini, a rock musician and revered studio engineer who played a singular role in the development of the sound of alternative music in the 1980s, '90s and beyond — recording acclaimed albums by Nirvana, PJ Harvey and Pixies, along with hundreds of others — while becoming an outspoken critic of the music industry, died Tuesday at his home in Chicago. He was 61.

The cause was a heart attack, said Taylor Hales of Electrical Audio, the Chicago studio that Albini founded in 1997.

With a sharp vision for how a band should be recorded — as raw as possible — and an even sharper tongue for anything he deemed mediocre or compromised, Albini was a visionary in the studio and one of rock's most acerbic wits.

On his own, he led the bands Big Black and Shellac, both of which venerated loud, abrasive guitars and snarling vocals. In those groups, and in virtually every project he worked on, Albini clung to punk's defiant do-it-yourself ethic with an almost religious tenacity.

He also long maintained an impish zeal to provoke and offend. Big Black's last, most acclaimed album, from 1987, has a typically unprintable title, and he once dismissed Nirvana — the group that later hired him to record the album "In Utero" (1993), at the peak of their fame, at Pachyderm Recording Studios in Cannon Falls, Minn., — as nothing but "R.E.M. with a fuzzbox."

A withering and prolific critic of the music business's exploitive extremes, Albini wrote a widely quoted 1993 article, "The Problem With Music," describing in clinical detail how naive bands are lured into major-label deals that, in most cases, leave them broke and in debt.

In that article, which was published in the Baffler, Albini laid out a hypothetical ledger for a rock group that had signed a $250,000 record deal, but whose work, according to his math, netted the label $710,000 and the producer $90,000 — and just $4,031.25 for each member.

"The band members have each earned about 1/3 as much as they would working at a 7-Eleven," Albini wrote, "but they got to ride in a tour bus for a month."

However, in the 1990s, when his work as a recording engineer — he scoffed at being called a producer, thinking that term implied control over an artist's work — was in highest demand, Albini made no apology for accepting big checks for recording major-label acts.

His recording approach, for underground bands like the Jesus Lizard and Slint, captured their muscular power with clarity, and brought out a drum sound you could feel in your gut.

Those bands also worked with Albini at their own risk; in those days, he was known for ridiculing the bands he recorded after the fact.

"Never have I seen four cows more anxious to be led around by their nose rings," he wrote after recording "Surfer Rosa," the seminal 1988 album by the Boston-based quartet Pixies, which became one of the defining classics of 1980s alt-rock. (Even so, Albini remained a close friend of Kim Deal, the bassist in that band, and recorded her other project, the Breeders.)

But to those who followed Albini closely, he was far more than a two-dimensional character. He became a champion poker player — winning more than $196,000 at the World Series of Poker in 2022 — and embraced social media, answering questions at great length and often with eye-opening honesty.

In recent years he also surprised many of his followers and detractors alike by revisiting his often-obnoxious past persona with a sense of contrition.

"A lot of things I said and did from an ignorant position of comfort and privilege are clearly awful and I regret them," he wrote on Twitter, the platform now called X, in 2021.

Steve Albini was born in Pasadena, California, on July 22, 1962, and grew up in Missoula, Montana, where his father, Frank, worked as a wildfire research scientist.

He has described his young life in Montana as unremarkable until, as a teenager, he heard the Ramones' first album, a blueprint of punk rock that was released in 1976. Its aggression, simplicity and puerile sense of humor opened up a new world for him.

"It was the first time I felt like there was any part of culture that represented the irreverence and goofiness and kind of mania that my friends and I were displaying," Albini told The Guardian in an interview last year.

He enrolled at Northwestern University in Evanston, Illinois, near Chicago, and began to develop his approach as a provocateur and a self-reliant musician. As an art project, he once stood behind a pane of plexiglass and taunted the audience to throw whatever they wanted at the barrier.

While at Northwestern, he recorded the first Big Black EP, "Lungs" (1982), almost entirely by himself on a borrowed reel-to-reel tape machine. It had cold, echoey, synthetic rhythms, and it sketched out a dark, nihilistic worldview in its opening lines: "The only good policeman is a dead one/ The only good laws aren't enforced."

Big Black soon became a full band — though it continued to use drum machines — and the group's output came to define a particularly raw form of the post-punk vanguard. At its best, on songs like "Kerosene" and "Jordan, Minnesota," the band presented a nightmarish view of America, populated by arsonists, killers and child abusers, set to an impossibly intense, screeching soundtrack.

At the same time, Albini made a name for himself as a splenetic commentator on music. His written work, published in various fanzines, could seem like a form of insult comedy. He dismissed the Replacements' beloved 1984 album, "Let It Be," for example, as "a sad, pathetic end to a long downhill slide."

In the late 1980s, he reached perhaps the height of his provocation with a new band he called Rapeman; the name, he said, was borrowed from a Japanese comic book, though he never denied it was meant to goad the audience. At some shows, the band faced protests. "The really annoying thing," he once said, "was that the majority of the people on the picket line were precisely the kind of people that we would have liked at the gig."

After making "Surfer Rosa," which brought Pixies to wide attention, Albini became an in-demand producer for underground acts like Boss Hog, Superchunk and Urge Overkill. He recorded PJ Harvey's "Rid of Me" (1993) with serrated guitars and — unorthodox for a major album — vocals set notably low in the mix.

He was soon courted by Nirvana for its follow-up to "Nevermind," the album that became a global smash and ignited a revolution in the music business. Before agreeing to work with the group, he sent its three members a letter giving advice and laying out his terms.

"Bang out a record in a couple of days, with high quality but minimal 'production,'" he wrote, "and no interference from the front office bulletheads." He also told them, "I would like to be paid like a plumber" — meaning that he wanted a flat fee and not "points," or a percentage of sales, a common practice among top record producers that Albini disdained as unethical.

But when the album was completed, the band's record label, DGC, pushed for changes, and several of its tracks were remixed by Scott Litt, who had worked with R.E.M. "They waged a publicity campaign to try to shame the band into doing the record again," Albini once told Tape Op, a magazine about audio recording.

He said his reputation had been damaged by the incident, though it was resuscitated when Jimmy Page and Robert Plant of Led Zeppelin recruited him for their 1998 album, "Walking Into Clarksdale."

Since then, he had continued to work as an engineer and producer for countless bands, often at Electrical Audio, his studio; in a 2018 interview, he estimated that he had recorded "probably a couple thousand" albums to that point. Among the most acclaimed of them are records by Joanna Newsom, Nina Nastasia, Neurosis and Will Oldham.

His survivors include his wife, filmmaker Heather Whinna, and his mother, Gina. Complete information on survivors was not immediately available.

When asked by The Guardian last year how he would like his career to be seen if he were to retire then, Albini answered: "I'm doing it, and that's what matters to me — the fact that I get to keep doing it. That's the whole basis of it. I was doing it yesterday, and I'm gonna do it tomorrow, and I'm gonna carry on doing it."

He added, with an expletive, that he didn't care.

This article originally appeared in The New York Times.