Crisscrossing the region and beyond with other musicians in an old bread van that had room for his upright piano and bunk beds, Bob McQuillen spent decades revitalizing the tradition of contra dancing, often performing songs he composed.

Beginning in 1973, he wrote some 1,500 tunes, each named for a person, place, or event that provided inspiration. His song “Amelia,” which delighted audiences around the world, was named for the daughter of the flutist in his most recent band.

Carrying a notebook everywhere, he might pull over to the side of the road to jot down a tune, and stop again 10 miles later to write another. Sounding out notes on a mandolin, he captured his first thoughts in a sort of musical shorthand, which he transcribed later. His music was played around the globe, family and friends said, and most anyone who has attended a contra dance has danced to one of his tunes.

“He was a legend, and really anyone who was involved in contra music and dance would know him,” said Gordon Peery, a longtime friend who played with Mr. McQuillen on occasion.

Mr. McQuillen, who was also known
as Mr. Mac, died Feb. 4 in Catholic Medical Center in Manchester of complications from a stroke and a heart attack. He was 90 and lived in Peterborough, N.H.

His contributions to traditional culture brought a National Heritage Fellowship in 2002 from the National Endowment for the Arts. The organization’s online tribute noted that he “once described making music as ‘like being paid to eat ice cream.’ ”

In 1998, he played at Symphony Hall in Boston as a guest of the renowned Irish band the Chieftains. He also received the New Hampshire Governors Arts Award in 1997.

His lessons were ‘very fun and hilarious and exuberant and rowdy and not quiet at all.’

Mr. McQuillen’s self-described “boom-chuck” style of playing piano was as steady as the guiding hand he provided as a longtime teacher of industrial arts at what is now Contoocook Valley Regional High School, family and friends said.

“He was just playing the notes that were needed,” Peery noted.

Deanna Stiles of Danbury, N.H., a longtime collaborator who performed with Mr. McQuillen in the band Old New England, said he “gave the music a driving force without taking away from the melody, which is really just a nice thing, because so many piano players get too flowery and you lose the beat and you lose the melody.”

In interviews for dance caller David Millstone’s 2001 documentary “Paid to Eat Ice Cream: Bob McQuillen and New England Contra Dancing,” Mr. McQuillen offered advice to aspiring musicians. Rule number one: “Keep the beat.” Rule number two: “Beat the hell out of it.”

Born in Newton, Robert C. McQuillen lived with his family in Cambridge and Dedham before moving to New Boston, N.H., when he was teenager. He took piano lessons as a child, and a family friend introduced him to the accordion, which he taught himself to play.

He graduated from Noble and Greenough School in Dedham and spent a semester at Harvard College, but decided it was not the right fit.

While he was serving in the Pacific during World War II, his interest was piqued when fellow Marines played hillbilly music on guitars. After he returned to his family’s New Boston farm, friends invited him to a local dance and Mr. McQuillen started considering pursuing music.

He met Priscilla Scribner at a dance in Peterborough in 1946 and they married a year later. They also became regulars at local dances. At one, he was introduced to legendary traditional musician Ralph Page, whose piano player, Johnny Tromblay, taught Mr. McQuillen a few tricks and helped him acquire his “boom-chuck” style, which Mr. McQuillen called “Johnny’s Moves.”

“The left hand puts down a bass note or notes, the bass line, then the right hand provides the chord accompaniment,” Mr. McQuillen explained in an interview with the NEA. “The ‘boom’ being the left hand providing the bass, the ‘chuck’ being the chord on the right.”

Mr. McQuillen graduated in 1959 from what was then Keene Teachers College and began teaching at Peterborough High School. He taught industrial shop for 25 years and was a substitute teacher for an additional 10 years.

“He had a great twinkle in his eye,” said Sarah Bauhan, of Hancock, N.H., who played music with him and attended the school while he taught there. “He really was a sweetheart, but he was stern.”

Tall, with flowing white hair and black eyebrows, he would stand on a chair and reprimand misbehaving students by name with his booming voice while monitoring the cafeteria. He also was a weight-lifting coach at the school for more than two decades, but all the while he played piano for dances during the summers.

From the early 1970s and into the ’80s, he performed with the bands Canterbury Country Dance Orchestra and New England Traditions, recording with each.

He then formed the trio Old New England, playing with those musicians until just before he died. The band represented New Hampshire at the 1999 Smithsonian Folklife Festival and recorded four albums.

Mr. McQuillen’s wife, Priscilla, died in 1985 of Alzheimer’s disease, and their son William died in 2003.

Although he loved performing, Mr. McQuillen turned down Millstone’s requests to film a documentary about him a few times before relenting. In interviews, he candidly discussed his alcoholism, describing how he stopped cold turkey and used music to help him through the worst of it.

Mr. McQuillen also taught music and his lessons were “very fun and hilarious and exuberant and rowdy and not quiet at all,” said Jane Orzechowski, an Old New England member who recalled watching him teach her children.

In Peterborough, he held court many mornings at Aesop’s Tables, arriving at 8 a.m. and chatting with anyone who stopped at his table.

“He was big about respecting other people, treating them how you wanted to be treated, and I think he really did that,” said his son Daniel of Houston.

A memorial service will be announced for Mr. McQuillen, who in addition to Daniel leaves a daughter, Rebecca Parsons of Kissimmee, Fla.; five grandchildren; and two great-grandchildren.

“He was a humanist and musician, a composer, a teacher, and a showman,” said Stiles, who added that he “did like to call attention to himself, but it was always in fun or always to share something. And he was always full of surprises.”

Asked in the NEA interview what emotions he experiences while performing, Mr. McQuillen replied: “What sort of emotions? Whoopee! It’s a wonderful thing to do and I love doing it!”