Parse sheet music into a playable MIDI file. The proper phrasing is Optical Music Recognition.
To use, simply run hearme.py
with the path to an image of sheet music supplied as an argument, e.g. > python hearme.py source.png
.
- scikit-image for image analysis
- scikit-learn for SVM
- music21 for MIDI creation
- numpy misc.
- scipy
- matplotlib
- HearMe currently requires a set of training images that aren't on this repo (trying to move away/improve from this method anyways). HOWEVER The pickled data for the SVM is included using a more efficient pickle module from sklearn.
- Only very nice images work at this time. (TODO) ergo...
- Images should not have any text in them. Text currently ruins the whole entire process.
- Noisy images cause problems (anti-aliasing, for example). In this case, very nice means perfectly black-and-white images.
- Images can only contain the following symbols (e.g. anything else breaks the 'warranty')
- Quarter-, half-, and whole- notes and rests
- Eigthth notes in singles, pairs, tuples, and quadruples
- The common time symbol (the small 'c')
- Time signatures are variable (e.g. 2s, 3s, and 4s are recognized, albeit poorly in some instances)
- Single and double bars
- Flats and sharps
- Key signatures are spotty (e.g. works if there are only a few sharps/flats)
- Treble and bass clefs.