This is the main model class file used for the VRAE (ICLR 2015 workshops)
For preprocessing the MIDI files into numpy ndarrays, we used code from the RNN-RBM model by Boulanger-Lewandowski et al. found here. Direct download via here, see specifically the util.py file.
For some example code on how to use this class refer to Variational-Autoencoder, which uses largely the same structure.