What the Bach Doodle is
Celebrating Johann Sebastian Bach appeared on Google's home page on March 21, 2019, the composer's birthday. It is less a game than a musical toy: a miniature theatre with three little Baroque musicians, a row of organ pipes and a blank sheet of music.
You write a melody two bars long. Then a machine-learning model adds three more voices underneath it, in the manner of Bach's four-part chorales. Google called it its first AI-powered Doodle: the harmony is not picked from a list of ready answers but worked out afresh for whatever you wrote, however odd.
How to play
- Click or tap the stave to place notes. The melody is two bars long, in 4/4.
- The flat, natural and sharp switch under the stave changes the next note; and the tempo can be changed too.
- Play lets you hear the tune on its own. The bin clears the page.
- Press Harmonize. Your notes stay black, and the three new voices appear in red, green and blue.
- Afterwards you can go back and edit, try again, share the result or download it as a MIDI file.
You do not need to read music. The sticky notes on the left load ready-made tunes, and the introduction shows what harmony is by playing a real Bach chorale one voice at a time.
Who made it
Three teams inside Google worked on it together: Google Doodles made the theatre, the animation and the interface; Magenta, Google's research group for music and art, supplied the model; and PAIR (People + AI Research) made it run in a web browser.
| Role | People |
|---|---|
| Coconet model | Cheng-Zhi Anna Huang |
| Doodle engineering lead | Jacob Howcroft |
| Art lead | Pedro Vergani |
| UX design | Leon Hong |
| Producer | Colin Duffy |
| Magenta research | Monica Dinculescu, Curtis Hawthorne, Adam Roberts |
| TensorFlow.js | James Wexler, Ann Yuan, Daniel Smilkov, Nikhil Thorat |
| Sound | Silas Hite |
| Doodle team leads | Jessica Yu, Brian Kaas, Ryan Germick |
How it was made
A model that learns by filling gaps
The model is called Coconet, and Magenta's researchers had been working on it since 2016. It was trained on 306 chorale harmonisations by Bach, as written notes rather than recordings. In training, notes were erased from a chorale at random and the model had to guess them back from what was left around them.
It writes new music in the same way: it makes a rough draft, rubs parts of it out and fills them in again, over and over. Because of this it can look both backwards and forwards in the score, instead of committing to each note as it goes.
From forty seconds to two
The first version that ran in a browser needed more than 40 seconds for one harmonisation, according to the team's research paper. A lighter network design and some custom graphics-card code brought that down to about two seconds, and the model's download was squeezed to roughly 400 KB.
Your computer, or Google's
When the doodle opened, it ran a quick speed test. Fast devices did the calculation themselves with TensorFlow.js; slower ones sent the melody to Google's servers. The paper reports that the split was close to even, with a little under half of all harmonisations made on the players' own machines.
Less is more
Tests with people who could not read music shaped the design. Many did not know what "harmony" meant, so the introduction demonstrates it instead of explaining it. Extra controls confused beginners, so they were hidden behind a button of their own.
Johann Sebastian Bach
Bach was born in 1685. March 21 is his birthday by the Julian calendar, which was still in use in his birthplace at the time; by the modern calendar it falls on March 31.
He was an organist as well as a composer, and knew the instrument well enough to inspect and repair it — which is why organ pipes fill the back of the doodle's stage. His chorales, written for four voices — soprano, alto, tenor and bass — are exactly what the doodle's model studied.
Fun facts and small secrets
-
The amplifier is a rock switch
Click the small guitar amplifier marked "JSB" at the bottom right and the stage turns into an 80s rock show, with electronic instruments in place of the Baroque ones. The harmony is still Bach's kind; only the sound and the costumes change.
-
The star button opens an advanced mode
The round button with a star, to the left of the music, unlocks sixteenth notes and a choice of 12 keys. It was hidden on purpose, and Google's paper says 7.6% of sessions found it anyway.
-
The introduction plays real Bach
The opening demonstration uses two bars of the chorale "Ach wie flüchtig, ach wie nichtig", BWV 26 — first the tune alone, then with the other voices added.
-
Three tunes come ready-made
The presets are Twinkle, Twinkle, Little Star, Mary Had a Little Lamb and the opening of the Toccata and Fugue in D minor. They became the three most often harmonised melodies of all.
-
350 years of playing in three days
The research paper counts more than 55 million harmonisations in the first three days and about 350 years of time spent in the doodle, added up over all players.
-
People wrote video game music
When Magenta looked through the melodies, Megalovania from Undertale turned out to be one of the most common, and the Pirates of the Caribbean theme was entered more often than Star Wars. In Japan a favourite was the FamilyMart shop jingle.
-
The melodies became a research dataset
In July 2019 Magenta published the Bach Doodle Dataset: 21.6 million melodies with their harmonisations, anonymous and free to use.
-
It breaks rules Bach kept
Musicians noticed parallel fifths and octaves, which four-part writing is supposed to avoid. The team counted them in its own paper and found far more than in real Bach — and that harmonisations with fewer of them got better ratings from players.
More music to play
Other doodles on the site where you make the music yourself: Doodle Oskar Fischinger, Les Paul’s 96th Birthday and Doodle Celebrating Mbira.
Try the Beethoven puzzle to put scattered bars of Für Elise and the Fifth Symphony back in order.
Sources (10)
- Google Doodles — Celebrating Johann Sebastian Bach
- Google blog — Honoring J.S. Bach with our first AI-powered Doodle
- Google Doodles — Behind the Doodle: Celebrating Johann Sebastian Bach (video)
- Magenta — Coconet: the ML model behind today's Bach Doodle
- ISMIR 2019 — The Bach Doodle: Approachable Music Composition with Machine Learning at Scale
- Magenta — The Bach Doodle Dataset
- Magenta — Visualizing the Bach Doodle Dataset
- Engadget — Google's first AI-powered Doodle is a tribute to Bach
- MusicRadar — Bach is back as an AI Google Doodle
- Classic FM — Google's Bach birthday doodle
























Comments
No comments yet — be the first!