This repository contains some example code to get you started with music composition and image generation using Python. However, because of the extensive requirements for setup and issues with different operating systems - most the of the workshops will focus on tools that can be accessed on the web. After the class, please feel free to use these resources and if you have any questions, open a GitHub issue.
Working in pairs, please work through the Hello Magenta.ipynb notebook that can be found on Google Colab:
https://colab.research.google.com/notebooks/magenta/hello_magenta/hello_magenta.ipynb
Attempt the following things:
- Create your own note sequence(s)
- Adjust the length of the input sequence, num_steps, and temperature
- Does a longer or shorter input sequence lead to better results?
- Does a longer or shorter num_steps lead to better results?
- How does adjusting the temperature influence the result?
- Interpolate between two and more sequences, adjusting the length
- What parameters allow you to adjust interpolation?
- How is interpolation related to composition?
To install the dependencies for Magenta to run the notebook locally, you need several OS-specific packages.
For Mac OS X:
$ brew install fluidsynth
For Ubuntu Linux:
$ sudo apt-get install build-essential libasound2-dev libjack-dev portaudio19-dev
For Windows: Unfortunately, to install fluidsynth on Windows, you have to build the package yourself, there doesn't seem to be any prebuilt binaries. See the build instructions for FluidSynth on Windows to compile it locally. Note that these notebooks are untested on Windows, so I'm not sure what other dependencies are required.
Once you've installed FluidSynth:
$ pip install magenta jupyter python-rtmidi
Or alternatively you can install all the dependencies using pip install -r requirements.txt
. This may take some time, but after install you should be able to run the music.ipynb
notebook.