A better mousetrap (or at least a better ABC tune search)

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.

Enjoy!

Re: A better mousetrap (or at least a better ABC tune search)

As an example, for instance, select the tune type REEL, and input "AD (3DDD A,DDA|AGAB c2 Bc| ADDD A,CEG|AdcA {F}G4|" That will return the Donegal Tinker as the top match.

Click on the "Show More Results" button, and you will see that it matched other tunes, but not nearly as well. But this particular setting of Donegal Tinker is pretty different than the one in the database!

If you input "(3DDD A,D (3DDD|ADAd cAGc| ADFA (3EEE EG|AdcA G4|", it will match 100%

Those are the same phrase of the tune from completely different settings.

Re: A better mousetrap (or at least a better ABC tune search)

Wow. This is kind of brilliant. It works well. Very nice, Reverend.

Re: A better mousetrap (or at least a better ABC tune search)

I like this for checking my originals….
makes it easy to see if I have appropriated music from another tune…. nice…

Re: A better mousetrap (or at least a better ABC tune search)

"…kind of brilliant."

LOL! Does that make Rev "almost a genius"?

:-D

Seriously, not only has Rev developed the best abc search engine I’ve ever seen, but he did it in less than a week. And he’s just a *banjo* player!

Posted .

Re: A better mousetrap (or at least a better ABC tune search)

Of course, since Rev’s search engine leads to the tune database here, we ought to flesh out the inventory by posting more alternate settings in the comments section for each tune.

Posted .

Re: A better mousetrap (or at least a better ABC tune search)

yeah, I would like to ingest all the settings in the comments… when I get around to it… *sigh*

"kind of brilliant", is that like "sort of pregnant"?

Re: A better mousetrap (or at least a better ABC tune search)

…moderately stellar.

Posted .

Re: A better mousetrap (or at least a better ABC tune search)

Nah, it’s ABSOLUTELY brilliant, Reverend!

I was initially fooled by the fact that all note matches are case-sensitive (unlike other available searches), but it has just found a couple of previously elusive tunes in seconds; well done!

I’m intrigued as to how you access the database on-line, but I guess I’ll leave all that to the experts ;-)

Re: A better mousetrap (or at least a better ABC tune search)

Okay, okay. I should have used a :-D I guess.

Re: A better mousetrap (or at least a better ABC tune search)

Ahh, yeah, Rick, I should put that in the help. I forgot to mention that it is case sensitive (as it should be!)

Meh, no worries John, Even I don’t think it’s *that* brilliant (yet, anyway… now the interval search is going to be amazing!) ;-)

Re: A better mousetrap (or at least a better ABC tune search)

The Rev’s new ABC tune search thingo works really well!
and the banjo joke was a bonus.

Re: A better mousetrap (or at least a better ABC tune search)

It’s a banjo tee-shirt. You should buy one (or three)!

(Hell, I am a banjo player, and I have one of those shirts! If you can’t poke fun at yourself, you’re taking life too seriously!)

Re: A better mousetrap (or at least a better ABC tune search)

Reverend — FANTASTIC! Your site quickly identified a tune for which I have been unable to find a name for several months.

Re: A better mousetrap (or at least a better ABC tune search)

Since I’ve already asked dear Jeremy to axe it, here’s proof of it’s magic and my present thick state. It worked for me too, but registering that was delayed by my sluggish brain… ;-)

Discussion: I haven’t a clue ~ by proxy
# Posted on November 3rd 2008 by ceolachan
~ /discussions/19639

A jig called "The Kneebuckle"
https://thesession.org/tunes/6789/comments
~ someone had mailed fragments of it to me with a plea for a name. Not being in a peachy state, I first tried Rev’s bit of Flash, and it worked, right off the mark, at least for one version of the tune. If only my brain were in synch to comprehend, but, eventually, with direct intervention from the right reverend… ;-)

Re: A better mousetrap (or at least a better ABC tune search)

OK. I didn’t get it at first, ‘cos I didn’t read the instructions. (Me being stupid, rather than any lack of genius on Reverend’s part.) Now that I understand that you absolutely *must* choose the tune type first, I get it to work really well. Will it supplant my current two favourites, I wonder? Which are tuneDb and Folk Tune Finder, btw.

It might do … I’ll give it time …

Good stuff, Rev!

Posted by .

Re: A better mousetrap (or at least a better ABC tune search)

Sweet website Reverend Pete.CafePress & Trad the Vote ‘08 ~ is that you or an associate to help keep the blood flowing
Cheers

Posted by .

Re: A better mousetrap (or at least a better ABC tune search)

Thanks R_n, the ITMgoodies website is mine, through Cafe Press, who print and ship the shirts. As you say, anything to keep the head above water, which is in some doubt as of last week ;-)

Re: A better mousetrap (or at least a better ABC tune search)

Ahh, yes, benhall, that’s a trap that even I fall into… forgetting to select the tune type. I played with letting it search all the tune types at once, and while it works OK, and doesn’t seem to affect the accuracy, it greatly increases the search time, because this is a fairly involved algorithm. And since my archive of ABC to search on is growing, the search will get slower and slower anyway. So I figured that having you select the tune type was a good way to scale it down a bit…

At last a better ABC tune search

Keep up the good work!
Tune type ~ crimony is that the R:field.
No worries I only play airs & marches. Or is it aires & marchs?
Stop adding more
tunes there’s TOO MANY.
;)

Posted by .

Re: A better mousetrap (or at least a better ABC tune search)

Hey Reverend — A cool thing happened to me when I searched a tune but forgot to select tune type. I was looking for a jig but the selector was on reel. The search engine identified a very nice reel that I had never heard of. Now I have a new tune to learn!

Re: A better mousetrap (or at least a better ABC tune search)

Nice! Thank you!

Re: A better mousetrap (or at least a better ABC tune search)

That’s one good thing about the economic ‘crisis’ — it freed up
the Rev to get this done. I hope you get your job back soon
though Rev.

Re: A better mousetrap (or at least a better ABC tune search)

"Aires and marches" - you’re only spelling it like that to wind me up, Random.

Posted by .

Re: A better mousetrap (or at least a better ABC tune search)

Well done Rev. Your search engine has just delivered a series of test searches including finding lost Gan Ainms on the session web site. Fantastic stuff but sorry to hear that we are the beneficiaries of your increased free time.

Re: A better mousetrap (or at least a better ABC tune search)

Jaysus, that’s a great timesaver Reverend!! Been down the road of guessing and googling different combinations of notes and it’d drive you mad. Searching in different keys would be a great addition. Thanks

Posted .

Re: A better mousetrap (or at least a better ABC tune search)

Hey rev, why not a ‘surprise me’ button? AS we are graced by your free time, here’s hoping that you are equally blessed, maybe with a job better than the last one, with folks that appreciate you as much as we do here. Well, most of us anyway, including me…

I won’t be making up any sleep tonight. I’ve got plans for the sleeping bag on the couch and espresso, but the tensions will keep me awake watching and waiting for the results from your election. I’ll have to feed random notes into your bit of Flash to keep me sane…

I’ll include you in my pagan prayers and celebrations… Bless you Rev! ;-)

Let me know when you’ve cracked transposition… Wish I were there to pester you on and see the process…

Here’s also hoping your sideline is bringing in some profit for you…

Re: A better mousetrap (or at least a better ABC tune search)

Hey Rev - given your talent and productivity, your former employer must have been crazy to lay you off! I trust that you will find a new and better-paid job soon, if that is what you are seeking. It’s often the case that when one door closes, another opens…

By the way, I’ve just added a link to your abc finder from my own website.

Re: A better mousetrap (or at least a better ABC tune search)

I too was thinking that about the Reverend’s obvious talents, Mix. I think over here they’d - still - be lining up to sign him up.

Posted by .

Re: A better mousetrap (or at least a better ABC tune search)

Heh, thanks for the kind words, guys. I got laid off because my company is going out of business (we got sued out of existence by a former partner). But that is the obvious downside of working for small startup companies.

Haven’t sold any tee-shirts because of it yet (Christmas is rapidly approaching, hint hint) ;-)

Anyway, the contour search function will come when I decide to dedicate another couple of days to this project. Probably pretty soon, but right now, I’m kind of sick of looking at it…

Re: A better mousetrap (or at least a better ABC tune search)

Sweet Jesus! I’m a CS major, and I took some DNA sequencing classes back in college - I remember thinking someone should do this sort of thing, but I didn’t actually expect it to ever happen.

This is revolutionary! I just identified a couple tunes I’ve never been able to find names for.

Thanks a million!

Re: A better mousetrap (or at least a better ABC tune search)

Interested parties might be interested in trying out my ABC search program that allows search by playing a phrase on an instrument. It currently requires a recent version of Java installed and you have to install the program on your computer rather than running it a web browser. I will make a browser supported version after Christmas.

Is your program using a variation of the edit distance algorithm? (mine does). My program also has a suite of algorithms for compensating for the playing of ornamentation, reversing, taking a breath, playing tunes in sets and will be the subject of my forthcoming PhD thesis (nearly finished). You can download my program here:

http://www.comp.dit.ie/bduggan/downloads/matt2.zip

More information here:

http://www.comp.dit.ie/bduggan/music/

For those that are interested I have named 2 of my algorithms:

MATT2 - Machine Annotation of Traditional Tunes
TANSEY - Turn ANnotation from SEts using SimilaritY profiles

Bryan

Re: A better mousetrap (or at least a better ABC tune search)

Hey Bryan,

I remember when you had posted about MATT before. I’ve never been able to get it to run (Mac OSX 10.5.5, with the most recent Java)

The error I get in the console is:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group
at matt.Transcriber.<init>(Transcriber.java:61)
at matt.Matt.<init>(Matt.java:45)
at matt.Matt.instance(Matt.java:33)
at matt.Matt.main(Matt.java:62)

My algorithm uses a variation of a Levenshtein distance formula…

Re: A better mousetrap (or at least a better ABC tune search)

I got a very similar error (the same?) to Reverend running on Windows XP; I then updated my (old version of Sun) Java from 1.5.xx to 1.6.xx and the app ran fine.

Didn’t have much luck in finding my whistled version of "Rodney’s Glory", but then I could hardly recognize it myself ;-)
When I have more time, I’ll check to see whether it was the transcription or the search that failed.

Fascinating stuff this; good luck with your PhD, Dr. Bryan.

Re: A better mousetrap (or at least a better ABC tune search)

OK. You got me, Rev. Absolutely superb! I heard a tune this week - turns out I must have misheard it. So I put my four or five notes in, wrong, and it *still* came up with the right tune.

Gotta hand it to you!

Posted by .