There are two keys to understanding Deerhoof tucked into The Magic, the San Francisco quartet’s 13th studio album. The first anchors "Criminals of the Dream," the album’s mutating centerpiece: "You can dream, you can dream, I know you can dream / Things aren’t as bad as they seem!" (The sentiment may arrive on the heels of a song called "Life Is Suffering," but it’s delivered with wide-eyed sincerity where the latter’s tossed out with a wink and a shrug.)

The second’s less coherent, but it’s just as representative. Midway through "Kafe Mania!," Satomi Matsuzaki starts chanting the names of various espresso beverages: "Cappuccino! Macchiato! Affogato! Cortado!" It’s the perfect absurdist refrain for a band that’s always seemed exceptionally caffeinated.

Deerhoof are one of the greatest American rock bands of the last two decades, and they’re the most unorthodox — and underrated — band that warrants that descriptor. They combine Spoon’s consistency, The National’s compositional bona fides, and Deerhunter’s experimental spirit into a single package without earning the regular fanfare all of those bands receive. And while there are a few valid reasons for that celebratory gap — they’re less interested in melody and structure than the element of surprise; Matsuzaki’s singing is an acquired taste; they lack a signature song or album that totally represents their excellence — that doesn’t make it any less of an injustice.

They're insanely talented musicians

No matter your musical values, Deerhoof have something to offer you. They’re inventive enough to sound like a dozen different bands over the course of a single album, but their music remains unique. (You only ever need a few seconds to know you’re listening to Deerhoof.) They’re a classic gateway band, the kind of group that opens doors to dozens of different sounds and scenes and invites their listeners to explore. Stereolab, Sonic Youth, The Velvet Underground, more recent art-rock like No Age and Dirty Projectors, prog and no wave and contemporary classical and the avant-garde: all of it’s in the neighborhood.

There’s also a base of serious musicianship behind all this dabbling — all four primary bandmates are technical wizards, and Greg Saunier is one of the best drummers on the planet. They’re skilled enough to hop on an album with a classical group like Ensemble Dal Niente (on this year’s Balter / Saunier, which is built around a new suite from the composer Marcos Balter) without breaking a sweat or sounding out of place, and their own music is rigorous enough to withstand translation into an entirely different genre. (Balter / Saunier ends with Saunier’s own 20-minute translation of Deerhoof’s work into a dramatic orchestral piece, "Deerhoof Chamber Variations.")

And if you just want to have your face melted, they can do that too. This is a band potent enough to earn an invitation to write material for HBO’s ‘70s rock-and-roll cocaine nightmare Vinyl, some of which ended up making The Magic. (The tracks never ended up on the show, but they almost definitely were intended for fictional proto-punk band the Nasty Bits.)

Three cheers for sonic optimism

The best argument for Deerhoof is the joy that explodes out of every note they write and play. I’m confident it’s impossible to leave a Deerhoof album feeling lethargic or bummed out. They’re too electrified with the possibility of every moment, music and otherwise, and that’s why they can’t help but jump between rhythms and tempos and tones. Even when they’re tackling scary, complicated topics — like on 2014’s La Isla Bonita, an LP that explores the consequences of xenophobia and America’s slow transformation into something unrecognizable — their music resounds with a sort of sonic optimism.

The Magic doesn’t capture the band at their best, their most ambitious, or their most listenable. Still, after enjoying a peak that stretched from 2002’s breakthrough Reveille to 2008’s Offend Maggie, the band has settled into their version of middle age with a surprising amount of concision and focus, and The Magic throws more curveballs than any other album they’ve released this decade. It’s stuffed with plenty of old-fashioned rippers, songs like "Kafe Mania!" and single "Plastic Thrills" built around incendiary riffs and oozing glam-punk swagger. (You could slap the latter onto a hockey arena soundtrack without anyone batting an eye.)

It's like someone dared them to make a Thin Lizzy song, and they pulled it off

But its best songs tap into the band’s dreamy side, the part of them that’s softer and less frenetic. Opener "The Devil and his Anarchic Surrealist Retinue" toggles between battering-ram verses and quiet intermissions that sound like mathy R&B. (The title’s tipping its cap to music critic Alex Ross’ book The Rest Is Noise, a reference that helps to explain why people like me like this band so much.) "Criminals of the Dream" relies on a similar trick, flipping a switch and morphing into a gentle, hopeful ballad at a moment’s notice.

Mid-album highlight "Acceptance Speech" somehow tops them both by suggesting Deerhoof could’ve been a stellar ‘80s arena-rock band in another life. It sounds like someone dared them to make a Thin Lizzy song and watched them pull it off with aplomb. (Their recent cover of Def Leppard’s "Pour Some Sugar on Me" makes a lot more sense in this context.) "We’d love to visit your towns," crows Matsuzaki, like a frontwoman planning a world tour. "We’d love to visit your towns!" If you see them on the highway heading in your direction, do yourself a favor and welcome them with open arms. You shouldn’t pass up a chance to embrace one of the coolest bands still working.