Liam O Maonlai sings a beautiful version of this code song. He explains the origin in the first part of the video. Skip to 1:54 if you want to get to the music.
An Raibh tú ar an gCarraig
An raibh tú ar an gCarraig, nó an bhfacaís féin mo ghrá?
Nó an bhfaca tú an ghile agus finne agus scéimh na mná?
Nó an bhfaca tú an t-úll ba chumhra is ba mhilse bláth?
Nó an bhfaca tú mo Vailintín, nó an bhfuil sí dá cloí mar ’táim?
Do bhíos-sa ar an gCarraig, is do chonac féin do ghrá!
Do chonac féin an ghile agus finne agus scéimh na mná.
Do chonac féin an t-úll ba chumhra is ba mhilse bláth.
Is do chonac féin do Vailintín, agus níl sí dá cloí mar ’táir.
Have you been at THE ROCK , or have you seen my Beloved?
Or have you seen the brightness and the clearness and the beauty beyond all women?
Or have you seen the (round white) apple, that was the most fragrant and sweetest of tasting?
Or have you seen my Valentine, or is she as downtrodden as I?
Yes, I was at THE ROCK, and indeed have I seen thy Beloved!
Yes, I saw the brightness and the fairness and the beauty beyond all women.
Yes, I have seen the (round white) apple, most fragrant and sweetest of tasting.
And I have seen thy Valentine, and she is not as downtrodden as thou.
Here’s another explanation to the origin of this story:
One day in Co. Waterford a priest, on his way back from a secret Mass at the Mass Rock, lost the wallet containing the Blessed Sacrament reserved. He wandered, apparently aimlessly, among the townfolk, singing, apparently to himself, these improvised words to a tune that was already very ancient: “An raibh tú ar an gCarraig, nó an bhfacaís féin mo ghrá?” Now any English or Protestant Irish who happened to know some Irish would have understood him to be singing “Were you at (the town of) Carrick, or have you seen my love?” But the natives, knowing him to be a priest and accustomed to the poetic ways of expression so common in the Irish language, knew he was asking them: “Have you been at THE ROCK (Carraig = the Mass Rock) or have you seen the Body of Christ, my Beloved?”