Rapper Mac Miller, who was found dead today at the age of 26 of a suspected overdose, had long struggled with substance abuse, a reality of a sometimes tortured life that would reveal itself in his music.

Miller’s most recent album, “Swimming,” was released on Aug. 3 with an autumn tour in the offing, and his new music seemed blissfully pragmatic and smartly nihilistic, with a glad-to-be-unhappy lyrical signature that was irresistible in its sourness. “Every day I wake up and breathe / I don’t have it all, but that’s all right with me,” Miller said on “2009.” On the new album’s “Self Care,” co-written by Dev Hynes of Blood Orange, Miller repeatedly runs at the phrase “Hell yeah, we gonna be all right… I got all the time in the world,” like a miserably merry mantra.

“I just want to be honest and vulnerable, Miller told me in a 2016 interview. “Am I nervous when I’m most vulnerable? Of course, but that’s what I have to do. It’s therapeutic to me. All the walls to whether something is cool or not have to drop. I have to create without any boundaries.”

That’s meant portraying an unutterable darkness in his songs, a fear of himself, and of what lurked deep within the innermost recesses of his soul. Even “Swimming” features one of his grimmest, revelatory tomes in “Come Back to Earth,” along with four more tracks into which Miller poured his misery.

“Come Back to Earth” (from 2018’s “Swimming”)

“My regrets look just like texts I shouldn’t send / I got neighbors, they’re more like strangers… I just need a way out of my head / I’ll do anything for a way out / Of my head.”

Here, Miller seems to perusing optimism and a life more carefree, yet struggles with demons that go far beyond mere addiction. It’s uneasy and discomforting and there is a weary fragility and frankness to Miller when he sing-speaks.

“Ave Maria” (from 2014’s “Faces”)

“I can’t feel my legs, I’m a paraplegic / Lord, I want a fair one with my demons… Born dead, they had to dig up my fetus / And now the devil want to tear me to pieces/I’m a diagnosed insomniac / An astronaut who blasted off into the stars galactic / On top of Saturn, fox-trotting with Velociraptors.”

Despite his silly use of a small dinosaur of the late Cretaceous period, Miller rips through his own vexed vision of Robert Johnson’s hell-hound at the gates with violence, sleeplessness and no good end in sight.

“Bill” (from 2013’s “Delusional Thomas”)

“I’m just a little bit depressed that’s why the winter fit him best / I guess I’m biased to the cold, I mix the Ritalin and sess / Because I like the highs and lows and I also like the checks”

The whole of his “Delusional Thomas” mixtape project reads like William S. Burrough’s “Naked Lunch,” but “Bill,” which features Earl Sweathshirt, in particular sets an ominous tone.

“REMember” (from 2013’s “Watching Movies with the Sound Off”)

“It’s a dark science, when you’re friends start dying/Like how could he go, he was part lion / Life goes on, tears all dryed in / Couple years are gon’ by, bye then / Can you please tell me help me find my friend / I’ll give you anything you need multiplied by ten / I heard he moved to a place where the time don’t end / You don’t need money, all you got is time to spend / Life is short, don’t ever question the lengths / It’s cool to cry / Don’t ever question your strength / I recommend no limits, intricate thought, go ‘head just give it a shot / You’ll remember shit you’ve forgot.”

Like so many of his raps, Miller starts off joyous and jovial, rapt with emotion and flush with success, only to come crashing down when he realizes his life and friends are draining away. A dark classic, and a true emotive center point for Mac’s lyrical mien.

“Missed Calls” (from 2011’s “Blue Slide Park”)

“We run into each other and it’s like we don’t even speak the same language / I guess people always going through changes / Didn’t think I would lose you once I got famous.”

For Mac fans, this is the start – where you knew that riches and rap wasn’t enough for the then-newcomer, and that there would always be hardship and heartache ahead.