Benzaiten Adlib TensorFlow version Sample for M1 Mac
based on https://docs.google.com/document/d/1CizJ6b9i2yZ9OIDPrBWUROyJahlZrlqe-naxh4brACQ/edit
-
Set up Python and TensorFlow for the M1Mac environment.
-
Install each module.
- Since the following import statements appear in the program, please install the respective modules so that these can be resolved:
import music21 import numpy as np import matplotlib.pyplot as plt import mido import csv import IPython.display as ipd import midi2audio import glob import tensorflow as tf import tensorflow_probability as tfp
-
Download the training musicXML from https://homepages.loria.fr/evincent/omnibook/ and place it in the
omnibook
directory. -
Download the following sample file from the here and place it in the
sample
directory. -
Rename sample files as follows:
- sample1_backing.mid -> sample_backing.mid
- sample1_chord.csv -> sample_chord.csv
-
Obtain a soundfont and place it in the
soundfont
directory.- For example, get
FluidR3_GM.sf2
from https://member.keymusician.com/Member/FluidR3_GM/index.html and place it in the soundfont directory.
- For example, get
-
Run
learn.py
to generate the model. -
Run
generate.py
to output a midi file in theoutput
directory with the melody on the accompaniment.- At the same time, a wav file is output to the root directory.