We are going to generate a MIDI file from a primer in Python, much like we've done in the previous section.
- Let's start by downloading the bundle. There are a lot of useful tools in the magenta.music package, and we'll be using it in many examples:
import osimport magenta.music as mmmm.notebook_utils.download_bundle("drum_kit_rnn.mag", "bundles")bundle = mm.sequence_generator_bundle.read_bundle_file( os.path.join("bundles", "drum_kit_rnn.mag"))
- We then use the drums generator to initialize the generator class ...