Skuldur / Classical-Piano-Composer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to generate my own notes.dms file

michaelcli opened this issue · comments

Hi, your article on how to generate music is awesome!

I was training my own version of model (which should contain the same logic) with some different training midi files, and the prediction generation actually throws an error, as there are only 112 total different notes in that training set and the notes.dms file has 352 different notes, meaning the LSTM doesn't work, as "Dimension 1 in both shapes must be equal, but are 352 and 112. Shapes are [256,352] and [256,112]." (The notes.dms is 352 notes, and I'm assuming the 112 comes from my own training data likely being only 112 notes wide, as I only put in a couple of songs.)

Is there some way to create my own notes.dms file to accurately reflect the training set of midi files and get around this error?

Thank you very much!

Hmm... it should generate a notes files when you're training the network. Did you train using the lstm.py file or did you write your own file for training?

I am having the same problem. I trained using lstm.py, changing only the midi files used in training and when i try to generate the prediction with predict.py i get: "Dimension 1 in both shapes must be equal, but are 880 and 352. Shapes are [256,880] and [256,352]."

@Skuldur Thank you for responding! I'm using my own file that's based off of your code, but the logic should be almost the same. Is there a part in the lstm.py file that generates the notes.dms file? I may have just forgotten to include it.

predict.py uses file : /data/notes for prediction and therefore weights.hdf5 and /data/notes should not be changed until you generated a midi output.

Hi,

I've looked at the issue and found that it was caused by weights.hdf5 being incompatible with the current dataset. I have updated the repository so that it should work now.