2 April 1998

Silicon swing

Teaching computers to play jazz

Can a computer swing? Sure it can, if you hang it up by a rope and kick it hard enough. No, man, what I’m saying is: can a digital cat play jazz? Jazz, the apotheosis of cool, the fiery crucible of 20th-century musical authenticity, the spontaneous outpouring of one man or woman’s artistic self-expression through the irreducibly physical medium of a sax, a trumpet, a piano, a double bass? Yeah – nice. Ah well: that’s one citadel of humanity, surely, that could never be stormed by the creeping hordes of artificial intelligence.

Never? Better think twice, as that well-known jazz artiste Céline Dion might put it. A couple of weeks ago on BBC1’s Tomorrow’s World, Courtney Pine was jamming along on his soprano to the sounds of a computerised jazz quartet. Nothing unusual there: computers have been able to provide adequate, if stiff-backed, accompaniment to practising soloists for years. But then Pine stopped blowing – and another, invisible saxophone continued to play with impressive fluidity and melodic interest across the harmonies, sounding weirdly like the late giant of the alto sax, Charlie Parker. Extraordinarily, this was the work of a computer program, Improvisor, and – crucially – the ghostly sax was not just playing a predetermined line, it was making it up as it went along in real time, just like a real jazz musician does.

The necromancer responsible for summoning up this digital revenant is the jazz musician Paul Hodgson, who has played alto saxophone with such luminaries as Andy Sheppard and Keith Tippett, and who is also a skilled programmer. His interest in the subject began in the 1980s, when he was working as a peripatetic music teacher, trying to teach children how to play jazz. He knocked up a program that, while playing the chords of a song, would analyse the harmony to work out and play a mode for the current stage of the tune (a “mode” is a kind of altered scale). His students could then listen and pick up the appropriate modes as they went along, to give them some basic building blocks for soloing.

In the meantime, Hodgson began to wonder whether he could get the computer itself to generate an interesting solo. And that is where Charlie Parker comes in. “I started analysing lots of Parker solos,” Hodgson remembers, “trying to look for patterns and repetitive structures that he was using, and seeing if I could work out a way in which these solos could actually be put together. I abstracted out sets of variable-length patterns from different solos, and then I started working on ways of applying these patterns to different tunes, to create new solos. And that’s basically what you heard on television.”

Ah yes, “patterns”. In jazz, the term “pattern” can denote a group of notes which a musician learns to play at speed in all 12 keys until it can be instantly recalled during a solo – the notes fall naturally under the fingers, leaving the musician’s brain free to figure out what to play next. Some musicians don’t do any more than this. An unimpressed (or plain envious) jazzer might damn a colleague with the gravelly expletive: “patterner”. In this way, the method of the program Improvisor is close to the way a mediocre musician operates. But does the fact that Parker’s style can be imitated by the computer mean that even the great Bird was a mere patterner himself?

Of course not. “It doesn’t actually tell you how the patterns were created in the first place,” Hodgson observes. “Parker might use similar patterns, but he modifies and sculpts them to the context of the music that he’s playing.” That said, Hodgson has found to his surprise that the computer comes up with phrases that he has never heard Bird use: “It’s actually creating new stuff – and some of it is bloody good. This is an emergent property of the program, and it raises the question of whether Bird’s style could evolve further in cyberspace.” And would the real Charlie Parker have relished the prospect of his electronic spectre haunting the Web and refining his own riffs in future decades? He probably would have said it was wild, and shuffled off to the nearest bar.

Hodgson has concluded that one aspect of creativity is the way an artist chooses patterns and puts them together. “It does apply to painting as well: Picasso and so on,” he murmurs. “You’ve only got to look at 20th-century art and abstract painting to see that there are lots of common patterns that artists are using, and they reappear in different paintings and different forms.” Still, adroit choices of pattern alone do not a jazz artist make. “At the genius level I haven’t learned very much… In fact it’s incredibly difficult to really improvise and there are very, very few people around that can really do it. It’s just so hard.”

So hard, in fact, that even some top-flight commercial musicians can’t do it. The rock alto-saxist David Sanborn (the one on David Bowie’s Young Americans), admitted to the world last year that he doesn’t really improvise, but just strings together blues licks. Yet the reason Sanborn is so popular is not the notes he plays but the sound he makes – that uniquely raspy, squealing voice that writhes around right at the top of his instrument’s range. If you add to Hodgson’s melodic calculations something to account for this idiosyncratic control of timbre in real time, the computation becomes forbiddingly complex. And, of course, any real jazz musician is always listening and responding to what everyone else in the band is doing – which Improvisor doesn’t do. There’ll be no strange-trousered silicon stars of free jazz for a good while – if ever.

Courtney Pine’s own verdict on the computer program was interestingly mixed. Hodgson relates that on the first take, which the BBC didn’t show because of the sax-player’s pungent language, Pine exclaimed that it was “Bloody brilliant!”. Pine currently uses samplers in his live sets, and this, he said, was a more “expressive” development that he could envisage using to expand his sound. But as for replacing human musicians – well, no cigar yet. “You can’t replace the human experience, the human feel,” Pine smiled. “What’s missing, I suppose, is some of the soul, some of the spirit.”

Indeed, Hodgson’s own researches have brought him to the conclusion (a polemical one among the computing fraternity) that the idea of a top-flight artificial musician is an oxymoron. “To create music you have to be alive in the world. It’s not possible.” What he is now looking at instead are ways to use his system to create new musical interfaces – for disabled children, and for artists working in other media: computerised image-tracking could provide an instantaneous soundtrack for a ballet, or future disco queens could alter a record’s sound with flailing limbs. There are noises of interest from the Science Museum and the Millennium Dome.

In a way, this work has pleasingly come full circle: from trying to replicate human creativity electronically, to producing an electronic tool that can be used to enhance human creativity. This will be a relief to people who prefer to snap their fingers at a real, groovy-shirted person on stage, rather than nod their heads at an offensively beige, Microsoft-infected lump of extruded plastic. And Phil Hodgson goes further to sound a blue note of warning: “Maybe there’s an in-principle limit to what we can do. It’s our quest to eat from the tree of knowledge and be completely knowledgeable about everything in the world – and in so doing, what we could easily do is destroy it, by building things that don’t have any spiritual consciousness and become out of our control.”

With that unpalatable scenario ringing in our ears, perhaps it’s best to go back to the old records again. After all, a computer might study “Ornithology”, but it’ll never know how it feels to fly.