Cognitive music: an AI that writes cumbia pop lyrics
How the idea of teaching a computer to write songs took shape at Quanam in 2017, inspired by an algorithm that learned to write political speeches.
Héctor Cotelo tells the story behind a 2017 proof of concept: a basic natural language processing algorithm fed 72 cumbia pop songs. He looks at the computer-generated music projects that existed at the time and explains why he chose to focus on lyrics, five years before ChatGPT brought large language models into the mainstream.
TABLA DE CONTENIDOS
Series «Songwriting with artificial intelligence», part 1 of 3. Part 1 · Part 2 · Part 3
In 2017, Héctor Cotelo built a proof of concept at Quanam: an AI that writes song lyrics, trained on 72 cumbia pop songs (cumbia pop is a Latin dance-pop style hugely popular in Uruguay and Argentina). This article explains where the idea came from and what other computer-generated music projects existed at the time, five years before ChatGPT (released in November 2022) brought large language models into the mainstream.
An algorithm that wrote political speeches
In January 2016 I was on vacation in Piriápolis, Uruguay, scrolling through Twitter, when I came across an MIT Technology Review article asking whether an AI could write political speeches. To my surprise, the answer was yes: Valentin Kassarnig, at the University of Massachusetts Amherst, had taught an algorithm to write them.
Research between client projects
At Quanam we don’t spend all our time on client projects. We often set time aside to research, study and try new things that serve the business but, above all, interest the consultant.
In those hours I started looking into the state of the art in natural language processing (NLP), the field that brings together linguistics and computer science with machine learning and artificial intelligence methods to extract valuable information from text (and even audio) in “human” language.
Besides computing, my other passion is music, so I dug into techniques such as n-grams, part-of-speech tagging, word sense disambiguation (sliding window), genetic programming, generative art and algorithmic art, to see whether they could help me teach a computer to write songs.
Computers that compose: Iamus, Flow Machines and Watson
I found several existing efforts to get computers to compose songs: the Iamus project at the University of Málaga, Wolfram Tones and Flow Machines (Sony CSL); at an event hosted by IBM Uruguay we even heard Watson play cognitive music. Still, I wanted to focus on the lyrics rather than the music, and I wanted something very local, like cumbia pop.
A proof of concept with 72 cumbia pop songs
For the proof of concept I wrote a very basic AI and fed it 72 songs by bands such as Rombai, Márama, el Reja, el Gucci, Monterrojo and Los Fatales, among others, as plain text grouped into verses and stanzas. It sounds like a lot, but it isn’t: Kassarnig’s algorithm was trained on almost 4,000 speech segments from 53 U.S. Congressional floor debates (his code is on GitHub).
Even so, I think it was enough to show the idea was feasible. One of the runs produced a complete cumbia pop lyric, which I published at the time with a question: could it become the summer hit of 2018?
In upcoming articles I’ll explain how the algorithm works.
Héctor Cotelo
Business Analytics & Information Management Consultant