Song retrieval using hummed query
Clone the Repository.
git clone https://github.com/vivekvjyn/strawberry-fields.git
cd sound-of-musicCreate a virtual environment.
pip install virtualenv
virtualenv venvActivate the environment.
Windows:
venv\Scripts\activateLinux:
source venv/bin/activateCreate a .env file in the root directory of your project and copy the following into the file.
USER=username
PASSWORD=password
SECRET_KEY=secret_keyReplace username, password, and secret_key with the username and password of your MongoDB database and the secret key for your Flask app.
Install the required packages using pip with the requirements.txt file.
pip install -r requirements.txtEnsure you have MongoDB installed and running. Create a database named MusicCatalog with a collection named MusicCatalog.
Run features.py to add a song to your database.
python features.pyEnter the requested details and the path to the MIDI file of the song.
Once all the songs are added to the database, run train.py to update the model to fit your database.
python train.pypython -m flask runGo to your localhost server in your web browser and allow microphone access when prompted.
flowchart TB;
A[/"Query"/] -->|"Hummed melody"| B["Probabilistic YIN"];
B -->|Pitch vector| C["k Nearest Neighbors (DTW)"];
C -->|Candidates| D["Dynamic Time Warping"];
D -->|Closest match| E[/"Result"/];
G[("Database")] -.->|Training set| C
F[/"fa:fa-file MIDI Files"/] -->|Pitch vectors| G