You don’t have to be a horror fan to be well acquainted with some of the 20th century’s classic slasher movie music. Even if you’ve never sat through Psycho, you could probably immediately recognise the screeching murder scene motif, with its plunging, stabbing, atonal chord clusters. Or how about John Carpenter’s theme for Halloween, which takes a relentless, synth-based tempo, adding subtle drone textures and haunted effects to create an unsettling sonic landscape of pursuit and flight. If that’s too tame for you, the Saw films spell out their grotesque imagery with deep wound keyboard stabs, so closing your eyes won’t help; you’ll still see the splitting flesh. This is sound design at its most visceral.

A similar effect, surprisingly enough, is seen in a piece of music composed almost 300 years ago. But this is horror of a different kind, far more immediate kind – a musical response to the agonising pain of a medical operation without anaesthetic.

Between 1676 and 1725, a French virtuoso player of the viola da gamba (a precursor to the modern cello) named Marin Marais was in court service in the Royal Orchestra of Versailles. Marais was a prolific composer – and he experimented with subjects outside the usual musical themes of the day. In a group of compositions called his pièces de caractères he used his skill on the viola da gamba to conjure visions of one of the most brutal surgical procedures of the day. He takes the listener on a three-minute musical journey through the agonising process of lithotomy, an operation to remove bladder stones performed without anaesthetic.

With a deceptively simple series of musical interludes, Marais describes the moment of first sight of the operating table, summoning up one’s courage, the restraints being tied, the incision and introduction of forceps, the drawing of the stone and the flowing of blood, through to the blessed relief of release and bed. Crossed your legs yet?

This was not purely artistic speculation on Marais’ part, as he underwent the procedure in 1720 at the age of 64. Given his position in the Parisian Court, it is likely he was operated on by an eminent surgeon, possibly one of the Collot family, who had eight generations worth of famous lithotomists. Key to the success of the operation was speed, and Marais’ three-minute piece is probably two minutes longer than the actual surgery would have taken.

Marais’ remarkable playing technique would take the instrument to its technical limits in this piece, with unusual harmonies and dissonances. The viola almost becomes a physical actor in its own right as the drama builds, the shivering string work depicting the trembling patient. Where the Psycho theme uses screaming violins to illustrate the stabbing, Marais’ measured viola maintains an elegant narrative distance as the cutting and slicing begins. Given the enormous risk of the operation, the calm restraint feels like the cool, steady hand of a trusted doctor expressing dignified regret at the anguish being caused. Norman Bates he ain’t.

The actions of the surgeon and the emotions of the patient are both conveyed within the same sound context and stripped back to minimal orchestration. Apprehension, rallying of spirit, agitation and ultimate relief all flow alongside the blood.

Marais’s piece was to make an unexpected reappearance in strange circumstances during the 1960’s. Livingstone Records made an LP on behalf of pharmaceutical company Norgine, specialists in purgative products, which included a specially commissioned performance. It was mailed out to GPs as a promotional item – the B side of the record was an advert for a laxative.

The Norgine version is a camp delight, with a portentous American actor solemnly intoning descriptions of the action in the manner of Leonard Nimoy reading Spock Thoughts. The explanations are drawn from Marais’ own notes on the original score, and his extensive annotations were intended to guide the musician as to the mood of the performance. It has to be said, they sound a lot better in the original French than the slightly cod “olde English” adopted by Norgine. There is no evidence to suggest that the annotations would have been read as part of the original performance, so perhaps modern audiences like to have the gore more clearly spelt out.

That’s certainly how it will seem come Halloween when those ghoulish trick-or-treaters knock on your door.