Photo: Scott Strazzante, The Chronicle Photo: Scott Strazzante, The Chronicle Photo: Michael Macor, The Chronicle Photo: Carlos Avila Gonzalez, The Chronicle Photo: Carlos Avila Gonzalez, The Chronicle Photo: Carlos Avila Gonzalez, The Chronicle Photo: Carlos Avila Gonzalez, The Chronicle Photo: Scott Strazzante, The Chronicle Photo: Lea Suzuki, The Chronicle

Inspiration struck Monday evening. Back in the Bay Area after several days sampling trap music in Atlanta, JaVale McGee retreated to his makeshift in-home studio — essentially, a MacBook, keyboard and Beats by Dre headphones — to give the tunes in his mind a platform.

Within two hours, he had made four beats. Tracks deemed worthy will be sent to a rapper or singer of McGee’s choosing — his contact list is loaded with everyone from Grammy Award winners to little-known up-and-comers — for a round of vocals. If the result is up to McGee’s standards, it will be included on an album tentatively slated to drop before Golden State opens the playoffs next month.

“I had just gotten back from Atlanta, so I still had that trap-music vibe,” McGee said of Monday’s producing session. “I had to make sure I got it out when I got to the crib.”

NBA fans know McGee as the Warriors’ newly minted starting center with a knack for blocking shots, throwing down alley-oop dunks and pulling the occasional prank on teammates. They might not be familiar, however, with “Pierre,” the alter ego McGee uses to produce music.

Long just a hobby, making beats has become a passion for McGee as his skills have evolved in recent years. These days, if not playing basketball, hanging with his infant daughter or working on his nonprofit organization, “#JUGLIFE,” McGee is probably networking with recording artists or creating songs on the music-production software, “Logic Pro X.”

Admittedly restless by nature, he refuses to stick to a genre. McGee oscillates between rap, R&B and electronic dance music. A new fan of the storytelling in country music, he wants to start working with a country-music singer or two.

His hope is to build enough connections for music to be his second career once he retires from the NBA. A self-described pragmatist, McGee has no delusions of a mantel lined with Grammy awards. He admits, though, that he has thought about someday displaying a gold record next to his NBA championship ring(s).

“JaVale has real skills,” said Warriors guard Nick Young, who has rapped over several of McGee’s beats. “He may like to joke around, but when he’s in the studio, he takes it serious.”

McGee started producing as a high school junior, when he downloaded a free trial of FruityLoops — a relatively basic music-production program — to his home desktop. Unlike other such software, which simulate the studio experience, FruityLoops — now known as FL Studio — is a music sequencer that closely resembles digital coding.

It was the ideal marriage of two of McGee’s biggest interests: music and technology. To pass the boredom of dorm life in Reno, McGee recorded an album as a freshman at the University of Nevada. Two years later, after going to the Wizards with the No. 18 pick of the 2008 NBA draft, he bought a MacBook and downloaded “Logic,” a far more nuanced program than FruityLoops.

As a young NBA player who made his offseason home in Los Angeles, McGee found himself in the same social circles as some of his favorite producers and recording artists. It was important to him, however, not to rely on his fame as a basketball player to kick-start his music career.

McGee began posting beats to SoundCloud.com under the pseudonym, “Pierre,” a moniker he had chosen randomly after he got tired of strangers seeing his 7-foot frame, asking his name and promptly typing “JaVale McGee” into Google on their iPhones. For a handful of years, he made tracks on his MacBook without many of his friends or teammates knowing about the hobby.

By that point, McGee’s penchant for absentminded follies had made him a regular on “Shaqtin’ a Fool,” a weekly bloopers segment during TNT’s “Inside the NBA.” Teams dissuaded him from publicizing his off-the-court endeavors out of fear that it would fuel his critics.

In September 2016, after joining Golden State as a non-guaranteed training-camp invitee, McGee was pleased to find that his new organization encouraged players to develop themselves as entrepreneurs. As last season progressed, he got more comfortable posting songs and sharing photos to Instagram of himself in the studio.

Now, as he settles in as the starting center of the defending NBA champions, McGee is committed to building a following as a producer. Often on charter flights, teammates see him bobbing his head to a new song he produced. Young, a fan of the burgeoning hip-hop genre of “mumble rap,” often visits McGee’s preferred recording studios in the Bay Area.

“I feel like he’s always working on his music,” Warriors guard Klay Thompson said. “He’s played me a couple of his songs. I’m not going to lie: He’s pretty good.”

If inspiration strikes on the road, McGee calls one of his contacts in the music industry to reserve time in a studio there. Last week, during an off day in Atlanta, he recorded with Big K.R.I.T., a well-known, Southern-style rapper. The team flew back Friday night to the Bay Area, but McGee spent another day in Atlanta to meet with more prospective artists.

“I don’t charge people,” McGee said. “If this was my day job, I would charge people. I’m not doing it for the money. I’m more doing it for the passion and for the music. I just really like making music.”

Connor Letourneau is a San Francisco Chronicle staff writer. Email: cletourneau@sfchronicle.com Twitter: @Con_Chron

Thursday’s game

Who: San Antonio (37-27)

at Warriors (50-14)

When: 7:30 p.m.

TV/Radio: TNT/95.7