Magenta is a research project exploring the role of machine learning in the process of creating art and music. Primarily this involves developing new deep learning and reinforcement learning algorithms for generating songs, images, drawings, and other materials. But it's also an exploration in building smart tools and interfaces that allow artists and musicians to extend (not replace!) their processes using these models. Magenta was started by some researchers and engineers from the Google Brain team, but many others have contributed significantly to the project. The project uses TensorFlow and is open sourcing models and tools on GitHub.
This repository is currently in an inactive (archived, read-only) state and serves only as a supplement to some papers. New projects have been moved to separate repositories. For current work, please see the Magenta website and the Magenta GitHub Organization.
This repository is the home of the Python TensorFlow library. To run models in the browser with TensorFlow.js, please go to the Magenta.js repository.
Getting Started
Check out our Colab notebooks for various models, including a getting started notebook. Magenta.js is also a good resource for models and demos running in the browser. For more content, including blog posts and an Ableton Live plugin, see https://magenta.tensorflow.org .
Development Environment (Advanced)
Magenta maintains a pip package for easy installation. Installing with Anaconda is recommended, but it can also be used in any standard Python environment. Python 3 (>= 3.5) is supported. The following instructions assume you are using Anaconda.
Automatic Installation (with Anaconda)
If you are running Mac OS X or Ubuntu, you can try using the automatic installation script. Just paste the following command into your terminal. After the script finishes, open a new terminal window for the environment variable changes to take effect. The Magenta library is now available in Python programs and Jupyter notebooks, and the Magenta scripts have also been installed to your path! Please note that each time you open a new terminal window, you will need to run source activate magenta to use Magenta.
Manual Installation (without Anaconda)
If the automatic script fails for any reason, or if you prefer to install manually, please follow the steps below. Install the Magenta pip package:
Note: In order to install the rtmidi package that we depend on, you may need to install the header files for some sound libraries. On Ubuntu Linux, this command should install the necessary packages:
On Fedora Linux, use
Now you can train our various models and use them to generate music, audio, and images. You can find instructions for each model by browsing the models directory.
Development Environment
If you want to develop on Magenta, you need to set up the full development environment. First, clone this repository:
Next, install the dependencies, change to the base directory, and run the setup command:
Now you can edit files and run scripts by invoking Python as usual. For example, here is how to run the melody_rnn_generate script from the base directory:
You can also install the (possibly modified) package:
Before creating a pull request, please test your changes with the following command:
To build a new pip release, bump the version number and then run:
Magenta: Music and Art Generation with Machine Intelligence.