A better mousetrap (or at least a better ABC tune search)
So I’ve been toying with ideas for better ways to search ABC than straight text searches. Standard text searching breaks the phrases up in to "words", and matches those. The problem is that nobody plays the same settings of tunes, and people who notate ABC have their own quirks about how they like to include ornamentation, pickup notes, etc.
Since I got laid off from work about a week ago, I decided that now was a good time to play around with this, since I have some time on my hands. I was researching pattern matching algorithms, and ran across an idea used in DNA strand matching, and thought that I might be able to adapt that to searching ABC. And voila, it works pretty well!
The nice thing about it is that it recognizes phrases as being similar (and rates them based on the percentage of shared notes), even where there are variations, both in the melody, and in the ABC notation.
I put this all together in a website: http://abctunesearch.com Be forewarned that this requires a relatively recent Adobe Flash Player to be installed (which most folks already have).
To use it, select a tune type from the popup, and try inputting basic ABC, without the header information. You can put anything from 5 notes to a whole tune in. It seems to work best with 4-8 bars of a tune as input. If you don’t find what you’re looking for, try a shorter snippet of ABC. The shorter the input, the more results you will get. The longer the input, the more accurate the matching should be.
The input snippet of ABC can be from any part of the tune. If you search for the A part of something and don’t find a match, try searching on the B part, or even just half of the B part, etc.
If you still have trouble finding things, try selecting other tune types (sometimes people have notated hornpipes as reels, etc.)
Still to come are some other good enhancements:
I am in the process of ingesting more ABC data to search across, including the ABC archive of O’Neill’s, and the Reavy collection.
And coming soon, I will be implementing an advanced "interval search", which looks at the contour of the tune, and tries to match it to things regardless of key.