Acid Logic - Pop Culture and humor in one easy to digest package!
home columns features interviews fiction guestbook blogs
The low calorie pop culture web site for people on the go! A production

Can a Computer Write a Hit Song?

By Wil Forbis

These days, you hear a lot about robots and computers taking people's jobs. And it's far from an unfounded worry; robots have been taking people's jobs and computers using artificial intelligence and deep learning algorithms seem poised to start absconding with employment as well. An umbrella organization comprised of Google, Amazon and other companies has even been created to assuage people's anxieties about the machine future.

Whose jobs will the machines take? It's no surprise that it's open season on unskilled labor. And a cursory review of the current state of AI (artificial intelligence) indicates that even white-collar gigs may be computerized. However, many folks  doubt that computers will soon, if ever, take the vocations found in the arts---painting, composing, storytelling and the like. The kind of free flowing creativity needed for these artistic pursuits just seems outside the domain of the "paint by numbers" style of thinking used by computers (if what they do can even be said to be thinking.)

I, ever the contrarian, beg to differ. My suspicion is that creative jobs will indeed fall into the hands of our electronic overlords. Artists, already struggling financially in the modern world, will soon face additional challenges.  

Of course, there are different types of art. It may not surprise anyone that a computer might compete in the realm of esoteric art forms like non-representational painting or fractal inspired computer graphics. Most humans don't really get that stuff so it's easier for artwork to appear "legitimate" in those arenas. We might even expect that computers will create some of the bizarre music found in the outer realms of modern classical composition. But will a computer ever be able to write music people actually want to listen to? Will software ever scribe a hit song?  

Let's step back a bit and first realize that computers have been writing music for decades. Experiments in computer-composed music go back to the 50s and some remarkable achievements have occurred along the way. Composers/scientists like David Cope and Eduardo Miranda have developed computerized systems that have written endless hours of music, some of which is quite pleasant to listen to. Or at least interesting.  

How do they do it? There are many approaches and reviewing all of them is outside the scope of this article. (If you're interested, Miranda's book "Composing Music With Computers" is a good, albeit math-dense, introduction.) But I'd like to walk through a basic music-making process that provides an overview of how computers can compose.  

Let's first consider that melodies are the most initially identifiable element of a song. Melodies are usually derived from scales, which are simply collections of notes that sound good together. One scale, the C major scale, is made up of all the white keys on the piano. The seven notes of this scale have names and, sequentially, those names are...  

C, D, E, F, G, A, B,  

From there, the scale simply repeats again an octave higher. (If you want more detail on this, I recommend my primer, "An Introduction to the Major Scale." ) You can think of the real collection of available notes in this scale, including repeats, as something like  

... C, D, E, F, G, A, B, C, D, E, F, G, A, B, C, D, E, F, G, A, B, C, D, E, F, G, A, B,...  

Of course, as they get lower and higher the notes get harder to hear until they are eventually "invisible" to our ears.  

All righty... so we have seven notes to play with. How do we create melodies from them? This is what human composers have struggled with for eons. Let's try a novel approach and leave it up to dice. First, we'll officially grab the C note as our starting note. Then we'll apply the following rules to six sided dice values.  

1 - Go up one step
2 - Go up two steps
3 - Go up three steps
4 - Go down one step
5 - Go down two steps
6 - Go down three steps  

What does this all mean? Let's say I roll the dice. I get a three which means “go up three steps.” That means I should walk up the scale from C, past D (one step), past E (two steps) to the F. So now I have two notes: C and F. I keep rolling the dice and get the following values: 5, 3, 6, 1, 3, 3, 2,  

By following the rules, my complete collection of notes evolves into: C, F, D, G, D, E, A, D, F  

The next question is for how long should we play each note? We'll keep it simple and say that each note will be played for an equal period, that of half a second. The results of this are captured in this embedded Noteflight software music file. (To play, click the arrow next to the Orange "O".)  


Ok… well, it is a melody. It actually could be something. But it doesn't really scream “hit song.” The melody sorts of jumps around. Maybe we should try to control those jumps with some rules: Every time the dice say we should jump up two or more steps, let's follow that with a drop back down a step. And every time the dice say we should jump down two steps or more we will follow it with a step upward. This will keep us from wandering away from our starting C note too quickly. As a result our melody will be altered to be like this:  

C, F, E, C, F, E, B, C, F, E, A, G, B  

Which sounds like...  


Still not great but it doesn't feel like it's jumping around as much. It seems a bit more like something someone would actually sing.  But it feels like a bunch of notes all crammed together. I’m going to create a new rule. Every time a C note appears, it should be pushed over to the start of a new bar. And the song should end on the C note closest to wherever the melody is. That gives us...  


Far from perfect, but we're getting somewhere. With a few more rules, we could have something memorable.  

Computers, of course, don't use dice to generate songs. But they are great at using similar processes and applied rules to come up with melodies. And computers can work much faster than mere human composers. David Cope's music creation systems, Emmy and Emily Howell, have written thousands of pieces of classical style music, more than human ears have listened to.  

But does being able to create music in general mean a computer can create a pop song? Or is there something special about pop music that cannot be captured by computer algorithms?  

Obviously, one point to consider is that the vast majority of pop music has lyrics and this has some effect on a song’s popularity. If Beyonce’s “Drunk in Love” was instead titled, “I Like Eating My Boogers,” it probably wouldn’t have done as well.  

Pop songs also have an element of what we could call cultural context. For example, the Yeah, Yeah, Yeahs had some hits a while back. Part of their appeal was that they represented a certain kind of gritty, east coast hipsterdom, a quality they were very effective at selling. One of their songs wouldn’t have done as well in the hands of Katy Perry because Perry can’t sell that context. And the inverse is true; the Yeah, Yeah, Yeahs would have flopped with “California Gurls.”  

It’s also true that pop songs are “hooky.” The best ones deliver a melodic punch that hits our musical sweet tooth in an easy to recognize but hard to define way. Will computers ever be able to quantify and replicate this kind of expert tunesmithing? Some progress has been made. European researchers have developed a tool that analyzes pop hits and the uses the data gleaned to predict whether other songs will climb the charts. They describe their process here:

To predict the hit potential of a given song, we used a computer to quantify how similar it is to previous "hits" and "flops." Time frame is important: If you're scoring a song from today, then we will consider the songs in 2011 more important than the songs in the '60s.  

We represent each song using a set of 23 different features that characterize the audio. Some are very simple features — such as how fast it is, how long the song is — and some are more complex features, such as how energetic the song is, how loud it is, how danceable and how stable the beat is throughout the song. We also took into account the highest rank that songs ever achieved on the chart.

It seems possible that computers could use the data gleaned from these experiments to not only predict whether other songs will become hits, but to actually write hit songs.  

I believe that the novelty of a song's timbre is also a component in the success of a song. Timbre is the quality that makes a bassoon sound different from a oboe, or Ed Sheeran sound different from Don Henley, even if they are all sounding the same note. We live in a golden age of exotic timbres as sound engineers whip up new synthesizer sounds, compression algorithms and vocal effects in the laboratories every day. My suspicion is that even if a song is old hat as far as its harmony (chords), melody and rhythms go, it can be saved by a new, yet unheard timbre. Thus, I suspect, a computer could observe trends in timbre and then "guess" what timbre audiences will flock to in the future.  

We also live in an era of burgeoning research into the relationship between music and emotions. Researchers are hooking people up to brain scanners, playing songs for them and seeing exactly how their bodies and brains respond to music. As the data from these experiments emerges, it can be utilized by both human and computer songwriters.  

None of this proves that computers will be able to write pop songs that sound human composed. But maybe they don't need to. I'm reminded of a moment in the Alan Turing biopic, “The Imitation Game,” when an interlocutor asks the math genuis, “Can machines think the way men do?” As Turing answers it becomes apparent there were really two questions in that query. One is, “Can machines think (at all)?” The second is “Can machines think in the manner of men?” In the film, Turing states that machines can think*, but not like men. And so we should consider that computers may be able to write pop songs, but not pop songs that sound as if they were written by men. Perhaps it will be the very foriegn nature of these tunes that will give them their appeal.

* I don't think Turing wasn't saying computers are conscious but rather that they can process information.

With that said, I will make a few predictions here. In the short term computers will be able to not only create melodies, harmonies, rhythms and timbres but also figure out how to make these qualities attractive to our ear e.g. how to use those components to make hits. I think computers will have a greater challenge with the issue of lyrics and cultural context. For a while, they will have to rely on human partners. But over the long term, computers will compose music equal to the work of humans (at least as judged by the marketplace.)

Final note: As I was finishing up this article I stumbled onto this article describing a pop song that has been written by artificial intelligence. The song is embedded into the article. I found the music a little too derivative of the Beatles but, nonetheless, it makes a point. The future is here.

Update (Nov 4 2016) Here's another example of computer aided pop writing. IBM's Watson is making music, one step closer to taking over the world

Update (Dec 23, 2016) While it's not pop, the music of the Melomics artificial intelligence program is worth a listen.

What do you think? Leave your comments on the Guestbook!


Wil Forbis is a well known international playboy who lives a fast paced life attending chic parties, performing feats of derring-do and making love to the world's most beautiful women. Together with his partner, Scrotum-Boy, he is making the world safe for democracy. Email - acidlogic@hotmail.comVisit Wil's web log, The Wil Forbis Blog, and receive complete enlightenment.