add readme file, commented out delete_empty_samples function

This commit is contained in:
Cezary Pukownik 2019-05-29 10:50:00 +02:00
parent 92a90a912c
commit 1997ff96ef
2 changed files with 18 additions and 0 deletions

View File

@ -39,6 +39,7 @@ def to_midi(samples, output_path=settings.generated_midi_path, program=0, tempo=
return_midi = roll.Multitrack(tracks=tracks, tempo=tempo, downbeat=[0, 96, 192, 288], beat_resolution=beat_resolution) return_midi = roll.Multitrack(tracks=tracks, tempo=tempo, downbeat=[0, 96, 192, 288], beat_resolution=beat_resolution)
roll.write(return_midi, settings.generated_midi_path) roll.write(return_midi, settings.generated_midi_path)
# todo: this function is running too slow.
def delete_empty_samples(sample_pack): def delete_empty_samples(sample_pack):
print('Deleting empty samples...') print('Deleting empty samples...')
temp_sample_pack = sample_pack temp_sample_pack = sample_pack
@ -64,6 +65,7 @@ def main():
continue continue
sample_pack = np.concatenate((midi_samples, sample_pack), axis=0) sample_pack = np.concatenate((midi_samples, sample_pack), axis=0)
# I commented out this line, because it was too slow
# sample_pack = delete_empty_samples(sample_pack) # sample_pack = delete_empty_samples(sample_pack)
np.savez_compressed(settings.samples_dir, sample_pack) np.savez_compressed(settings.samples_dir, sample_pack)

16
project/readme Normal file
View File

@ -0,0 +1,16 @@
## MUSIC GENERATION USING DEEP LEARNING ##
## AUTHOR: CEZARY PUKOWNIK
How to use:
1. Use midi.py to export data from midi files
./midi.py export <midi_folder_path> <output_path>
2. Use train.py to train a model (this can take a while)
./train.py <input_training_data> <model_save_path>
3. Use generate.py to generate music from trained models
./generate.py <model_weights_path> <output_path>