A blinking, beeping machine, made from glass and metal and commonly used for entertainment purposes, taught Barenaked Ladies' frontman Ed Robertson a valuable life-lesson.

"This is going to sound really weird, but pinball was an eye-opener for me," Robertson said. "I've been collecting pinball machines for years and years."

Barenaked Ladies, the multi-platinum-selling, Toronto-based pop-rock band that's headlining a show at Mohegan Sun Arena on Saturday, June 27, no longer finds itself with No. 1 singles — a feat it achieved with the 1998 song "One Week." Recent BnL albums haven't sold millions of copies, unlike a stretch of releases from 1994's "Maybe You Should Drive" to "Maroon," from 2000. Some longtime fans still lament the February 2009 departure of singer and co-founder Steven Page, who was arrested for possession of cocaine seven months earlier.

But with "Silverball," a strong 13-song collection released earlier this month, BnL — Robertson, bassist Jim Creeggan, drummer Tyler Stewart and keyboard player Kevin Hearn — sounds rejuvenated. On stage, they perform with all the goofy fun and exuberance of 1999-2000, when you couldn't escape music videos like "Pinch Me," BnL's second Top 20 hit. And Robertson, who still jumps around on stage, makes up raps and improvises lyrics to suit the city they're playing in, said he's having the best time he's ever had on tour. Thanks, in part, to pinball.

Robertson owns an extensive collection of pinball machines. A Metallica-themed table is his favorite (even though he doesn't listen to the band's music). He wouldn't accept the Addams Family machine, a collector favorite, if you gave it to him for free. Robertson is drawn to the randomness of pinball, and the inevitable outcome of every game: No matter how good you are, pinball will defeat you. "I love the mechanics of it," he said. "It's rock 'n' roll under glass. It's lights and sounds and action and physicality."

A few years ago, Robertson started hosting a regular Wednesday night pinball club. "It was Toronto musicians and people in films and television, friends of mine from high school," he said. "It was this cool, eclectic group of people that was all connected through me."

Amid the smiles and whirring machines, he experienced a moment of clarity.

"My faded star, if you will, was 50 to 70 times brighter than a lot of my musician friends could ever hope to aspire to," Robertson said. "I could get up and say, 'We're not at the top of the charts right now. We're not selling millions of records.' But what I really need to do is to look out at 10,000 people in the audience who grew up with our music and who are excited to be there."

But for years, as much as Robertson focused on the music and being a good person and bandmate, he said, "In the back of your mind you're thinking about charts and positions and sales and awards and all of that stuff. It's in there. And when you've had a No. 1 single and multi-platinum and won awards all over the world — when you're not doing that anymore, it's difficult not to compare your current state of affairs with where you once have been."

"Silverball," the album named for Robertson's obsession, starts with an anthemic rocker called "Get Back Up," co-written with Better Than Ezra's Kevin Griffin. On tour, it's the current set-opener. You can't help but hear Robertson's change of heart in its chorus: "You've got a whole stadium at your feet / it's not about victory or defeat."

Griffin, who lives in Nashville, opened BnL shows as a solo performer around the time of "All In Good Time," the group's first album after Page's departure. "He's just a sweetheart," Robertson said. "He's a really smart, funny guy. … When I got together with Kevin, it was so effortless and fun and challenging to write with him. I think it will be an ongoing partnership."

Gavin Brown, who produced "Silverball" and 2013's "Grinning Streak," helps rein in certain songwriting tendencies — like the question of whether or not to add another verse to "Here Before," another "Silverball" song. "I trust his instincts and he trusts mine," Robertson said. "Sometimes it comes down to those moments where I've said what I want to say in this song, and it feels good, I think it's time to bring it home right here. There are other times when he's said, 'I think we need something right there, just a couple of lines or whatever.' Again, I think it's just about serving the song."

On tour, the current openers — '80s alt-rockers Violent Femmes and Colin Hay, the lead singer of Men At Work, who performs solo — fit the BnL vibe perfectly. (Hay and Femmes saxophonist Blaise Garza even return during BnL's set for a version of "Who Can It Be Now?")

And after three decades, the fact that Robertson plays music for a living — a point first driven home during those weekly pinball club meetings — is not lost on him.

"I get to write songs and play music," Robertson said. "That's all I have to do. It came into hyper-focus all at once: Wow, I'm lucky to be doing this. I really love what I do. It really made all of the consternation and second-guessing go away. Oddly, it was pinball that gave me that perspective."

BARENAKED LADIES performs at Mohegan Sun Arena in Uncasville on Saturday, June 27 at 7:30 p.m., with the Violent Femmes and Colin Hay. Tickets are $33.50. Information: mohegansun.com.