The project involved training a model that is capable of generating harmonies given amelody. The final model employed a sequence-to-sequence structure where each harmony gets generated by separate GRU encoders and decoders before being combined with a fully connected output layer. This model managed to generate harmonies that closely resemble human-created arrangements regardless of thekey in which the melody is played, largely due to the employed data augmentation strategy. However, even though Bach’s chorales were used as training data, the generated compositions do not, necessarily, sound reminiscent of the composer’s work as they employ more modern syncopated rhythms. This is due to the one-hot encoding that was used, showing that special care should be taken when designing the numerical representation of music.
Project presentation: https://www.youtube.com/watch?v=A2kqa82fEEg
- Johan von Hacht (JohanKJIP)
- David Johansson (sofoda)
- David Stevens (stevensdavid)
- Download the data from
www.github.com/czhuang/JSB-Chorales-dataset
and place the fileJsb16thSeparated.npz
insidetrainer/data
. pip3 install -r requirements.txt
- To train, run
task.py
:python3 -m trainer/task.py
. - To generate melodies run:
python3 -m trainer/performer.py
. Inside the main function within the file, there is the option to change the melody to generate harmonies for.