Many years ago I directed a play called 'Everyman'[by 'Anon',of course]in the original Middle English. There is a bit towards the end where Everyman whips himself to the cue " In the name of the Holy Trinity/My body shall sore punished be/Take this, body, for the sins of the flesh !" [or some such tosh].
It took a while in rehearsals to work out there had to be a diversion or distraction of some kind as this was being performed in the round and the poor fellow playing the title role really was hurting himself. A good distracting tune and a snap lighting change did the trick. The tune was written by a cast member [Helen Miller]during a lunch break to the instructions: 'Must be in a minor key and be 16 bar AB format' It sounds rather like Bacca Pipes Jig in atmosphere but with a few melodic and chordal differences.
I christened it 'The Scourge' and after the run of the play started playing it in sessions. Some ten years later I heard it in another part of the country, note for note, played as a 'Trad English' tune. The folk process is a remarkable thing.