A handy tool to automatically generate chord progressions based on a selected mood. Built with the Hooktheory API and Spotipy.
-
Get an API key from https://www.hooktheory.com and add it to a file called
APIKey.txt
. -
Obtain authentication to the Spotify API by creating the
SPOTIPY_CLIENT_ID
ANDSPOTIPY_CLIENT_SECRET
environment variables. They are availaible on the Spotify for Developers Dashboard -
Run the dataset creation script:
python3 fetch_progressions.py
The dataset is created by first finding one chord progressions, discarding the progressions with low probability(< 0.05), finding two chord progressions from the previously obtained one chord progressions, discarding the low probability ones, and so on.
-
Run the database creation script with the following command:
python3 mine_emotions.py
Note: only emotions for four chord progressions have been considered for ease of usage.
A simplified version with 50 chord progressions has been deployed to https://chord-progression-generator.herokuapp.com
- Hooktheory API to fetch chord progression information
- Spotify API to get audio features of tracks
- Spotipy Python Library to simplify API access and functionality