An artificial intelligence that derives the ideal melody from a written text for a successful song? It sounds like science fiction but it's reality and one day it could be routine.
There is a paper published on Arxiv.org entitled “Conditional LSTM-GAN for Melody Generation from Lyrics“. In this paper, researchers from the National Institute of Informatics in Tokyo describe an AI, a machine learning system capable of setting lyrics to music. Sorry, capable of generating melodies "based on the lyrics". I speak of music that takes into account the right relationship between syllables, notes and the human ear. Consistent music, songs.
“Generating melodies from lyrics has always been a challenge in the. field of both music and AI, because it aims to discover the intimate relationship between beautiful words and the right way to enhance them with sounds,” writes one of the authors. “With the development of accurate databases and data analysis systems, the ability to set a song to music with AI has gradually become concrete.”
Portrait of the perfect song
As we also read in the paper, notes have two main attributes: pitch and duration. Pitch is a property of sound that organizes music on a scale of frequencies, high or low. Duration represents the length of a sound's expression. The most beautiful songs are evidently those that create a perfect alchemy between the characteristics of. syllables that make up the text and the right musical dosage.
Think of the most beautiful couple who would never have seen the light of day if there was an AI that undermined their partnership: Mogol and Battisti.
A song like “An adventure,” for those who remember it, starts off as a winner from the beginning. That “It won't be / An adventure” which marries extraordinarily with notes perfectly tailored to the sound of the words and the state of mind suggested by the literal meaning.
Today the computer can do it
The AI developed by the researchers is a classic "generative adversarial network", or GAN (for those who do not know what it means here is a very useful article) which trains the system to recognize "false songs" generated by the computer. As part of the system learns to recognize them, another part of the system learns to set texts to music and therefore generate "fakes" that are increasingly refined and closer to the real ones.
The researchers started from 25.000 musical pieces from which they took all the music and 20.000 "typical" sequences of union between syllables and sounds.
Hard to understand? Listen to an example of music “composed” by AI:
And here's another one:
The second phase of testing involved humans and concerned the degree of taste compared to these creations. The results showed that the AI has not only developed "respectable" songs (and I therefore think that these are not two examples) but homogeneous with those played by a human being. A blind evaluation of “natural” and “artificial” pieces showed more or less similar satisfaction.
“The development of this artificial intelligence has two purposes: to perfectly mimic human musical creativity, and also to understand how it works,” say the researchers.
The future
I feel a thrill imagining the applications of an AI like this. I try it because I already reluctantly suffer the effects of autotune on modern pieces of music. Imagine writing two nonsense things on a piece of paper, pressing a button and automatically setting lyrics to music, finally turning a microphone out of tune and also adjusting your voice by pressing another button. Practically the death of art.
And yet it moves. In July, the Canadian startup Landr raised € 25 million for its own algorithm which analyzes musical styles to obtain automatic settings to be provided to musicians. OpenAI (Elon Musk) and Google are already testing algorithms that develop music from scratch. Sony is working on an AI drummer who can accompany a band worthily.