Print this page

Google’s Bach Doodle and Other Online Tools for Algorithmic Music Instruction

September 20, 2019

lgorithmic composition has a long and rich history, and many people will be familiar with Mozart’s Musikalisches Würfelspiel, Xenakis’ works, or even George Lewis’ work from the 1970s. Google celebrated J.S. Bach’s birthday on March 21, 2019 by introducing a Doodle on their search page that allows people to create a melody and have it harmonized “in the style of Bach.”1Accessible at https://www.google.com/doodles/celebrating-johann-sebastian-bach

Algorithmic techniques can be used for style replication or what is sometimes called “original composition” or “genuine composition.” The Bach Google Doodle is obviously about style replication, and particularly in the harmonization of a melody. The model behind the Bach simulation is a software system called Coconet and there is a more general interface to that called Coucou,2Accessible at https://coconet.glitch.me which I found much more fun to play with.

The Bach Google Doodle allows users to interactively compose a two bar (4/4) melody with quarter or eighth notes and pitches in the key of C between A3 and A5 (across a treble clef).  After creating a melody the user presses the “Harmonize” button to generate three other parts and play them. The engine appears to be a neural network that has been trained with 306 Bach choral compositions to provide it with information to complete the harmonization.

I have worked with many algorithmic methods and I cannot say that the Google Doodle was noticeably better than any other. Certainly Markov models have been used very successfully for style replication before, by Clarence Barlow to cite just one example. Also, I did not find the harmonization from the Google engine to be particularly Bach-esque enough to be convincing. The added parts often showed poor voice leading and would not be easy to sing, as if too much emphasis was placed on the vertical arrangement of the notes. I also thought the harmony was somewhat more simplistic than Bach would use. I did notice that it gave a more Bach-like result if the provided melody was more like Bach, rather than some random scattering of notes. I did put in a couple of bars of a Bach chorale and the results from the Doodle were quite different than the original, on each successive harmonization. Given how well-studied Bach’s music is, and how it seems more based on clear order and structures and rules than most music, I am surprised how poorly the AI engine does in recreating Bach’s style, and perhaps this just proves the gulf between human thought and creativity and our current AI models of it.

After experimenting with the Bach Doodle, I do not think it is sophisticated or extensive enough to use any other way than for “play,” as the limitations on pitch, length, rhythmic units and so on are too severe. However, as many scholars have shown, constructive “play” can be beneficial in learning and perhaps compositional or analytical “cognitive development” can come from “playing” with simple generators such as Coucou.3“Play” and creation in the learning process is a vast subject area: I recommend easily accessible writings by Seymour Papert and Idit Harel (“Situating Constructionism,” available at: www.papert.org/articles/SituatingConstructionism.html) and Mitchel Resnick ["All I Really Need to Know (About Creative Thinking) I Learned (by Studying How Children Learn) in Kindergarten," accessible at: http://web.media.mit.edu/~mres/papers/kindergarten-learning-approach.pdf.

Interacting with the Coucou interface is more fun, at least for musicians, because it allows for more rhythmic and harmonic variation. It uses a “piano roll” interface and you can delete notes or regions and ask the program to fill in or harmonize only specific parts. Importantly, it has a “Temperature” control that allows the introduction of randomness. Randomness is extremely important in these systems as it allows for new or unexpected outputs that would not come from the rules alone. Hiller and Isaacson noted this in 1959, in the first book on algorithmic composition titled “Experimental Music.”4Hiller, L. A., Isaacson, L. M. 1959. Experimental Music Composition with an Electronic Computer. McGraw-Hill, New York.

Coconet was trained to restore Bach’s pieces from fragments provided to it. The training involved taking a piece of Bach and randomly erasing some notes, then having the software fill in the blanks based on their context. With iterative training the model “learns” the style of the harmonization. This is a significantly different model for algorithmic composition than traditionally used. The traditional models include Markov models, state variable machines, generative grammars, fractals and self-similarity models, cellular automata models (such as Conway’s Game of Life), biological models, and artificial intelligence (AI) models that learn. AI appears to be the sort of system that Coconet is based on, although details are scarce even in Google’s explanation page.5Accessible at: https://magenta.tensorflow.org/coconet AI and machine learning are strong research interests of technology companies and the results may revolutionize our world. Coconet is designed to undertake tasks such as harmonizing melodies, creating smooth transitions, rewriting and elaborating existing music, and composing from scratch.

In conclusion, although the Bach Doodle falls short of being a viable tool for music instruction, it may serve as a springboard for students to experiment with other software such as Coucou, or some of the many other algorithmic music software systems from “Band in a Box” to Pure Data, MaxMSP (particularly through Ableton), Supercollider, CSound, or IRCAM’s “Open Music.” Indeed, there is even recent research by Carr and Zukowski into ways to algorithmically create rock, punk, and other popular music.6Carr, CJ, and Zack Zukowski. 2018. "Generating Albums with SampleRNN to Imitate Metal, Rock, and Punk Bands," Proceedings of the 6th International Workshop on Musical Metacreation (MUME 2018).

 

Notes:

1. Accessible at https://www.google.com/doodles/celebrating-johann-sebastian-bach

2. Accessible at https://coconet.glitch.me

3. “Play” and creation in the learning process is a vast subject area: I recommend easily accessible writings by Seymour Papert and Idit Harel (“Situating Constructionism,” available at: www.papert.org/articles/SituatingConstructionism.html) and Mitchel Resnick ["All I Really Need to Know (About Creative Thinking) I Learned (by Studying How Children Learn) in Kindergarten," accessible at: http://web.media.mit.edu/~mres/papers/kindergarten-learning-approach.pdf.

4. Hiller, L. A., Isaacson, L. M. 1959. Experimental Music Composition with an Electronic Computer. McGraw-Hill, New York.

5. Accessible at: https://magenta.tensorflow.org/coconet

6. Carr, CJ, and Zack Zukowski. 2018. "Generating Albums with SampleRNN to Imitate Metal, Rock, and Punk Bands," Proceedings of the 6th International Workshop on Musical Metacreation (MUME 2018).

1582 Last modified on April 15, 2020