Let's look at the prerequisites to preprocess MIDI files:
- Download the MIDI song repository:
https://github.com/dshieble/Music_RBM/tree/master/Pop_Music_Midi
- Download the Python codes to manipulate MIDI songs:
https://github.com/dshieble/Music_RBM/blob/master/midi_manipulation.py
- Install the "reticulate" package, which provides the R interface to Python:
Install.packages("reticulate")
- Import Python libraries:
use_condaenv("python27") midi <- import_from_path("midi",path="C:/ProgramData/Anaconda2/Lib/site-packages") np <- import("numpy") msgpack <- import_from_path("msgpack",path="C:/ProgramData/Anaconda2/Lib/site-packages") psys <- import("sys") tqdm <- import_from_path("tqdm",path="C:/ProgramData/Anaconda2/Lib/site-packages") midi_manipulation_updated <- import_from_path("midi_manipulation_updated",path="C:/Music_RBM") glob <- import("glob")