Hello,

We noticed you're browsing in private or incognito mode.

To continue reading this article, please exit incognito mode or log in.

Not an Insider? Subscribe now for unlimited access to online articles.

Intelligent Machines

Deep-Learning Machine Listens to Bach, Then Writes Its Own Music in the Same Style

Can you tell the difference between music composed by Bach and by a neural network?

Johann Sebastian Bach is widely considered one of the great composers of baroque music. Bach lived and worked in Germany during the 18th century and is revered for the beauty of his compositions and his technical mastery of harmony and counterpoint.

One form of music that Bach excelled in was a type of polyphonic hymn known as a chorale cantata. These are based on Lutheran texts and sung by four voices. The composer starts with a well-known tune which is sung by the soprano and then composes three harmonies sung by the alto, tenor, and bass voices. Bach wrote over 300 short chorale compositions.

These compositions have attracted computer scientists because the process of producing them is step-like and algorithmic. But doing this well is also hard because of the delicate interplay between harmony and melody. That raises an interesting question: could a machine create chorales in the same style of Bach?

Today we get an answer thanks to the work of Gaetan Hadjeres and Francois Pachet at the Sony Computer Science Laboratories in Paris. These guys have developed a neural network that has learned to produce choral cantatas in the style of Bach. They call their machine DeepBach (see also “AI Songsmith Cranks Out Surprisingly Catchy Tunes”).

“After being trained on the chorale harmonizations by Johann Sebastian Bach, our model is capable of generating highly convincing chorales in the style of Bach,” say Hadjeres and Pachet. Indeed, about half the time, these compositions fool human experts into thinking they were actually written by Bach.

The machine-learning technique is straightforward. Hadjeres and Pachet begin by creating a data set to train their neural network. They begin with 352 chorales composed by Bach and then transpose these to other keys that lie within a predefined vocal range, to give a data set of 2,503 chorales. They use 80 percent of these to train their neural network to recognize Bach harmonies and the rest to validate it.

The machine then produces harmonies of its own in the style of Bach. The team tests the device by giving it a melody, which it then uses to produce harmonies for three other voices, the alto, tenor, and bass.

While other algorithmic approaches can also do this, an important question is how well they all compare with Bach’s work. To find out, the team asked more than 1,600 people to listen two different harmonies of the same melody. More than 400 of them were professional musicians or music students. Each had to determine which of the two harmonies sounded more like Bach. The team also included harmonies produced by other algorithms in this test.

The results make for interesting reading. When given a DeepBach-generated harmony, around half the voters judged that it was composed by Bach. That’s significantly higher than with music generated by any other algorithm. “We consider this to be a good score knowing the complexity of Bach’s compositions,” say Hadjeres and Pachet.

Even when confronted with music composed by Bach himself, participants only judged that correctly 75 percent of the time.

That’s interesting work that has fascinating implications. If it is possible for a deep-learning machine to produce chorales in the style of Bach, then why not also in the style of other composers and perhaps even other styles of music?

That could provide an interesting way to analyze compositions and to study the nature of creativity. “This method is not only applicable to Bach chorales but embraces a wide range of polyphonic chorale music, from Palestrina to Take 6,” say Hadjeres and Pachet.

In many cases, that will be easier said than done. Bach’s chorales are highly structured and follow specific rules in their construction, albeit a great many of them. Other forms of music are not always so organized.

Nevertheless, deep-learning machines from Sony’s labs and elsewhere have begun to produce well-regarded pieces of music. It will come as no surprise if these machines soon begin to take on more ambitious works such as symphonies, operas, and more. Bach would surely have been amazed!

Ref: arxiv.org/abs/1612.01010: DeepBach: A Steerable Model for Bach Chorales Generation

Want to go ad free? No ad blockers needed.

Become an Insider
Already an Insider? Log in.

Uh oh–you've read all of your free articles for this month.

Insider Premium
$179.95/yr US PRICE

More from Intelligent Machines

Artificial intelligence and robots are transforming how we work and live.

Want more award-winning journalism? Subscribe to Insider Plus.
  • Insider Plus {! insider.prices.plus !}*

    {! insider.display.menuOptionsLabel !}

    Everything included in Insider Basic, plus the digital magazine, extensive archive, ad-free web experience, and discounts to partner offerings and MIT Technology Review events.

    See details+

    What's Included

    Unlimited 24/7 access to MIT Technology Review’s website

    The Download: our daily newsletter of what's important in technology and innovation

    Bimonthly print magazine (6 issues per year)

    Bimonthly digital/PDF edition

    Access to the magazine PDF archive—thousands of articles going back to 1899 at your fingertips

    Special interest publications

    Discount to MIT Technology Review events

    Special discounts to select partner offerings

    Ad-free web experience

/
You've read all of your free articles this month. This is your last free article this month. You've read of free articles this month. or  for unlimited online access.