Skip to content

SoHappyZkx/audio_to_midi_melodia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

audio_to_midi_melodia

Extract the melody notes from an audio file and export them to MIDI and (optionally) JAMS files.

The script extracts the melody from an audio file using the Melodia algorithm, and then segments the continuous pitch sequence into a series of quantized notes, and exports to MIDI using the provided BPM. If the --jams option is specified the script will also save the output as a JAMS file. Note that the JAMS file uses the original note onset/offset times estimated by the algorithm and ignores the provided BPM value.

Note: Melodia can work pretty well and is the result of several years of research. The note segmentation/quantization code was written to be as simple as possible and will most likely not provide results that are as good as those provided by state-of-the-art note segmentation/quantization algorithms.

Usage

>python audio_to_midi_melodia.py infile outfile bpm [--smooth SMOOTH] [--minduration MINDURATION] [--jams]

For example:

>python audio_to_midi_melodia.py ~/song.wav ~/song.mid 60 --smooth 0.25 --minduration 0.1 --jams

For further help use:

>python audio_to_midi_melodia.py --help

Dependencies

Known to work with the following module versions on python 2.7:

  • Librosa 0.5.1
  • midiutil 1.2.1
  • vamp 1.1.0
  • jams 0.3.1
  • numpy 1.13.1
  • scipy 0.19.1

About

Extract the melody from an audio file and export to MIDI

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%