New open source key detection tool

Home :: General Discussion :: New open source key detection toolReply
New open source key detection tool
Posted on: 30.09.2011 by Kari Spindel
Hey all,

I just finished a computer science course and built a key detection tool for DJs as my final project. The tool is called KeyFinder. It's designed to work primarily with EDM, but it's highly tweakable and I've had decent results with various genres.

In addition to a batch key detection interface which can write to metadata tags, it includes a musical visualisation tool called a chromagram. I've found this quite useful for visualising chord structures, melodies and key changes, and I believe it's pretty unique in the DJ software world; I haven't seen any other tools that have something similar.

I got good accuracy during my experiments but unfortunately I didn't test it on a wide selection of music. I had very little time and had to key it all manually and then get the results verified. It would be great to improve KeyFinder to work on a wide variety of genres.

So I'm releasing it for free under the GPL, in the hope the community finds it useful. It's a bit primitive, and for Mac only at present, but it should be pretty simple to port to Windows if there's interest.

If you want to try it you can download a Mac binary here. My write-up which describes the algorithms is also there if you're into that kind of thing. If anyone has any interest in working on it, or any comments or questions, feel free to get in touch here or using the email address on that page.

Cheers
Kari Spindel
30.05.2012
Originally Posted by SlayForMoney
http://speedy.sh/2cDGa/keyfinderbug.rar

here, did it on a random song. Win OS, KeyFinder 1.15, using Mp3tag studio 3.55 to check.
also, ID3v1 track field is altered...strange...
OK, this is due to a conversion from ID3 v2.3 to 2.4. If you use kid3 (just Google it) to check the tags on the before and after you'll see that no data has been removed, it's just been translated to an updated tag version. TagLib (which KF uses for all tag reading and writing) only writes v2.4. Strangely, you had two copies of the Year field in your "before" file, which suggests that one of your apps is not quite standards compliant.

It's clear that this is responsible for most of the "disappearing" tag data issues people are reporting, especially on Windows where v2.4 isn't read properly by Explorer or (I believe) WMP.

I believe if you just convert back to v2.3 with iTunes or something you should get back to where you were. Let me know if you have any more trouble though.
Isa Erik
07.05.2012
Originally Posted by ibsh
Windows or Mac? And can you send me a before-and-after of that file?
Originally Posted by ibsh
Windows or Mac? And can you send me a before-and-after of that file?
http://speedy.sh/2cDGa/keyfinderbug.rar

here, did it on a random song. Win OS, KeyFinder 1.15, using Mp3tag studio 3.55 to check.
also, ID3v1 track field is altered...strange...
Kari Spindel
04.05.2012
Originally Posted by SlayForMoney
noticed a small bug: writing a key in a tag deletes the mp3's tag v2 "year" field :/
Windows or Mac? And can you send me a before-and-after of that file?
Isa Erik
03.05.2012
noticed a small bug: writing a key in a tag deletes the mp3's tag v2 "year" field :/
Hsiu Piermarini
02.05.2012
Originally Posted by ibsh
I don't know what that could be; are his permissions set right? When you use Cmd+T, does it say "tags written to 0 files" (or whatever the wording is)? It's possible he's trying to write to the Key tag in media types that don't support it, I suppose; that's the only thing I can believe of right now.
it does say tags written to 0 files.... his settings are for custom key codes to be automatically written during batch jobs to the comments section of his tags... he uses mp3s so it can't be that...

I'm going over to his place tomorrow to try to get this figured out... I'll post again tomorrow
Kari Spindel
02.05.2012
Originally Posted by mlull
this works amazing on my computer and I thank you many times sir!!!
Cool. You're welcome.

Originally Posted by mlull
however I installed it on a friends mac, and his iTunes xml won't load (same problem in Traktor too!) and we can't seem to figure the problem out... we went and looked thru all the songs in his iTunes and got rid of all the chinese characters in his tags and files to help the xml file, but after a refresh of itunes and re-save of the xml, the iTunes sync still hasnt worked (Traktor too)...

anyone have any similar issues? done some searching and the chinese letter thing is all that came up.
Are you sure the preferences are pointing to the right files for those libraries? If so, try copying his xml/nml files to your computer and repoint your KF installation at them; see if they load properly (obv the media files won't be there, but that's not necessary). I don't believe there are any ongoing problems with different character sets but I'm willing to be proved wrong =)

Originally Posted by mlull
also, when he does the run batch through drag and drop the keys are not automatcially written to the tags and won't go through using command T as well... (settings are set to auto tag)
I don't know what that could be; are his permissions set right? When you use Cmd+T, does it say "tags written to 0 files" (or whatever the wording is)? It's possible he's trying to write to the Key tag in media types that don't support it, I suppose; that's the only thing I can believe of right now.
Hsiu Piermarini
02.05.2012
this works amazing on my computer and I thank you many times sir!!!

however I installed it on a friends mac, and his iTunes xml won't load (same problem in Traktor too!) and we can't seem to figure the problem out... we went and looked thru all the songs in his iTunes and got rid of all the chinese characters in his tags and files to help the xml file, but after a refresh of itunes and re-save of the xml, the iTunes sync still hasnt worked (Traktor too)...

anyone have any similar issues? done some searching and the chinese letter thing is all that came up.

also, when he does the run batch through drag and drop the keys are not automatcially written to the tags and won't go through using command T as well... (settings are set to auto tag)


thanks!
Coral Nika
21.04.2012
I freaking love this. It's fast, its accurate and efficient; no useless functions, no useless options. Just what we need.
Armanda Yankauskas
05.04.2012
this seems really really cool. i would download but all my music is not on a computer, go figure haha. will def look into this more tho at lab with the hardrive that does house my music
Brunilda Kora
05.04.2012
Originally Posted by ibsh
[BBPM's an interesting one. I'd like to have a bash at it, but the truth is (at least for constant-tempo tunes) Traktor and Serato both have algos that are good enough. So I wouldn't want to release anything worse; what would be the point?
For me, it's about putting an audio file through a single app that will rename the file, incl. BPM and key (Then I can generate the tags in MP3TAG based on that info). Sometimes I like to sort on key, and sometimes I like to sort on BPM.
Latoria Kavulich
05.04.2012
Originally Posted by happydan
lol
Molly Moszer
02.04.2012
this is fantastic! it seems to work pretty accurately for me and it's super intuitive! keep up the good work!
Mimi Mahaffee
01.04.2012
Will for sure try this out and come back with feedback to you ibsh,
seems like it works regarding to other people?
robin loo
01.04.2012
Originally Posted by DJ SB
Thats what mine looks like.
what a coincidence.. mine too..
Evalyn Voges
01.04.2012
Halley Wurzer
01.04.2012
Originally Posted by happydan
So, IF one were to accidentally type a bunch of numbers and letters that *happen* to correspond to the Camelot Wheel, might it look like this?
Thats what mine looks like.
Evalyn Voges
01.04.2012
Screen shot 2012-04-01 at 16.19.52.png

So, IF one were to accidentally type a bunch of numbers and letters that *happen* to correspond to the Camelot Wheel, might it look like this?
Halley Wurzer
31.03.2012
I see 1.15 is up now, awesome. I am donating now and will try to get a few DJ friends to as well. We really appreciate your work man!
Isa Erik
31.03.2012
Originally Posted by ibsh
1.15 is up at http://ibrahimshaath.co.uk/keyfinder

It includes:
* Custom sorting in the table widget; just click a column header
* Big dumb memory leak fixed
* Another couple of bugfixes
many thanks for your work
i've tried the 1.10 version before and works like a charm. if i make any money out of my DJing, i'll be sure to donate
Halley Wurzer
31.03.2012
I don't see 1.15? It still says 1.14 under software.
Kari Spindel
31.03.2012
1.15 is up at http://ibrahimshaath.co.uk/keyfinder

It includes:
* Custom sorting in the table widget; just click a column header
* Big dumb memory leak fixed
* Another couple of bugfixes
Halley Wurzer
26.03.2012
Originally Posted by ibsh
Uploading now. Just download 1.14 again and you should be all good.
It's a beautiful sight. Thank you sir!Screen Shot 2012-03-26 at 10.18.19 PM.jpg
Kari Spindel
26.03.2012
Originally Posted by DJ SB
Thank you! Looking forward to it sir.
Uploading now. Just download 1.14 again and you should be all good.
Halley Wurzer
26.03.2012
Originally Posted by ibsh
Bizarre bug. I must've screwed up somewhere. Will patch 1.14 within the next couple days and drop a message for you here.
Thank you! Looking forward to it sir.
Kari Spindel
26.03.2012
Originally Posted by DJ SB
Thank you ibsh! 1.14 seems to fix the iTunes issue! However, regardless of if I select write keys, custom codes, or both, it always writes both. I didn't have this problem with 1.13. Ideas?
Bizarre bug. I must've screwed up somewhere. Will patch 1.14 within the next couple days and drop a message for you here.
Latoria Kavulich
25.03.2012
I'm going to give this a try today mate. I've been using MiK for years but if this does the business i'm sold Thanks for your hard work.

Win 7 64 Bit over here.
Halley Wurzer
26.03.2012
Thank you ibsh! 1.14 seems to fix the iTunes issue! However, regardless of if I select write keys, custom codes, or both, it always writes both. I didn't have this problem with 1.13. Ideas?
Kari Spindel
25.03.2012
BPM's an interesting one. I'd like to have a bash at it, but the truth is (at least for constant-tempo tunes) Traktor and Serato both have algos that are good enough. So I wouldn't want to release anything worse; what would be the point?

So I must be missing something. What software is everyone using that they need a separate BPM analyser?
Brunilda Kora
25.03.2012
Originally Posted by ibsh
* by popular demand, the option to write keys to filenames. Do not come crying to me if you fuck up your library.
Can't say fairer than that...

(If this also calculated BPM, it'd replace MIK for me...)
Kari Spindel
25.03.2012
Oi oi.
The new version 1.14 is now available.

This includes:
* a slightly smarter GUI (you can resize the two panes, and it remembers where you left it)
* a bunch of bug fixes (including for iTunes Comment tags)
* by popular demand, the option to write keys to filenames. Do not come crying to me if you fuck up your library.

This version also marks the arrival of LibKeyFinder, a C++ library of KeyFinder's algorithm. This is open sourced under the GPL, so any geeks out there can integrate it into their own stuff.

As always, intelligent feedback gratefully received. I'm aware of a crash and associated errors affecting a few Windows users, but I can't recreate it yet.
Halley Wurzer
23.03.2012
Right on, appreciate it!
Kari Spindel
23.03.2012
Need to be a little more patient than that, dude =)

It'll be this weekend at the earliest, maybe the weekend after. The deciding factor is how I get on with the other major bug I want to fix for this release, and I haven't looked at at that yet.
Halley Wurzer
22.03.2012
Any eta on the fix ibsh?
Halley Wurzer
20.03.2012
Originally Posted by ibsh
OK, committed a fix for SB's issue. It may also affect weltraumpapst's; hard to tell. It was a problem with iTunes being both non-standards-compliant and overly fussy.

I've got a few other bugs to check out so this fix may not get released for a little while, but it seems to work.

If you're impatient, and into the geeky stuff, you could always build it from source yourself. =)
I believe i'll have to wait haha, glad you got it figured out and really looking forward to getting my lib keyed in iTunes. Keep me updated, thanks man!!
Kari Spindel
20.03.2012
OK, committed a fix for SB's issue. It may also affect weltraumpapst's; hard to tell. It was a problem with iTunes being both non-standards-compliant and overly fussy.

I've got a few other bugs to check out so this fix may not get released for a little while, but it seems to work.

If you're impatient, and into the geeky stuff, you could always build it from source yourself. =)
Halley Wurzer
20.03.2012
Right on thank you sir, its got to have something to do with iTunes wack tag system.
Kari Spindel
20.03.2012
Alright, that behaviour's confirmed here SB.
I'll take a look next time I sit down to do bug fixes.
Halley Wurzer
20.03.2012
Originally Posted by ibsh
Alright, thanks for trying. Best thing now is probably for you to email/upload a zip with, say, 5 of these files in (make it representative, e.g. if you're having the same problem with multiple formats, make sure they're all in there) and I'll take a closer look. Hopefully it's easily fixed but I've not come across this before. Also version numbers for OS/iTunes/KF please.
Thanks so much! Sent you a PM.
robin loo
20.03.2012
reanalysing the batch does not do the trick. it works with MiK 4..

email will be sent in a few minutes..
Kari Spindel
20.03.2012
Nope, nothing there. If you do the same batch again does the same file fail? If so, send it my way.

I've got to get to work now, so you may have to find the pattern yourself. It might just be a problem with the tagging library I use, but it's very unlikely as the tagging code in KeyFinder hasn't changed in months and the library hasn't changed at all.

<< Back to General DiscussionReply

Copyright 2012-2023
DJRANKINGS.ORG n.g.o.
Chuo-ku, Osaka, Japan

Created by Ajaxel CMS

Terms & Privacy