Artificial intelligence (AI) in music is a fascinating topic. Wouldn't it be cool if your favorite group from the 70s was bringing out new songs, but maybe more modern? Sony did this with the Beatles, and you can hear a song on YouTube, complete with automatically generated lyrics, called Daddy's car: https://www.youtube.com/watch?v=LSHZ_b05W7o.
In this recipe, we'll be generating a melody. More specifically, we'll be continuing a song using functionality in the Magenta Python library.
Getting ready
We need to install the Magenta library, and a few system libraries as dependencies. Please note that you need admin privileges in order to install system dependencies. If you are not on Linux (or *nix), you'll have to find the ones corresponding to your system.
On macOS, this should be relatively straightforward. Otherwise, it might be easier to run this in a Colab environment:
!apt-get update -qq && apt-get install -qq libfluidsynth1 fluid...