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

Dec 16, 2011 by Kurt Kleiner

(PhysOrg.com) -- 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: Microsoft expands ad-free Bing search for schools

add to favorites email to friend print save as pdf

Related Stories

Composing Music For the Next Generation

Nov 01, 2006

Georgia Tech professor and composer Jason Freeman is bringing his musical passion to the Internet and letting his audiences shape the music they’ll hear in performance. The Graph Theory Project is an online ...

Virus takes memories from cellist but leaves music

Nov 15, 2011

(Medical Xpress) -- At a recent meeting at the Society for Neuroscience in Washington DC, researchers revealed a case of herpesviral encephalitis that had destroyed areas of a 71-year-old cellist’s brain. The man, known ...

Physics strikes the right note with classical musicians

Dec 15, 2011

The combination of physics and music might usually prompt images of Brian Cox playing keyboards for D:Ream, but a new trio, consisting of a professor of physics, an internationally renowned composer and an ...

Music in the air

Aug 22, 2011

The days of sitting at keyboard with a pencil and a sheet of manuscript paper to compose music could be long gone with the development of software by researchers from Monash University’s Faculty of Information ...

Recommended for you

Microsoft expands ad-free Bing search for schools

Apr 23, 2014

Microsoft is expanding a program that gives schools the ability to prevent ads from appearing in search results when they use its Bing search engine. The program, launched in a pilot program earlier this year, is now available ...

Growing app industry has developers racing to keep up

Apr 20, 2014

Smartphone application developers say they are challenged by the glut of apps as well as the need to update their software to keep up with evolving phone technology, making creative pricing strategies essential to finding ...

Android gains in US, basic phones almost extinct

Apr 18, 2014

The Google Android platform grabbed the majority of mobile phones in the US market in early 2014, as consumers all but abandoned non-smartphone handsets, a survey showed Friday.

Hackathon team's GoogolPlex gives Siri extra powers

Apr 17, 2014

(Phys.org) —Four freshmen at the University of Pennsylvania have taken Apple's personal assistant Siri to behave as a graduate-level executive assistant which, when asked, is capable of adjusting the temperature ...

User comments : 10

Adjust slider to filter visible comments by rank

Display comments: newest first

Isaacsname
not rated yet 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.

rawa1
1 / 5 (1) 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.
finitesolutions
not rated yet 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.
Husky
not rated yet 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.
vlaaing peerd
not rated yet 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.
Isaacsname
not rated yet Dec 16, 2011
So when are they going to tell us which is which ?

*drums fingers impatiently*
jan_tangring
not rated yet 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.
Deesky
5 / 5 (1) 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?
cartourt
not rated yet 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.
howarddavis3
not rated yet 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.)

More news stories

Is nuclear power the only way to avoid geoengineering?

"I think one can argue that if we were to follow a strong nuclear energy pathway—as well as doing everything else that we can—then we can solve the climate problem without doing geoengineering." So says Tom Wigley, one ...

US urged to drop India WTO case on solar

Environmentalists Wednesday urged the United States to drop plans to haul India to the WTO to open its solar market, saying the action would hurt the fight against climate change.