Is that Mozart or a machine? Software can compose music in classical, pop or jazz styles

( -- Steve Engels clicks on a file on his desktop and a classical piano piece flows out of his computer’s speakers. He lets it play for a minute or so, and then clicks on a different file. After a short wait, another very similar piece begins to play, echoing but not replicating the original.

The first piece was composed by Johann Sebastian Bach. The second was composed by a computer imitating the Bach piece.With time, a classical aficionado would be able to detect differences between the two: the computer piece lacks an overarching structure and there’s no sense of a musical idea being developed. But it is a surprisingly good imitation – and that’s exactly what Engels, a senior lecturer in the Department of Computer Science, and recent alumnus Daniel Eisner designed the to do.

“This tool allows people to find a piece of music they enjoy. They feed it into the software. It analyzes it and generates music in the same style in real time, forever,” Engels said.

To accomplish this, the program makes a statistical analysis of the original piece of music. Then, for each note it plays, it can predict the likely value of the next note – including its pitch, duration and where it falls on the beat – and choose the next note based on those odds. That note becomes the basis for the next note, and so on until the program is stopped. Similar rules allow it to choose appropriate chords, and even to make sure two musical “voices” – equivalent to the different parts played by two hands on the piano – don’t clash.

Eisner, who plays piano, saxophone and bassoon and also composes, says that the resulting music lacks the structure that a human composer or improviser would provide. But the music retains the flavour and character of the original. So far the program has reproduced ragtime, classical, jazz and pop, and it can do it either as a solo or as an ensemble of different instruments.

The two made a presentation about the program to the Game Developers Conference in San Francisco in March, figuring it might be useful for generating background music for video games. One of its advantages is that it can segue seamlessly from one type of music to another, which would be useful when a character transitions from one part of the game to another.

Eisner says other programs have used similar methods. But all those that he’s aware of have tried to generate music by programming in higher-level concepts, such as scale and chord construction, and by using pre-set rules rather than by letting the program simply predict one note at a time. But Eisner and Engels say the simple approach seems to work best.

Eisner isn’t sure if computers will ever make music to rival human composers: Music obeys mathematical rules, which computers are good at, but music is also an emotional expression, and machines are poor at mimicking that.

See if you can determine whether the musical samples are computer-generated or composed by a human:

Sample 1
Sample 2

Explore further

Creating New Ways for Audiences to Participate in Performance

Citation: Is that Mozart or a machine? Software can compose music in classical, pop or jazz styles (2011, December 16) retrieved 23 August 2019 from
This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.

Feedback to editors

User comments

Dec 16, 2011
I'm going to say the first is the computer-generated track. The walking bass line accompaniment stands out aesthetically in stark/discordant contrast to the mood of the song as a whole.

Dec 16, 2011
It's rather sorta Photoshop modification of master canvas. The difference is minute and the original music piece still sounds more harmonically, at least for me.

Dec 16, 2011
I would be surprised if the first sample is algorithm generated.
The second sample sounds more robotic and seems to play on endlessly.
Or could be both computer generated and I would say the first sample is a better algorithm.

Dec 16, 2011
ragtime is inherintly more breakbeat/jazzy than the other classical part, so the same algorhythm could have been used, the next level would be to not only make prediction on statistics based on the previous note, but combine that with weighted statistics of the original compositions over progressions over say 4 notes weigted with progressions over 8 notes, or maybe another set of notes, say 6 and 12, depending on the BPM statistics of the originals, also the BPM should be taken not as the average of the hole but as progressive sets, as to include the sudden dramatic tempo twists that many of the greater composers use.

Dec 16, 2011
They're both midifiles!!?

How am supposed to recognise a human if all has been quantised down to values of 128?

then again, computers will eventually be more precise in all expressive elements in music, we just have to learn how to use it.

Now invent a piece of software that can improvise in a sensible fashion. That would surprise me more then a good interpretation of a Bach piece.

Dec 16, 2011
So when are they going to tell us which is which ?

*drums fingers impatiently*

Dec 16, 2011
Very funny! They are both machine generated. The reason I am sure is that is some really funny stuff going on occasionally in both of those tracks. Seven seconds into the first there is a disharmony, at 30 seconds there is a syncopation oddly placed. The second track is disharmonuous at 1.09, and then everything goes haywire for a while. If you would edit those passages out? I still believe I would suspect both of being non-human. But I am not sure.

Dec 16, 2011
I concur, I think that they're both synthetically generated.

But this is far from surprising. Isn't most of the crap that passes for popular music these days generated robotically?

Dec 16, 2011
The first one is erratic and terrible, full of dissonance. The second one is CLEARY recognizable AND beautiful.
The fact that people in these comments can't tell the difference makes me sad for humanity.
You are mostly a bunch of musical idiots.

Dec 16, 2011
Cartourt: I hope that you are joking. I'll admit that I liked the first entrance of the fugue in the second example much more than the whole of the first. However, I recognize that that was not music generated by computer, but rather old JS Bach, himself. But then it goes quickly downhill when the second entrance of the fugue is generated by the computer. Well, this sure is encouraging. Its going to be awhile before computers take over the writing of music. (Except for those who can't tell the difference.)

Please sign in to add a comment. Registration is free, and takes less than a minute. Read more