In one of Dewey Lambdin's books [I will present the exact citation in a later post, He has the crew of the frigate Proteus, under the command of Alan Lewrie in 1799 singing it to another hymn. The footnote is that the melody was not regularized to the commonly known one until about 1807 +/-.