The cheerful melody bellowed from the accordion across the dimly lit room, filling me with jittery anticipation. Holding the hands of strangers at my sides, I bounced in a circle to the left and then to the right, doing my best to remember the steps that had just been explained.

I couldn’t control my smile as my newfound partners and I went through the motions to the Dashing White Sergeant. We were stomping and clapping, locked-elbow spinning, stepping along a figure-eight-shaped path and ducking under the outstretched arms of other dancers.

When the song ended, I thanked my fellow dancers and went in search of the water fountain. Just one song into my first Scottish ceilidh, and I was red-faced and sweaty. I was also having more fun than I had imagined.

When my husband and I were planning our trip to Scotland, I e-mailed his cousins who live in Edinburgh. Among a slew of suggestions, they included the idea of dancing at a ­ceilidh, a Gaelic word pronounced KAY-lee that simply means gathering or party, and often features singing and dancing as well.

I mentally put the idea at the top of my list. For me, a highlight of traveling is meeting and talking to new people. In a ceilidh dance, I saw an opportunity to connect with people who call Scotland home and get a taste of the country’s culture in a genuine fashion. The experience didn’t disappoint.

We lucked into last-minute tickets to a ceilidh held every week at Summerhall, an event venue in Edinburgh about a mile south of the Royal Mile.

Before leaving I’d done a quick Google search, which revealed that I was likely to get hot and that wayward dancers have been known to step on toes. I opted for a lightweight dress and close-toed shoes. Aside from that, I arrived with little knowledge about what the actual dancing was like. It wasn’t difficult to learn, though; one of the members of the band playing traditional Scottish music explained how to do each dance before the music began.

I didn’t even dance with my husband during the first few songs. Many dances, such as the Dashing White Sergeant, are done in groups that range in size from three to eight. By forcing you to interact with other people in the room, ceilidh dancing breaks down barriers.

The atmosphere held an electric excitement that I could see on the faces of everyone around me. There’s something supremely satisfying about coordinating your movements in time to music and in sync with everyone around you. Not to mention the hilarity that comes with realizing that the kilt of a burly man floating by me twirled better than the dress of his dance partner.

Most of the more than 100 people who showed up for the dance wore casual clothing and appeared to be as much of a novice as I was. The burly man, however, was among a group of about 10 people who knew the steps to every song and were more formally dressed: the men in kilts and white-collared shirts, the women in dresses.

During a break in the music, I approached one of the kilted men to find out if he was with the band and maybe meant to be a guidepost for newcomers. No, he answered, he and his friends were just regulars. I began to ask more questions, but when music interrupted me, he invited me to get a beer with him and his friends afterward at a bar down the street.

Of course I said yes.

Over a pint, my husband and I were treated like friends as we chatted with the group. They asked me if I’d enjoyed myself and I struggled to find words that would convey how much fun I’d had. Doing the jigs, twirls and do-si-dos had left me bursting with chest-welling happiness that took me back to the elation of being a kid running through a sprinkler.

From their expressions, I knew they understood.

One of the group, David Francis, associate director of Traditional Arts and Culture Scotland, said, “There’s something qualitatively different about ceilidh dancing. The reason why people still dance like that is because it’s sociable, it’s very convivial. The music is a reference back to tradition.”

I agree. On our trip to Scotland, we visited the Edinburgh Castle, encountered a herd of Highland cattle and hiked along the Cuillin mountain range on the Isle of Skye. But ceilidh dancing was easily my favorite part.

And it taught me that there may be no faster way to grow a kinship with someone from a different culture than by taking their hand and stepping together to music.