This is the code for reproducing the results from our 2021 SMC paper, "Generating Musical Continuations with Repetition".
If you use it, please cite it:
@inproceedings{Velezdevilla:21,
title={Generating Musical Continuations with Repetition},
author={Velez de Villa, Sebastian and McLeod, Andrew and Rohrmeier, Martin},
booktitle={Sound and Music Computing Conference {(SMC)}},
year={2021},
pages={131--138}
}
Here's how to run the continuation programs.
- Clone this repository.
- Download and install abjad, LilyPond (needed by abjad) and pretty_midi, as well as the standard python librairies, such as numpy.
- Download any of the monophonic datasets from MIREX 2019: Patterns for Prediction: small, medium or large.
- In the newly downloaded folders, at the same level as the "prime_csv" folder, add 6 folders: "markov_without_prediction_midi", "markov_without_prediction_csv". "markov_with_prediction_midi", "markov_with_prediction_csv", "markov_with_non_exact_prediction_midi" and "markov_with_non_exact_prediction_csv". These folders are needed for the evaluation code.
- Download the evaluation code, and follow the instructions.
- Copy and paste the content of config_corrected.py into config.py (in the newly downloaded evaluation folder), and modify "OUTPUT_FOLDER", "DATASET_PATH" and "FILENAME_FRAGMENT".
- Edit cs.py (in the evaluation code) to cs_corrected.py (copy and paste the code).
- Run the jupyter notebook Generation/Generation.ipynb.
All the code necessary to find patterns and produce the continuations is available in Generation/utility.py, Generation/simple_first_order_mm.py, Generation/string_based.py and Generation/translation_based.py.
See the LICENSE file for license rights and limitations (MIT).