Song retrieval using hummed query
Clone the Repository.
git clone https://github.com/enter-opy/strawberry-fields.git
cd sound-of-music
Create a virtual environment.
pip install virtualenv
virtualenv venv
Activate the environment.
Windows:
venv\Scripts\activate
Linux:
source venv/bin/activate
Create a .env
file in the root directory of your project and copy the following into the file.
USER=username
PASSWORD=password
SECRET_KEY=secret_key
Replace 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.txt
Ensure 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.py
Enter 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.py
python -m flask run
Go to your localhost server in your web browser and allow microphone access when prompted.
flowchart TB;
A[/"Query\n(Hummed melody)"/] --> B["Probabilistic YIN"];
B -->|Pitch vector| C["k Nearest Neighbors (DTW)"];
C -->|Candidates| D["Dynamic Time Warping"];
D -->|Closest match| E[/"Result\n(Metadata)"/];
G[("Database")] -.->|Training set| C
F[/"fa:fa-file MIDI Files"/] -->|Pitch vectors| G
Contributions to Strawberry Fields are welcome! If you'd like to contribute, follow these steps:
- Fork the Repository: Start by forking the Strawberry Fields.
- Make Changes: Create a new branch , make your changes, and commit them to your branch.
- Create a Pull Request: Push your changes to your fork and submit a pull request to the original repository.
This project is licensed under the GNU General Public License. See the LICENSE for details.
- Joan Serrà, Josep Ll. Arcos, An Empirical Evaluation of Similarity Measures for Time Series Classification, Jan 2014.
- Hiroaki Sakoe, Seibi Chiba, Dynamic programming algorithm optimization for spoken word recognition, February 1978.
- Ivan Fernandez Cocano, Expanding the evaluation of Audio to Score Matching applying Audio Querying strategies, August 2023.
- Matthias Mauch and Simon Dixon, PYIN: A Fundamental Frequency Estimator Using Probabilistic Threshold Distributions, May 2014.