Skip to main content

Google’s AI lets you make music that sounds like Bach

Watch all the Transform 2020 sessions on-demand here.


A Google Doodle due out later today will use AI to let you create a melody in a style that mimics composer Johann Sebastian Bach. After you pick your key and the music is harmonized, the tune can be shared on Facebook or Twitter or downloaded as a Musical Instrument Digital Interface (MIDI) file. Users can also turn any classical melody they create into a harmonious rock song.

Doodles are drawings or interactive experiences shared on Google.com, often to celebrate noteworthy people or anniversaries of important events.

This is the first Doodle created with artificial intelligence and the first to use tensor processing units, a company spokesperson told VentureBeat in an email. The Doodle is served up with TensorFlow.js and will be available to play with for the first time at 9 p.m. Pacific Time later today and on Google.com for 48 hours.

The Bach Doodle is the product of Google’s Doodle team, its People and AI Research team (PAIR), and the open source Magenta project for making music using machine learning. A Magenta-powered Music Transformer was debuted last December.


June 5th: The AI Audit in NYC

Join us next week in NYC to engage with top executive leaders, delving into strategies for auditing AI models to ensure fairness, optimal performance, and ethical compliance across diverse organizations. Secure your attendance for this exclusive invite-only event.


To make the Doodle possible, the group trained CocoNet, a machine learning model that harmonizes music, using 306 of Bach’s chorale harmonizations.

“[Bach’s] chorales always have four voices, each carrying their own melodic line, while creating a rich harmonic progression when played together,” Google AI program manager Lauren Hannah-Murphy wrote in a blog post. “This concise structure makes them good training data for a machine learning model. So when you create a melody of your own on the model in the Doodle, it harmonizes that melody in Bach’s specific style.”

The Bach Doodle may be the first powered by AI, but it’s not the first tie-up between AI and the Doodle team, as Ryan Germick, principal designer on the Google Doodle team, also oversees the personality team for Google Assistant. That team helps decide how Google Assistant responds when you ask about its favorite color or its taste in music.

This is the latest in a long line of interactive Doodles. To play with a larger list of interactive Doodles, visit the Doodle Archive.