Chord prediction is a common task in music generation and analysis. This project demonstrates the implementation of a chord prediction model using PyTorch. The model uses an Transformer-based architecture to predict chords based on sequences of input notes for real-time harmonizing. The project also contains Max patches for use in AbletonLive for realtime harmonization.
Melody
melody-no-harm.mov
Harmonized Melody
melody-yes-harm.mp4
harmed.mp4
-
Clone this repository:
git clone https://github.com/onurio/harmonizing-ai.git cd harmonizing-ai
-
Install the required dependencies:
pip install -r requirements.txt
-
Put all midi files in the
midi
folder -
Run the script to create the training data:
parse-midi.py
-
Run the training notebook:
HarmonizeTransformer.ipynb
-
Run the prediction script:
TransformerPredict.py
-
In AbletonLive use the max patch
ai-harm.amxd
to play midi notes and receive their respective harmonies.
Contributions to this project are welcome! You can contribute by:
- Adding new features to the model architecture
- Optimizing the training process
- Enhancing the documentation
Please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License.