Software Composes Music Inspired by Classic Novels


robot-reads-novels-writes-songs 1

In the movie Her, an intelligent operating system called Samantha composes a piece of music to describe her romantic relationship with human companion, Theodore Twombly. It’s an improbably touching moment, simultaneously demonstrating Samantha’s superhuman abilities and her exquisitely tuned emotional IQ.

According to the movie, set in 2025, powerful AIs like Samantha are due in about a decade. That may seem an unlikely outcome given the nearest contemporary analogs. Siri is improving, for example, but she/he is yet little more than a voice command system for a few smartphone functions and web search.

So, what stands between us and Samantha? A detailed, adaptable comprehension of the subtleties of human language, behavior, and emotion. That might seem a long way away, but already some researchers’ work is setting the stage.

Last year we talked to Saif Mohammad, a researcher at the Canadian Institute for Information Technology, who developed an algorithm, or “emotional analyzer,” to help social scientists mine large collections of written work for emotional trends.

Using responses from tens of thousands of participants connecting words and emotions—joy, trust, fear, surprise, sadness, disgust, anger, and anticipation—the team trained their software to associate thousands of words with emotions.

They then generated an emotional spectrum ranking the Grimms’ Fairy Tales from light to dark, compared novels to fairy tales (the latter are more emotionally charged and generally more positive), and focused the algorithm on written content from countries to track the emotional tenor of each culture over time.

The software may seem more about big data than artificial intelligence, but recently, Mohammad and Hannah Davis of New York University took it a step further—a step that evokes Samantha and Her. They’ve created software that reads text, analyzes the emotional content, and then writes a piece of music about it.

The software, called TransProse, matches tempo and scale to emotional states—octaves vary based on joy and sadness while more emotionally dense sections tend to be paired with shorter and more dissonant notes.

The TransProse website features songs from twelve novels. Peter Pan’s primary emotions are trust and joy, while the primary emotions in Heart of Darkness, The Road, and A Clockwork Orange are (surprise, surprise) fear and sadness.

“The current version of TransProse is just the beginning of our investigation, and we don’t claim to be making beautiful music yet,” say Mohammad and Davis. “This iteration is a starting point to see if we could programmatically translate the basic emotions of a novel into a musical piece that holds the same basic emotional feeling.”

TransProse falls squarely into the category of computers doing things we thought only humans could do. Other examples include robot cars, robot writers, and robot musicians. But is TransProse forerunner to a capable AI like Samantha?

Yes and no. Such software is pushing the boundaries of what we consider human only activities. To anthropomorphize, it’s getting inspired by beautiful works of art and writing emotionally meaningful music. But TransProse (and most other “intelligent” software) still lacks adaptability. That is, it doesn’t learn.

Samantha is able to adapt to her environment by interacting with it. She becomes a better partner to Theodore the more she talks to him. So good, in fact, he falls in love with her. TransProse, on the other hand, is pure brute force programming.

Software engineers determine which word equates to which emotion and write a line of code into the software making the connection. The software doesn’t broaden and deepen this knowledge by reading great works of literature—it’s static, paralyzed, dependent on its programmers to tell it what to do.

Another example? Google’s self-driving car. At the moment, the Google car learns to navigate new situations on the road only if its engineers spot something they haven’t encountered yet and write it into the program. That means that, while they can program for a large number of experiences—they’ll never get them all.

The dream is an adaptive program that learns like a human being.

The programmers merely write some general rules, and then they set the wheels turning. But currently, we don’t have anything like that. The closest thing might be Google’s search algorithm, which analyzes how people interact with search results to refine what it shows. But even Google search is still dependent on us humans.

All that said, artificial intelligence equal to Samantha is nearer now than it’s ever been, and projects like TransProse (and others) will, at the least, inform and maybe even be incorporated into more complex, adaptive software.

A real Theodore Trombly may soon ask his computer, “What are you doing?” And she’ll reply, “I’m just sitting here, looking at the world and writing a new piece of music.”

Image Credit: Steven Depolo/Flickr

Jason is managing editor of Singularity Hub. He did research and wrote about finance and economics before moving on to science and technology. He is curious about pretty much everything, and sad he'll only ever know a tiny fraction of it all.