Skip to content

enter-opy/strawberry-fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strawberry fields

Song retrieval using hummed query

Setup

Clone the Repository.

git clone https://github.com/enter-opy/strawberry-fields.git
cd sound-of-music

Environment setup

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 Dependencies

Install the required packages using pip with the requirements.txt file.

pip install -r requirements.txt

Usage

MongoDB Setup

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

Run the application

python -m flask run

Go to your localhost server in your web browser and allow microphone access when prompted.

System Architecture

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
    
Loading

Contributing

Contributions to Strawberry Fields are welcome! If you'd like to contribute, follow these steps:

  1. Fork the Repository: Start by forking the Strawberry Fields.
  2. Make Changes: Create a new branch , make your changes, and commit them to your branch.
  3. Create a Pull Request: Push your changes to your fork and submit a pull request to the original repository.

License

This project is licensed under the GNU General Public License. See the LICENSE for details.

References

About

Song retrieval using hummed query

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published