If you live in the Twin Cities area and still think of hip-hop music as a violent, vulgar, degenerative art form — or not an art form at all — then you clearly are not one of the many, many people who have gotten on board with the Soundset festival.

The seventh annual 10-hour rap music marathon returned to Canterbury Park’s grounds in Shakopee with its biggest crowd to date, a diverse and genuinely congenial audience that spoke volumes about the momentum hip-hop has been building for 30-plus years. More than 30,000 people swarmed the sold-out event, making for a few discomforts that were greatly outweighed by the sight of so many people conforming to the oft-maligned music.

Perennial Soundset hometown headlining act Atmosphere played its old anthem “God Loves Ugly” on Sunday as it usually does to celebrate the outsiders in attendance. There were plenty of things about the bulging fest that really were ugly, too: the dirty, dusty grounds (beats muddy, though); the rows and rows of smelly portopots (beats overflowing, though); the omnipresent aroma of marijuana (some would say that beats heavy alcohol consumption), and the callous Los Angeles rapper known as Tyler the Creator (more on him later).

Except for Tyler, though, all those unseemly traits go hand and wristband-covered hand with every big music festival. On the other hand, Soundset offered many positive qualities that set it apart.

“This [stuff] is beautiful,” declared the visibly impressed New York hip-hop vet Nas, who even wore a Soundset T-shirt on stage. “All hip-hop, all day. This is real.”

There were little to no fights in the crowd. There weren’t piles of passed-out fans like at a lot of festivals, a fact helped by the overcast afternoon skies and the lack of anything but Budweiser-branded beverages. There was an unprecedented amount of local talent represented amid the national names. A spirit of community permeated the proceedings, even with more out-of-state license plates in the parking lot and more passports being used for IDs.

“I’m proud to call this home,” Minneapolis-based, Houston-reared rapper Lizzo said during her excitedly received headlining set in the giant Fifth Element tent, another milestone in her booming career.

Soundset also shines in several ways on the logistical front, from its relatively smooth layout — it takes only a couple minutes to walk to the lowrider car show from the graffiti art wall — to the way its two main stages are erected side by side. The music was nonstop Sunday. Well, except for when Tyler the Creator took the stage as EarlWolf with his Odd Future crewmate Earl Sweatshirt and they spent half their set trash-talking the crowd and dropping B-bombs at women.

OK, so your grandmother would not have approved of all the behavior on display Sunday. Minneapolis’ own raunchy rap king Prof obscenely told audience members what he’d like to do to all of them. “We could do it like an assembly line,” he said. And seemingly half the performers touted pot-smoking in one way or another — or, in the case of ’90s vets Cypress Hill, in just about every way you can imagine.

Most questionable of all, Pittsburgh rapper Wiz Khalifa — second-to-last act on the lineup and the fest’s biggest star overall — seemed to gloat about the fact that he had left a jail cell in El Paso, Texas, that morning.

“Are y’all happy I got out of jail?” he asked after his opening song.

No kidding, though, it says something about Soundset’s growing reputation that Wiz even went to the trouble of making it to Shakopee after getting in trouble in Texas. He reportedly hired a private jet to get there. Rap stars don’t do that for just any gig. Especially stoner rap stars.

Here are some of the other high points (nope, not a pun) and low parts of Sunday’s bonanza.

Best of the fest: Nas’ enthusiasm for the event translated into a stellar performance, with the masterful delivery of his entire 1994 debut album, “Illmatic,” enjoyed by old-schoolers and fans not even born in ’94. The other big main-stage standout was one of the newest of the newcomers, Chicago’s Chance the Rapper (age 21), whose horn-laced psychedelic soul-rap lit up the crowd in the early afternoon. And Wiz Khalifa’s troubles did nothing to lock away his energetic stage persona, with an ace live band and moves seriously like Jagger.

Worst of the rest: Tyler the Creator’s rampant taunting of the crowd could have been chalked up to playful baiting, but he actually seemed upset — and had good reason to be. The audience was way more into the two acts (Prof and Chance) that came before his EarlWolf set, and it shrunk in size as dopey tunes such as “Tron Cat” fell with a thud like one of the skateboarders over on the Soundset halfpipe.

The hosts at play: Back in the headlining slot after relinquishing to Snoop Dogg last year, Atmosphere mostly stuck to playing the hits instead of spotlighting its strong new album, “Southsiders.” Slug and Ant and their third partner of late, DJ Plain Ole Bill, brazenly opened with their wicked new title track and rocked the crowd again later with “Camera Thief” and “Kanye West.” Otherwise, their only out-of-the-ordinary tunes were with a couple usual (but welcome) guests: Brother Ali joined for “Cats Van Bags,” and Murs helped revive the Felt track “Dirty Girl.”

Best of the Fifth Element tent: Texas newbie Snow Tha Product — one of the fest’s two other female rappers — showed off some of the most impressive MC-ing skills all day with such fast-tongued gems as “Good Nights & Bad Mornings.” Local vets Toki Wright & Big Cats played one of the mellowest sets of the day, but their thought-provoking, neo-soul-spiked new tunes proved powerful enough to keep the crowd captivated. And from an emotional standpoint, it was hard to beat the sight of local rap star P.O.S. joining Lizzo, his first public performance since enduring a kidney transplant in March.

Biggest (but not best) surprise: Brooklyn trio the Flatbush Zombies drew the largest and rowdiest crowd to the Fifth Element tent, with an impressive contingent of fans rapping along to their songs. But how many songs about weed can one set take before it feels half-baked? Cypress Hill suffered the same problem, but it was harder to resist the guilty pleasure of “Insane in the Brain.”

Ideas for next year: Follow Nas’ lead and have one act deliver a classic album in its entirety every year, including the local candidates (Atmosphere, Brother Ali). Step up the concession stands. Get a cellphone sponsor to erect a station for serviceless fans to use. And would we risk messing with the good thing to expand to a two-day lineup?

See all our Soundset coverage at startribune.com/soundset.