Husband-and-wife team Robert Lopez and Kristen Anderson-Lopez are no strangers to writing musical earworms. They’ve won Oscars for “Let It Go” from “Frozen” and “Remember Me” from “Coco” and an Emmy for “Agatha All Along” for “WandaVision.” Now they’re reuniting with friends and family, penning “You Are the Music” for the Apple TV Plus animated comedy “Central Park,” which returns to the streamer March 4.

Songwriters Elyssa Samsel and Kate Anderson (Kristen’s sister) invited the duo to write a song, and it was an offer they couldn’t turn down. “The family ties to ‘Central Park’ are huge,” says Anderson-Lopez. Rory O’Malley was in the Broadway show “The Book of Mormon” (which Lopez co-wrote and for which he won a Tony Award), and Josh Gad voiced Olaf in Disney’s “Frozen.” The scripts for the new season of “Central Park” came with four empty song slots. “We picked the one that felt like a stand-alone song, the one that was about music and the one that had our dear friend Josh singing along with our other dear friend, Rory,” Lopez says of the beginnings of “You Are the Music.”

Anderson-Lopez came up with the essence of the song, in which Gad’s character, Birdie, is feeling threatened by O’Malley’s Elwood, who he feels is going to take his job. That motif plays alongside the bigger theme of the episode about competitiveness between Tillerman siblings Cole (voiced by Tituss Burgess) and Molly (voiced by Emmy Raver-Lampman).

As Birdie grabs Cole’s guitar, wanting to help him learn music, Anderson-Lopez says, “I was approaching it as a chord-teaching song, like you put your thumb here for a G and your thumb here for A.” Lopez points out the Easter egg in his wife’s lyrics: “[The chords] and those words are G-AD, which spell out [Josh’s] name.” Says Anderson-Lopez, “I understood fan-girling out to someone in your profession, and you can go to a hyperbolic place with compliments.” Ultimately, the song turns into an appreciation by Birdie and Elwood of what the other is doing — Birdie sees the good in Elwood and no longer considers him competition, and Elwood’s admiration of Birdie is expressed in the music.

While the process of writing the music and lyrics came together in just two days, the Lopezes didn’t see the finished product until a month ago. The visuals feature Elwood and Birdie moving from the park to an animated musical-note background. “The musical notes that they’re dancing along is accurate to what you’re hearing,” says Lopez. “Rarely when animators put music into their drawings is it accurate, but this I was impressed with.”

Anderson-Lopez adds that the visuals were amazing for the song’s bridge, in which Elwood and Birdie, dressed like Elton John and David Bowie, go on the magic musical journey: “The animators take us to fun places in our imagination.”