- Author: Rushikesh Shinde
This repository contains the implementation of a Raga Prediction Model designed specifically for Hindustani Classical Music. The model takes MIDI files as input and predicts the raga based on pitch, duration, and velocity features extracted from the MIDI data. The training dataset was carefully curated from flute concerts of Pt. Hariprasad Chaurasia, processed to isolate the flute from accompanying instruments, and converted into MIDI format.
-
Dataset Preparation:
- Extracted audio from YouTube recordings of Pt. Hariprasad Chaurasia.
- Isolated flute tracks using Audacity.
- Converted the audio to MIDI files using Melodyne.
- Split the MIDI files into 1-minute segments to create the training dataset.
-
Feature Extraction:
- Extracted features include pitch, note duration, and velocity.
- Computed Pitch Class Distributions (PCD) based on Hindustani swara notation (S, r, R, g, G, m, M, P, d, D, n, N).
-
Model Training:
- Trained a Hidden Markov Model (HMM) for each raga using its MIDI data.
- Used
hmmlearnto fit models for pitch, duration, and velocity.
-
Testing and Evaluation:
- Evaluated the model on test data with unseen MIDI files.
- Achieved raga predictions based on similarity scores from HMM models.
- PrettyMIDI: MIDI file processing and manipulation.
- Numpy and Pandas: For data handling and analysis.
- Matplotlib: For visualizing pitch class distributions.
- HMMLearn: For Hidden Markov Model implementation.
- Scikit-learn: For additional machine learning utilities.
-
Pitch Class Distribution Visualization:
- Displays normalized frequencies of Hindustani notes for MIDI files.
- Provides insight into the structure of the raga.
-
Hidden Markov Model Training:
- Separate models trained for each raga in the dataset.
- Predictions made by scoring MIDI sequences against trained models.
-
Accuracy Calculation:
- Compares model predictions with actual labels to compute accuracy.
Install the required libraries using:
pip install pretty-midi numpy pandas matplotlib hmmlearn scikit-learn-
Root Folder:
- Contains the full-performance MIDI files named according to the raga.
-
Split_MIDI.ipynb:
- Jupyter Notebook used to split each full-performance MIDI file into 20 parts for easier training and evaluation.
-
main.ipynb:
- Jupyter Notebook containing the complete implementation of feature extraction, model training, testing, and evaluation.
- The model provides accurate raga predictions based on input MIDI files.
- Accuracy: 100%
- Extend the dataset by including more ragas on more instruments and by more artists.
- Explore deep learning models like LSTMs for sequential data.
- Pt. Hariprasad Chaurasia for the inspiring flute performances.
- Audacity and Melodyne for enabling precise audio and MIDI file creation.