Buzzy Linhart, a journeyman musician who became a freewheeling fixture of the 1960s and ’70s music scene in Greenwich Village, where he collaborated with Bette Midler and Carly Simon, recorded with Jimi Hendrix and inspired a Youngbloods track that grew into a hippie anthem, died Feb. 13 at his home in Berkeley, Calif. He was 76.

Mr. Linhart had long struggled with physical and mental-health issues, which contributed to a roughly decade-long stretch of homelessness in which he lived in cars or on the streets, stayed at friends’ homes and found shelter after-hours inside a Los Angeles smoothie shack. He was back on his feet by the early 1990s, said his son Xeno Rasmusson, but stopped performing in 2018 after he had a heart attack and seizure.

Mainstream recognition eluded Mr. Linhart — “I was born under an asterisk,” he once said — but he drew a cult following for his improvised jam sessions, acrobatic concerts and offbeat lyrics, which he punctuated with yells, scatting and cartoonish noises. Known mainly as a singer-songwriter, he also played piano, guitar, drums and vibraphone, sometimes leaping from instrument to instrument while performing at venues such as the Cafe Au Go Go in Manhattan.

“He would play his guitar wildly,” songwriting partner Moogy Klingman said in a 2006 documentary, “Famous: The Buzzy Linhart Story.” “He would sing scat for 20 minutes, play a vibes solo for 20 minutes, morph one song into another song so by the time he finished a single drum beat he would have done 10 songs to that one drum beat. There was nothing like Buzzy.”

Trained as a percussionist, Mr. Linhart began recording professionally at 16 and came to New York in 1963 to perform with singer-songwriter Fred Neil, whose song “Everybody’s Talkin’ ” became a hit for Harry Nilsson. He went on to appear on dozens of records, including for Tim Hardin, Richie Havens, Buffy Sainte-Marie, Stephen Stills and John Sebastian, a onetime roommate later known as the lead singer of the Lovin’ Spoonful.

In his own music, Mr. Linhart drew on rock, folk, jazz, R&B and Indian influences. His band the Seventh Sons were said to have performed the first raga (an improvised form of Indian classical music) with electric instruments, and recorded a half-hour version — “Raga (4 a.m. at Frank’s)” — for the avant-garde label ESP-Disk. Mr. Linhart spoke of searching for the moment where “telepathy ends, and making music begins.”

He was perhaps best known for co-writing “Friends,” also known as “(You Got to Have) Friends,” which became an unofficial theme song for Midler and appeared in two versions on her 1972 studio debut, “The Divine Miss M.” Written with Klingman, the song was later recorded by Barry Manilow, performed on “The Muppet Show” (with Gonzo accompanied by actress Candice Bergen) and introduced to many younger listeners by Eddie Murphy’s donkey character in the animated movie “Shrek.”

Mr. Linhart also wrote “The Love’s Still Growing,” which closed out Simon’s self-titled 1971 debut and was credited with inspiring the Youngbloods’ 1967 version of “Get Together.” Written by Chet Powers, known by his stage name Dino Valenti, the song reached No. 5 on the Billboard pop chart and was in heavy rotation during the Summer of Love, opening with the lines: “Love is but a song we sing / Fear’s the way we die.”

The Youngbloods version emerged out of a Sunday afternoon session at the Cafe Au Go Go, where singer Jesse Colin Young had gone hoping that he might find rehearsal space for his band. “I walked down the stairs and it turned out to be an open mic,” he told NPR last year. “I thought I would turn around and go home. But Buzzy Linhart was onstage singing ‘Get Together.’ That song just stopped me in my tracks.”

Heading backstage, Young immediately asked Mr. Linhart to teach him “Get Together.” “I started singing it probably three days after I learned it from Buzzy,” Young said in “Famous,” the documentary, “and I haven’t stopped since.”

The second of three children, William Charles Linhart was born in Pittsburgh on March 3, 1943, and raised in East Cleveland, Ohio. His father was a salesman, and both parents were musical, putting on charity shows at churches and Lions Clubs that featured Mr. Linhart and his siblings from a young age.

Mr. Linhart initially adopted the nickname Fuzzy, for the cowboy actor Fuzzy Knight. “It quickly became Buzzy because of his energy,” his son Rasmusson said by phone. “He was always making a sound” and took music lessons from a percussionist in the Cleveland Orchestra.

Before graduating from high school, he joined the Navy to play and compose for a military band, a stint that ended after 18 months with an honorable discharge. Mr. Linhart said that after helping put out a fire at a Washington naval base, he damaged his lungs and “had some sort of a breakdown.”

He was diagnosed with schizophrenia and rediagnosed in recent years with post-traumatic stress disorder — which proved something of a relief, Rasmusson said, as it helped him “understand what he was feeling” after years of mental-health struggles that contributed to his disappearance from public view. “He was always on guard for hurt, for another round of rejection, trauma and mistreatment.”

Mr. Linhart never stopped writing music, although his recording career took a hit with a scathing reviews of his 1974 album, “Pussycats Can Go Far.” Looking for a change, he moved to Los Angeles and did acting and musical work for film and television, playing a nude hitchhiker in the 1974 comedy “The Groove Tube” and writing and performing in Bill Cosby’s short-lived 1976 series “Cos.”

Two years later, a car accident pushed him into homelessness, which lasted until Hugh Romney — an entertainer and peace activist known as Wavy Gravy — helped him find a place to live in Berkeley. Mr. Linhart settled in the city and helped organize a medical marijuana co-op.

His marriages to Elizabeth Johnston and Jeanne Altson ended in divorce, and he was separated from his third wife, Kim Coleman. Survivors include a son from his first marriage, Rasmusson; a son from his second marriage, Jesse Knight; two daughters from relationships, Sara Zahn and Tiffany Rubin; a sister; a brother; and three grandchildren. Another son from his second marriage, Dylan Knight, died in 2016.

Mr. Linhart released several albums in recent years through his publishing company, Buzzart. But to some listeners, no recording could capture the energy of his live performances, which seemed to embody what New York Times music critic Robert Palmer called “the New York speed freak style,” in which late-’60s artists filled “every available hole in the musical fabric.”

“No sooner has he hit an opening chord than his eyes roll back in his head and he begins to bob and weave like a dervish in a trance,” Palmer wrote in 1977. “But one once endured such overachieving regularly in the interests of hearing genuine talent, and Mr. Linhart’s talent is genuine.”