For Gruff Rhys — the Welsh musician known for fronting the indie rock band Super Furry Animals — a “chance encounter” with South African electronic musician Muzi led to his new solo album, “Pang!” out Sept. 13.

“Two years ago, I could not have ever imagined making this album this way,” says Rhys, who will perform Thursday at the Rooftop at Elsewhere in Brooklyn. “I could have recorded these songs in a similar way to ‘Babelsberg,'” his 2018 solo album. “But I had this chance encounter with Muzi and just kind of discovered there was a completely different way of making these songs work. And I had to jump at the chance to make something unique.”

The two met just last year when they worked together on Damon Albarn’s Africa Express “MOLO” EP in Johannesburg. Rhys initially sent Muzi one song to work on — “Bae Bae Bae” — and the South African put some “futuristic beats” on it, says Rhys. He then invited Muzi to visit him in Cardiff, Wales, where they worked side by side on what would become “Pang!”

“Muzi came and we spent a few days in the studio in Wales, and he kind of completely deconstructed [the songs],” Rhys remembers. “He kept the acoustic guitar and the voice, and then he just revamped everything else and made loops. It was quite exhilarating to me, I’ve never worked that way before. It was dramatically different for me. I loved it.”

Electronic music, however, is not new to Rhys, who has been incorporating it into Super Furry Animals since the band’s early-’90s inception.

“Well, I grew up as a teenager in the 1980s, so I was inspired by hip-hop and techno, and that was kind of the pop music that I grew up with,” he says. “And I’ve always been informed by that, although I’ve kind of gravitated towards more conventional songwriting. But socially I used to go and hang out in a lot of techno clubs.”

And in the UK, rock and electronica were already being mashed up by popular acts.

“I used to listen to lots of New Order when I was growing up,” says Rhys. “I saw them three times as a teenager, and their shows were all over the place. They were using drum machines and synths and then they’d do like a 20-minute guitar version of ‘Sister Ray’ by the Velvet Underground. They were really mixing it up. I think I was listening to a lot of music that combined a lot of different elements.

“I didn’t grow up in a city, so there wasn’t enough people to create subcultures, so I ended up playing guitar in a band with someone like [Super Furry Animals keyboardist] Cian Ciaran, who was an amazing record producer. So it was kind of maybe growing up in a small town and making music with people from different musical backgrounds.”

Rhys says he has known Albarn, who fronts Britpop legends Blur and the “virtual band” Gorillaz, since Blur took Super Furry Animals on tour in 1997.

“He’s been very generous with me, and he’s given me a lot of opportunities, and I’ll be forever grateful,” he says. “I think musically we grew up in a similar music generation and we kind of came of age after post-punk when people were embracing kind of psychedelic melodic songwriting again. I think we both have a love of melody.”

For his US tour, Rhys will be bringing along former Flaming Lips drummer Kliph Scurlock and a sampler, and he says he’ll use film clips to accompany the music. He’s particularly excited to use the city skyline for the backdrop for his rooftop show in Brooklyn.

Super Furry Animals, which has released an album of new material since 2009, is working on a reissue of “Guerrilla,” its third album, released in 1999, which was a success commercially (No. 10 in the UK) and critically (9.5 out of 10 from Pitchfork), “picking out the old songs and some extra tracks.” “So for the moment, we’re just looking back,” says Rhys.

Which is the opposite of what he’s doing with his solo career.

“I’m just concentrating on ‘Pang!’ right now and looking forward to touring that, really,” he says.