Then up steps Rich Gaito with what appear to be a miniature guitar and accordion. (The guitar, yes, but the other instrument is a concertina, a predecessor to the accordion.) After a brief introduction, he begins to play sea shanties, tunes that sailors have sung for centuries.

The first song is catchy: a tale of blowing one’s pay at a dizzying pace and reenlisting for another voyage. By the chorus, the entire crowd is singing along, full-throated. Gaito smiles, pleased that his shanty had the desired effect. He’s done this to crowds before.

There is something about sea shanties that resonates with a crowd, Gaito, a Kennebunk resident, said in an interview later.

“The music is simple enough that anyone can get it,” he said.

Although Gaito has been learning music by ear since he was a child, he became enamored with sea shanties after attending a music festival while he was in his sixties. There was something about the timeless melodies, the bawdy stories and the history behind the songs that he found intriguing.

Since then, he’s been collecting sea shanties and sharing them with appreciative crowds. When he’s not performing, he often is making his own undersized musical instruments that pack well for summer sailing trips.

Shanties were necessary to relieve the tedium of the nautical life, said Gaito, and they were so commonplace that they tend to be left out of many sailing histories. The songs were something for sailors to look forward to in an otherwise tough career.

“Their lives were a lot of boredom, a lot of work at sea, and when they get to shore, they’d have a big blow-out,” Gaito said.

It’s shore leave and the misadventures that arise that provide fodder for many of the shanties.

But the songs were also vital for the ship’s daily operation, enough so that sailors sometimes were paid extra if they could carry a tune, said Gaito. And a bigger vessel often hired a full-time shanty man for voyages.

Shanties set the tempo for difficult and sometimes life-threatening tasks, he said. On a larger ship, pulling up the anchor could take more than 20 minutes of hard, synchronized pulling. If a sailor got out of rhythm, he could have been killed. A sea shanty helped everyone sync up, and it was easier to hear than regular vocal commands.

The shanties also helped keep the peace by upending the usual social rules in a non-threatening way, said Gaito.

“It was considered okay to make fun of the officer and the captain, so it was a real outlet for the men,” he said.

Since he first began to collect shanties, Gaito has been sharing them, playing for historical societies in southern Maine and at an open mike concert he helps organize at the 1st Parish Unitarian Universalist Church in Kennebunk. He also takes his instruments to New Hampshire for a monthly sea shanty jam at a Portsmouth pub called the Press Room and at the Portsmouth Maritime Folk Festival in late September.

A retired physics teacher, Gaito and his wife sail for about six weeks each summer on a wooden 28-foot boat made by famed Boothbay boatbuilder Roy Blaney. The couple also flies down and charters a boat from Bequia Island in the Caribbean, where they are working on establishing a literacy program.

While he enjoys singing sea shanties to crowds, Gaito finds it much more fun to help crowds sing along. To him, that is the true worth of the sea shanty. There is something about the three to four-chord songs that make many self-conscious listeners join in and sing.

The sing-along is a vanishing part of community life that Gaito would like to preserve, and he believes there is no easier sing-along than a shanty.

“It makes them a part of the music,” he said. “People miss that in this day and age.”

Craig Idlebrook is a freelance writer living in Cambridge Mass.