Saturday, March 13, 2010

Language, Metal and AI Composers

I'd long ago heard of David Cope and never got around to checking him out, but didn't realize he was using software to compose. (The article has samples). If you're already familiar with Cope you can skip this excerpt:
The best way to replicate Bach’s process was for the software to derive his rules — both the standard techniques and the behavior of breaking them. Cope spent months converting 300 Bach chorales into a database, note by note. Then he wrote a program that segmented the bits into digital objects and reassembled them the way Bach tended to put them together...[The computer program] produced thousands of scores in the style of classical heavyweights, scores so impressive that classical music scholars failed to identify them as computer-created.

So what it looks like from this brief review is that Cope's software inducted patterns from Bach's ouvre, determined what "rules" Bach was following, and then turned around and produced more work based on those rules. This is the first point from this article that fascinates me. For years, a back-burner idea I've had as a fan of the metal genre is to write a program that does exactly the same thing with metal riffs, if not entire songs. (Metallica fans: did you have your heart broken trying to get into Trivium after they were supposedly writing old-school Metallica songs? Me too. If Trivium and Metallica won't do it, maybe Skynet will. Blackened Part II would be a good song for Skynet to play on Judgment Day.) What's stopped me is I would have to know something about programming to do it, and I haven't set aside time to learn enough PERL or Python or whatever would be the best language for the project. Maybe Cope will share his software.

A second point of interest is that one of the problems that Cope ran into was that there was structure - rules subject to (more difficult) induction - below the structure that he initially examined. It would be like trying to predict the movement of the stock market entirely from its behavior, and nothing else; yes, it does have some predictable behavior patterns over time (despite what fundamentals fundamentalists will tell you) but not enough to make a decision entirely based on (despite what the technical snake oil salesman will tell you). If you're only looking at "short-term" melody, I imagine you'd run into the same problem. As a result, Cope's software was reproducing Bach melodies, but there was something missing:

Yet as Cope tested the recombinating software on Bach, he noticed that the music would often wander and lacked an overall logic. More important, the output seemed to be missing some ineffable essence...For hundreds of years, musicologists had analyzed the rules of composition at a superficial level. Yet few had explored the details of musical style; their descriptions of terms like “dynamic,” for example, were so vague as to be unprogrammable. So Cope developed his own types of musical phenomena to capture each composer’s tendencies — for instance, how often a series of notes shows up, or how a series may signal a change in key. He also classified chords, phrases and entire sections of a piece based on his own grammar of musical storytelling and tension and release: statement, preparation, extension, antecedent, consequent.

That Cope must necessarily have generated a systematic notation for all these qualities is exciting enough, but of course "reducing" art to such a system will offend more than a few. Forgive the condescension in my attempt to summarize the way the objections from artists usually go: "But like the human spirit, art triggers emotions and is forever unprogrammable and free! You shouldn't try to describe it systematically!" (Translation: "I am not consciously aware of how I do what I do or why I am reacting so strongly. This obscurity of motivation is useful, because as long as this is the case it can not be easily taught or replicated by others, and therefore the status afforded by my rare ability is secure.")

But this approach is generalizable outside music. One of the reasons I find Cope so interesting is that his work in discovering the non-superficial patterns in Bach recapitulates an issue in linguistics: the rules of grammar and morphosyntax have received the most scrutiny so far, but there is clearly more to language than that (think of the rules of rhetoric, the logical development of a topic, and lots of other things that we have no reason to think computers are yet anywhere close to automating). This ability sometimes breaks in humans with other cognitive disruptions. Single sentences from schizophrenics are usually completely coherent, but look at a few dozen strung together, and you notice that something isn't connecting. You can even measure this electrically: wire a healthy person up to an EEG, and when she uses non-content operator words (linguistics nuts-and-bolts, for example, prepositions in English) you can tell by the electrical activity in her brain she doesn't have to work as hard as when she retrieves content words like tree or Korea. But tellingly, in schizophrenics, the linguistic operators are just as hard to pull up as the content words. (And there's another project I haven't yet done: look at speakers of languages with complex topic-marking systems that anticipate the content and function of coming sentences, like Washoe, and see if schizophrenic speakers have more trouble with those markers than healthy speakers. Granted, these days I probably can't find many schizophrenic first-language Washoe speakers so I'll have to go looking elsewhere.) Since Cope was eventually able to pull out the patterns that make Bach Bach, no matter how obscure they initially were, his approach doubtless has applications to pattern recognition in general, in language and elsewhere.

Finally, the article is just as much about the reactions to Cope's work as about the work itself. He's made many people unhappy; in particular I was surprised by Doug Hofstadter's reaction. One can understand the completely practical concern that composers have enough trouble making a living through their craft now, and if eventually There's An App For That, so much for getting paid for manual composition, or at least what will be seen as the pre-industrial inefficient cottage industry of composition. But of course, that's not what motivates most of the furor; what does motivate it is the usually-unstated influence of the persona of a work's producer on people's appreciation of the work. I think most people - not just artistic rubes like me but even professional critics - are dishonest with themselves about the major role this plays in their appreciation of arts of all sorts. For example: who would give a rat's ass about this amateurish impressionist piece unless you knew a chimpanzee painted it? The basic truth of perception is that human minds don't have separable sense channels, and one of those inseparable channels is from episodic memory. That is to say: when you watch a crow flying and hear its call, you don't have to "decide" to integrate the sight of the crow with the sound of the caw; the integration of inputs happens prior to your conscious experience of it, and it's not subject to deliberation. (Don't get too excited about this; in fact your nervous system is also integrating motion, distance, color, and the edges of surfaces in your vision, to the extent that we're still not quite sure how we actually see objects, instead of separate colors, edges, movements, etc.)

But our experiential world is built from sight and sound, and from associations from prior experience. Do you like steak? Imagine that you have a steak dinner with a friend. After the meal, he gets up from the table, walks outside the restaurant to hail a cab, and is run over and killed. Suffice to it say your next steak will not be as enjoyable. But in the set of chemical equations that sum up to cause "perception of eating steak", it's not the steak that's changed, it's you, and (importantly) the change is not even in your taste buds, but in your central nervous system. The same rule that applies to food applies to art. Van Gogh's work is probably somewhat interesting to begin with even if you don't know anything about its creator. But how many people have stood before Starry Night and tried to banish all thoughts of its ear-splicing creator's inner life from their minds? If we're dishonest that this is part of our experience of appreciating art, then of course we'll be disturbed to discover that the notes in a composition were arranged by a computer. A simple blinded listening test might settle the question of to what degree computers can compose beautiful music. If prior experience about people's ability to protect these kinds of beliefs from the truth is any guide, then the people seemingly most confident that computers can't compose will certainly be the ones least likely to agree to such a test.

But this is exactly why Cope's critics should calm down. The composer as part of the work isn't going anywhere. That's why people read the linked article and some even write blog posts about it. The melodies Cope's software produced - that is, that Cope produced - didn't leap from Chaos into our ears fully-formed. They exist because of the passion and hard work of the composer. I'll definitely be listening to more of his work, and of course, part of my enjoyment will come from appreciation of Cope and his accomplishments.

2 comments:

dadabots said...

you premonitions came true sir!
https://arxiv.org/abs/1811.06639
https://www.vice.com/en/article/xwnzm7/this-youtube-channel-streams-ai-generated-black-metal-247

Michael Caton said...

Thanks for posting.I listened for a while to both heavy metal and technical death styles. They do produce music recognizably in those styles but nothing really memorable - if I heard this as a garage band from a developing country I'd believe it, but it still has a ways to go before it selects just for GOOD songs. Granted, most bands can't do that either!