sumuzhao / CycleGAN-Music-Style-Transfer

Symbolic Music Genre Transfer with CycleGAN
MIT License
261 stars 66 forks source link

Combining midi files #4

Open aihobbyist opened 5 years ago

aihobbyist commented 5 years ago

Per Testfile.py I've been able to convert a midi file into multiple numpy arrays of shape (64, 84, 1) which I can then run a trained model on. This will return a midi file (cycle, transfer) for each individual numpy array, which will of course only be a few seconds in length each. Is there code for combining midi files? I assume this must have been done for the examples given where full songs are converted.

sumuzhao commented 5 years ago

Hey, it is easy. You can just concatenate the numpy arrays together and then call the function save_midis. Basically, the individual numpy array is a phrase which is composed of 4 bars. Take a look at save_midis in utils.py and functions in write_midi.py.

esemeniuc commented 5 years ago

@aihobbyist can you please post how you converted the file?