This repository contains the code for extracting the melodic line from the MIDI files of polyphonic music.
Refer to the Jupyter Notebook MIDI_MelodyExtractionTutorial.ipynb
for usage tutorial.
The tutorial contains codes and instructions for single and batch extraction.
- mido
- numpy
-
The python script assumes the melody is contained in the first channel of the first track of the MIDI file.
-
Current melody extraction criterion:
- When two notes happen at the same time, only the top one will remain.
-
It works well with quantized midi.