New Zealand researchers said Monday they have restored the first recording of computer-generated music, created in 1951 on a gigantic contraption built by British genius Alan Turing.

The aural artefact, which paved the way for everything from synthesizers to modern electronica, opens with a staunchly conservative tune -- the British national anthem "God Save the King".

Researchers at the University of Canterbury (UC) in Christchurch said it showed Turing -- best known as the father of computing who broke the WWII Enigma code -- was also a musical innovator.

"Alan Turing's pioneering work in the late 1940s on transforming the computer into a musical instrument has been largely overlooked," they said.

The recording was made 65 years ago by a BBC outside-broadcast unit at the Computing Machine Laboratory in Manchester, northern England.

The machine, which filled much of the lab's ground floor, was used to generate three melodies; "God Save the King", "Baa Baa Black Sheep" and Glenn Miller's swing classic "In the Mood".

But when UC professor Jack Copeland and composer Jason Long examined the 12-inch (30.5 centimetre) acetate disc containing the music, they found the audio was distorted.

"The frequencies in the recording were not accurate. The recording gave at best only a rough impression of how the computer sounded," they said.

They fixed it with electronic detective work, tweaking the speed of the audio, compensating for a "wobble" in the recording and filtering out extraneous noise.

"It was a beautiful moment when we first heard the true sound of Turing's computer," Copeland and Long said in a blog post on the British Library website.

It features short snippets of the tunes rendered in a slightly grating drone, like electronic bagpipes.

There are also a number of glitches and when the music halts during the Glenn Miller number, a presenter comments: "The machine's obviously not in the mood".

While Turing programmed the first musical notes into a computer, he had little interest in stringing them together into tunes.

That work was carried out by a school teacher named Christopher Strachey, who went on to become a renowned computer scientist in his own right.

Strachey recalled that Turing's taciturn response upon hearing his machine play music was "good show".

Turing was a computer scientist, philosopher and cryptologist who played a crucial role in breaking the Nazi's Enigma Code.

As depicted in the Oscar-winning movie "The Imitation Game", he was prosecuted for homosexuality and forced to undergo chemical castration, killing himself in 1954 at the age of 41.

He was officially pardoned by Queen Elizabeth II in 2013.