Hands-On Music Generation with Magenta
Explore the role of deep learning in music generation and assisted music composition
Alexandre DuBreuil
- 360 pagine
- English
- ePUB (disponibile sull'app)
- Disponibile su iOS e Android
Hands-On Music Generation with Magenta
Explore the role of deep learning in music generation and assisted music composition
Alexandre DuBreuil
Informazioni sul libro
Design and use machine learning models for music generation using Magenta and make them interact with existing music creation tools
Key Features
- Learn how machine learning, deep learning, and reinforcement learning are used in music generation
- Generate new content by manipulating the source data using Magenta utilities, and train machine learning models with it
- Explore various Magenta projects such as Magenta Studio, MusicVAE, and NSynth
Book Description
The importance of machine learning (ML) in art is growing at a rapid pace due to recent advancements in the field, and Magenta is at the forefront of this innovation. With this book, you'll follow a hands-on approach to using ML models for music generation, learning how to integrate them into an existing music production workflow. Complete with practical examples and explanations of the theoretical background required to understand the underlying technologies, this book is the perfect starting point to begin exploring music generation.
The book will help you learn how to use the models in Magenta for generating percussion sequences, monophonic and polyphonic melodies in MIDI, and instrument sounds in raw audio. Through practical examples and in-depth explanations, you'll understand ML models such as RNNs, VAEs, and GANs. Using this knowledge, you'll create and train your own models for advanced music generation use cases, along with preparing new datasets. Finally, you'll get to grips with integrating Magenta with other technologies, such as digital audio workstations (DAWs), and using Magenta.js to distribute music generation apps in the browser.
By the end of this book, you'll be well-versed with Magenta and have developed the skills you need to use ML models for music generation in your own style.
What you will learn
- Use RNN models in Magenta to generate MIDI percussion, and monophonic and polyphonic sequences
- Use WaveNet and GAN models to generate instrument notes in the form of raw audio
- Employ Variational Autoencoder models like MusicVAE and GrooVAE to sample, interpolate, and humanize existing sequences
- Prepare and create your dataset on specific styles and instruments
- Train your network on your personal datasets and fix problems when training networks
- Apply MIDI to synchronize Magenta with existing music production tools like DAWs
Who this book is for
This book is for technically inclined artists and musically inclined computer scientists. Readers who want to get hands-on with building generative music applications that use deep learning will also find this book useful. Although prior musical or technical competence is not required, basic knowledge of the Python programming language is assumed.
Domande frequenti
Informazioni
Section 1: Introduction to Artwork Generation
- Chapter 1, Introduction to Magenta and Generative Art
Introduction to Magenta and Generative Art
- Overview of generative artwork
- New techniques with machine learning
- Magenta and TensorFlow in music generation
- Installing Magenta
- Installing the music software and synthesizers
- Installing the code editing software
- Generating a basic MIDI file
Technical requirements
- Python, Conda, and pip, to install and execute the Magenta environment
- Magenta, to test our setup by performing music generation
- Magenta GPU (optional), CUDA drivers, and cuDNN drivers, to make Magenta run on the GPU
- FluidSynth, to listen to the generated music sample using a software synthesizer
- Other optional software we might use throughout this book, such as Audacity for audio editing, MuseScore for sheet music editing, and Jupyter Notebook for code editing.
- First, you need to install Git, which can be installed on any platform by downloading and executing the installer at git-scm.com/downloads. Then, follow the prompts and make sure you add the program to your PATH so that it is available on the command line.
- Then, clone the source code repository by opening a new Terminal and executing the following command:
> git clone https://github.com/PacktPublishing/hands-on-music-generation-with-magenta
> cd hands-on-music-generation-with-magenta
http://bit.ly/2O847tW
Overview of generative art
Pen and paper generative music
- On the first throw of two dices, we read the first column. A total of two will output the measure 96 (first row), a total of two will output the measure 32 (second row), and so on.
- On the second throw of two dices, we read the second column. A total of two will output the measure 22 (first row), a total of three will output the measure 6 (second row), and so on.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | 96 | 22 | 141 | 41 | 105 | 122 | 11 | 30 | 70 | 121 | 26 | 9 | 112 | 49 | 109 | 14 |
3 | 32 | 6 | 128 | 63 | 146 | 46 | 134 | 81 | 117 | 39 | 126 | 56 | 174 | 18 | 116 | 83 |
4 | 69 | 95 | 158 | 13 | 153 | 55 | 110 | 24 | 66 | 139 | 15 | 132 | 73 | 58 | 145 | 79 |
5 | 40 | 17 | 113 | 85 | 161 | 2 | 159 | 100 | 90 | 176 | 7 | 34 | 67 | 160 | 52 | 170 |
6 | 148 | 74 | 163 | 45 | 80 | 97 | 36 | 107 | 25 | 143 | 64 | 125 | 76 | 136 | 1 | 93 |
7 | 104 | 157 | 27 | 167 | 154 | 68 | 118 | 91 | 138 | 71 | 150 | 29 | 101 | 162 | 23 | 151 |
8 | 152 | 60 | 171 | 53 | 99 | 133 | 21 | 127 | 16 | 155 | 57 | 175 | 43 | 168 | 89 | 172 |
9 | 119 | 84 | 114 | 50 | 140 | 86 | 169 | 94 | 120 | 88 | 48 | 166 | 51 | 115 | 72 | 111 |
10 | 98 | 142 | 42 | 156 | 75 | 129 | 62 | 123 | 65 | 77 | 19 | 82 | 137 | 38 | 149 | 8 |
11 | 3 | 87 | 165 | 61 | 135 | 47 | 147 | 33 | 102 | 4 | 31 | 164 | 144 | 59 | 173 | 78 |
12 | 54 | 130 | 10 | 103 | 28 | 37 | 106 | 5 | 35 | 20 | 108 | 92 | 12 | 124 | 44 | 131 |
- Chance or randomness, which the dice game is a good example of, where the outcome of the generated art is partially or totally defined by chance. Interestingly, adding randomness to a process in art is often seen as humanizing the process, since an und...
Indice dei contenuti
- Title Page
- Copyright and Credits
- About Packt
- Contributors
- Preface
- Section 1: Introduction to Artwork Generation
- Introduction to Magenta and Generative Art
- Section 2: Music Generation with Machine Learning
- Generating Drum Sequences with the Drums RNN
- Generating Polyphonic Melodies
- Latent Space Interpolation with MusicVAE
- Audio Generation with NSynth and GANSynth
- Section 3: Training, Learning, and Generating a Specific Style
- Data Preparation for Training
- Training Magenta Models
- Section 4: Making Your Models Interact with Other Applications
- Magenta in the Browser with Magenta.js
- Making Magenta Interact with Music Applications
- Assessments
- Other Books You May Enjoy