GIUSTO Ferdinando Tenducci was an 18th century superstar, a rags-to-riches singing sensation, a seducer, a fugitive, an honorary Scot. Born poor in Siena, he was castrated as a child and went on to become vocal teacher to Mozart in Vienna and admired internationally for his clear and fabulous soprano. Bach wrote for him. Woman flocked to his concerts. “He was noted for his vanity and an extravagance which left him continually dodging his creditors,” notes one tight-lipped biographer.

Tenducci’s voice made him famous but a sex scandal made him infamous: in 1766 he married the 15-year-old Dorothea Maunsell, one of his students, and because he was a castrato the marriage was technically illegal. She wrote a breathless teenage account of their love affair and later, when she bored of the novelty and fell in love with someone else, she went to the courts to have the marriage annulled on the grounds of non-consummation. That she happened to be pregnant at the time was another complicating and seemingly miraculous factor (the father turned out to her next husband: a story for another day.)

Our present story picks up when Tenducci escaped imprisonment by fleeing to Edinburgh and making his home in Scotland. The contrast between a flamboyant, high-spending, law-dodging Italian eunuch and the somber streets of Enlightenment Edinburgh gets even weirder when you think that the music scene he would have encountered in the city pivoted around the activities of the Edinburgh Musical Society – whose members were overwhelmingly freemasons from the Kilwinning Lodge in the Canongate. Catholic superstar fugitive meets masonic ritual? Apparently he took the place by storm.

“The Musical Society was essentially a boys’ club for the great and the good of Edinburgh,” says bassoonist/conductor Peter Whelan, whose Ensemble Marsyas is recreating an entire Society concert at the Edinburgh International Festival next month, with mezzo soprano Emilie Renard taking on the role of Tenducci.

“They were all men, of course. Doctors and lawyers who were skilled amateur musicians.” The Society was founded in 1728 and would eventually commission the beautiful St Cecilia’s Hall in the Cowgate – the building has recently been refurbished as an splendid instrument museum and hosts a whole series of concerts during the festival – but when Tenducci arrived in Edinburgh, the Society was still holding events in Masonic Lodges across the old town.

Actually, he was by no means the only Italian on the scene. To help improve their standards, the Musical Society employed professional string players from the continent, mainly from Italy. This was happening all over the UK: virtuoso violinists imported by Italophile rich Brits, some of whom went home, others of whom stayed to lead our orchestras and create a distinct Italo-Anglo repertoire. Or, indeed, a distinct Scottish-Italo repertoire.

One of the musicians who came to Edinburgh was Francesco Maria Barsanti (c.1690–1775), a composer from Lucca who embedded himself in Scotland rather more than most musicians. He spent eight years (1735–43) writing for the Society, married a Scot (Jenny) and had a daughter (also Jenny) who would become a well-known Scottish actress on the stages of London. The music Barsanti wrote in Edinburgh is really rather good – not just for its Italianate vibrancy and elegance, but for the way it integrates traditional Scottish music.

Here’s an introduction from musicologists Jasmin Cameron and Michael Talbot. “For wind players, Barsanti is the composer of sonatas for recorder and transverse flute; for string players, orchestral musicians generally and historians of the orchestra, he is the composer of concerti grossi and theatre overtures of great originality; brass players know him as a pioneer, within the repertory of published music, of the employment of horns in the orchestra; percussionists and organologists comment favourably on his timpani parts; students and devotees of a cappella music and the stile antico at least know of his motets; historians of Scottish music point to his sensitive instrumental arrangements of national airs.”

That last point is intriguing. There was Barsanti mid-18th century Edinburgh, doing what very few classical composers did before Bartok and Janacek: taking folk tunes and, instead of meddling with them or approximating, respecting them enough to just use them as they were.

“In fact,” writes Michael Talbot, “Barsanti […] valued the tunes precisely for their deviance from the norm” – which is exactly what attracted Bartok to the jagged contours of Romanian and Hungarian folk tunes nearly 200 years later.

Ensemble Marsyas has made a new recording that documents the repertoire of the Edinburgh Musical Society: music by Handel and Barsanti ranging from concerti grossi to old Scots songs. One is a beautiful Barsanti setting of the Burns slow air Logan Water, played by violinist Colin Scobie with fine ornaments and simple swing.

“It’s typical of the range of Barsanti’s music,” says Whelan. “Incredibly Italianate, but when he used tunes he kept them completely authentic. He respected the tunes for their natural dignity. It also speaks of the versatility of players who would be able to jump between styles a lot more than we consider normal today.”

For Whelan there are several points of principle here. One is to draw attention to the historic closeness between "high" and "low" music in Scotland – the fact that players would have been well enough versed in both traditional and classical idioms to jump between slow airs and concerti grossi without flinching. Another point is about ownership. When I spoke to Whelan about his previous Marsyas project – a disc of music by the Bratislavan Irish immigrant composer Johann Sigismund Kusser – he told me: “with classical music in Ireland there can be a feeling that it was something that happened elsewhere.”

Same goes with Barsanti and the Edinburgh Musical Society. “I find it really refreshing to remind myself, as a musician who plays in the Scottish Chamber Orchestra, an orchestra that was set up to explore Viennese music, that we have our own heritage of Scottish 18th century music. That this isn’t only something we appropriated from elsewhere. If you hear this music then you walk down the Cowgate, you can’t see the city in the same way.”

And, emphatically, that heritage depends on immigrants. As identity politics dominate headlines and determine voting habits, here’s yet another reminder of how much we owe to Europe and the free movement of musicians.

“That mix is an essential part of who were are and who we have been for centuries,” says Whelan. “Any notion of a national style? You cannot write out the influence of musicians like Tenducci, like Barsanti.”

Peter Whelan’s Ensemble Marsyas plays the music of the Edinburgh Musical Society and launch their new recording of music by Barsanti and Handel on Linn Records at St Cecilia’s Hall, Edinburgh, on August 8.