A cutting-edge computer programme has been trained to write songs by experts at Kingston University.

Exploring how machines and humans can work together to create music, the team, working with researchers from Queen Mary University taught the artificial intelligence system 23,000 Irish folk songs for it to analyse and learn from.

They chose Irish folk for its defined structure and the wealth of available songs.

The programme can now create, by itself or collaboratively with a person, tunes following the genre’s conventions.

Dr Oded Ben-Tal, senior lecturer in Music Technology at Kingston University, said: “We didn't expect any of the machine-generated melodies to be very good, but we, and several other musicians we worked with, were really surprised at the quality of the music the system created.”

People can work alongside the programme by inputting initial notes and then selecting from a series of suggestions.

Dr Ben-Tal said: “For beginners, a system like this would help get you started and avoid the intimidating aspect of composing your own tune as you could work interactively together. Meanwhile, an experienced composer could work with the system to generate new ideas by using their own musical concepts as a starting point.

“People are reluctant to believe machines can be creative – it's seen as a very human trait. However, the fact of the matter is, technology and creativity have been interconnected for a long time and this is just another step in that direction.”

Listen to the song below.