Genre Finder 5.0 - Updated 05/08/2012

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Genre Finder 4.1 [MM2+3]

Post by trixmoto » Thu Nov 05, 2009 4:05 am

Thanks for investigating this. It definitely used to work at some point, but I must have moved some code around when fixing something and lost this differentiation! :oops: I'll definitely get this fixed in the next version.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: Genre Finder 4.1 [MM2+3]

Post by Owyn » Thu Nov 05, 2009 5:00 am

Thanks. Looking forward to it.
PM me if you want the code tested prior to release.

BTW: This is the same place where I would insert the Preserve List detect code.
I was considering a case structure on list type.
Case 1: Whitelist
Case 2: Blacklist
Case 3: Preservelist

Then move the resolving and final action loop out of the loop, i.e. after all lists are processed.

Case 1 & 2 resolved after this loop.
Case 3 resolved after the outer loop (elements).

Just my 2cents.
Edit: You could also simplify Acceptable at the same time. It can just return a value without differentiation between list types(well mauybe check that you haven't sent it a Preservelist. But that would be paranoid code (not a bad thing, but...).)
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Genre Finder 4.1 [MM2+3]

Post by trixmoto » Fri Nov 06, 2009 5:51 am

I assumed that you would want to use the preserve list in conjunction with a white or black list, rather than have it as a separate option?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: Genre Finder 4.1 [MM2+3]

Post by Owyn » Fri Nov 06, 2009 6:06 am

trixmoto wrote:I assumed that you would want to use the preserve list in conjunction with a white or black list, rather than have it as a separate option?
Yeah. My anticipated use is to have all 3 in operation concurrently. Will only be using Artist data.

Whitelist selects and maps the last.fm genres that I want.
Blacklist cleans up from whitelist (e.g. "jazzapedia" gets through "jazz%" but I don't want it.)
Preservelist picks up special genres that I already have in the library, e.g. A Jazz album might already have a "Xmas" tag on the track "Winter Wonderland".

Edit: I hope that answers your question. My anticipated use doesn't really separate specific local from global operations. I don't plan on using this script for anything except fixes to Genre, so all of the settings are specific to that task.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Genre Finder 4.1 [MM2+3]

Post by trixmoto » Fri Nov 06, 2009 10:47 am

Ah, that does makes things much more complicated! At the moment only one type of list is possible for a single field (white or black).
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: Genre Finder 4.1 [MM2+3]

Post by Owyn » Fri Nov 06, 2009 11:18 am

trixmoto wrote:Ah, that does makes things much more complicated! At the moment only one type of list is possible for a single field (white or black).
Why don't you release the script without this enhancement and let me play with it. I do have a vested interest in the function and would have to make changes in the same area that you are already working on (Line 430..). I also think I have a pretty clear idea about how and where to make the change.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies

Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: Genre Finder 4.1 [MM2+3]

Post by Owyn » Fri Nov 06, 2009 5:14 pm

Made another quick patch to support "string1*string2" mask.

I did this because I kept adding masks to support small differences in strings, e.g.
"Alt Country,Alt-Country=Alt Country,Alt. Country=Alt Country,Alternative Country=Alt Country"
was replaced with
"Alt*Country=Alt Country"

Diff of my current patch state follows:

Code: Select all

26a27,30
> ' Owyn 2009-11-06 (v02)
> ' - Added string1*string2 mask, e.g. Alt*Country
> ' Owyn 2009-11-04 (v01)
> ' - Added ClearCache routine
28a33
> Dim OwynPatch : OwynPatch = "02"
190a196,208
>   ' Owyn (start)
>   If ini.BoolValue("GenreFinder","ClearCache") Then
> 	If debug > 2 Then
> 		Dim cac1 : Set cac1 = SDB.Objects("GenreFinderCache")
> 		cac1.Removeall
> 		Set cac1 = Nothing
> 		Call out("Cache cleared...")
> 	End if
>   End if
>   If debug > 2 Then
> 	Call out("Owyn Patch... Version " & OwynPatch)
>   End if
>   ' Owyn (end)
807,808c825
<     Else
<       If Right(t,1) = "%" Then
---
>     ElseIf Right(t,1) = "%" Then
813a831,840
> 	ElseIf InStr(t,"*") > 0 Then 'Owyn
> 		Dim t1,t2,s1,s2
> 		If Len(s) >= Len(t)-1 Then
> 			j = InStr(t,"*")
> 			t1 = Left(t, j-1)
> 			t2 = Mid(t, j+1)
> 			t = t1&t2
> 			s1 = Left(s, j-1)
> 			s2 = Mid(s, Len(s)-Len(t2)+1)
> 			s = s1&s2
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies

Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: Genre Finder 4.1 [MM2+3]

Post by Owyn » Sat Nov 07, 2009 11:33 am

Well, that's it. Calling a halt to White List tuning.

In case it's of use to others, here is what I ended up with. With some caveats.
1)This is an old-fogie with strong preference to Jazz, Blues, Folk & Americana list
2)It uses the "*" mask which at this time is only in my patched code
3)I set Use Top Results=5. Played around with larger values but the suggested genres just started getting funky.
4)The results achieved really depend on the quality of your Artist tags to begin with. GIGO.
5)Remember, this list is specifically for Artists mode.

The list got very long and I had to manage it in a text editor. About half way through I broke it into categories for maintenance which are then concatenated to form a single list for the GF options.

The order of these sub-lists is important. GF uses the first matching mask for a tag returned from last.fm. Note that the comma at the end of each of these lists is significant. It is needed for when I concatenate them.

So, having said all that, here are the lists.
Instruments:

Code: Select all

Accordian,Banjo,Bass,Blues Harp,Cello,Clarinet,Fiddle,Flute,Guitar,Harmonica,Harp,Instrumental,Percussion,Piano,Saxophone,Trumpet,Ukulele,Violin,
Locations:

Code: Select all

Africa=African,African,America=American,American,Austin,Australian,Bakersfield,British,Canada=Canadian,Canadian,Cuba=Cuban,Cuban,France=French,French,German,Irish,Jamaican,Japanese,Memphis,Nashville,New Orleans,Scottish=British,Spanish,Swedish,Texas,
Periods:

Code: Select all

1920s=20s,20s,1930s=30s,30s,1940s=40s,40s,1950s=50s,50s,60s,70s,80s,90s,00s,
Specific genres:

Code: Select all

ACappella=A Cappella,A Cappella,Acoustic,Alt*Country=Alt Country,Alt*Folk=Alt Folk,Alt*Rock=Alt Rock,Ambient,Americana,Big Band,Bluegrass,Boogie=Boogie Woogie,Boogie*Woogie=Boogie Woogie,Britpop,Cajun,Chansons,Classic Rock,Classical,Comedy,Dance%=Dance,Disco,Doo*Wop=Doo Wop,Duets,Electronic%=Electronic,Female Vocalists,Filk,Flamenco,Folk*Rock=Folk Rock,Funk,Girl*Groups=Girl Groups,Grunge,Hip*Hop=Hip Hop,Humor=Comedy,Humour=Comedy,Jam Band,Latin,Mellow,Motown,Novelty,Old*Timey=Old Timey,Oldies,Polka,Psychedlic%=Psychedlic,Pop*Rock=Pop Rock,R&B=R&B,Ragtime,Rap,Reggae,Rhythm*Blues=R&B,RnB=R&B,Rock*Roll=Rock&Roll,Rockabilly,Singer*Songwriter=Singer Songwriter,Ska,Surf,Swamp,Swing,Zydeco,
Genres I want lot's of detail about:

Code: Select all

%Blues,Blues%,%Bop,%Country,Country%,%Folk,Folk%,Guitar%,Indie%,%Jazz,Jazz%,%Soul,
Cleanup/Roll-up genres:

Code: Select all

Celtic%=Celtic,Christian%=Christian,Garage%=Garage,Gospel%=Gospel,%Goth=Goth,Goth%=Goth,%Metal=Metal,Pop%=Pop,Punk%=Punk,%Rock=Rock,Rock%=Rock,Vocal%=Vocal,World%=World
and when the whole thing is put together.

Code: Select all

Accordian,Banjo,Bass,Blues Harp,Cello,Clarinet,Fiddle,Flute,Guitar,Harmonica,Harp,Instrumental,Percussion,Piano,Saxophone,Trumpet,Ukulele,Violin,Africa=African,African,America=American,American,Austin,Australian,Bakersfield,British,Canada=Canadian,Canadian,Cuba=Cuban,Cuban,France=French,French,German,Irish,Jamaican,Japanese,Memphis,Nashville,New Orleans,Scottish=British,Spanish,Swedish,Texas,1920s=20s,20s,1930s=30s,30s,1940s=40s,40s,1950s=50s,50s,60s,70s,80s,90s,00s,ACappella=A Cappella,A Cappella,Acoustic,Alt*Country=Alt Country,Alt*Folk=Alt Folk,Alt*Rock=Alt Rock,Ambient,Americana,Big Band,Bluegrass,Boogie=Boogie Woogie,Boogie*Woogie=Boogie Woogie,Britpop,Cajun,Chansons,Classic Rock,Classical,Comedy,Dance%=Dance,Disco,Doo*Wop=Doo Wop,Duets,Electronic%=Electronic,Female Vocalists,Filk,Flamenco,Folk*Rock=Folk Rock,Funk,Girl*Groups=Girl Groups,Grunge,Hip*Hop=Hip Hop,Humor=Comedy,Humour=Comedy,Jam Band,Latin,Mellow,Motown,Novelty,Old*Timey=Old Timey,Oldies,Polka,Psychedlic%=Psychedlic,Pop*Rock=Pop Rock,R&B=R&B,Ragtime,Rap,Reggae,Rhythm*Blues=R&B,RnB=R&B,Rock*Roll=Rock&Roll,Rockabilly,Singer*Songwriter=Singer Songwriter,Ska,Surf,Swamp,Swing,Zydeco,%Blues,Blues%,%Bop,%Country,Country%,%Folk,Folk%,Guitar%,Indie%,%Jazz,Jazz%,%Soul,Celtic%=Celtic,Christian%=Christian,Garage%=Garage,Gospel%=Gospel,%Goth=Goth,Goth%=Goth,%Metal=Metal,Pop%=Pop,Punk%=Punk,%Rock=Rock,Rock%=Rock,Vocal%=Vocal,World%=World
:D
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies

Kevinowpb
Posts: 126
Joined: Sat Dec 22, 2007 10:18 am
Location: West Palm Beach
Contact:

TRACK then ARTIST

Post by Kevinowpb » Tue Nov 10, 2009 6:25 pm

search for TRACK .... THEN ARTIST?

Can this be configured to try the TRACK first.. and if nothing found.. go to the ARTIST?

Thanks!

Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada

Re: Genre Finder 4.1 [MM2+3]

Post by Owyn » Wed Nov 11, 2009 3:34 am

The query to Last.FM for Album should be using AlbumArtist instead of Artist.

A lot less timeouts that way. :D

PS: Did not test last.fm with mult-artist compilation albums, ie. AlbumArtist="Various Artists"
PPS: Looks like the main impact is on sub GenreFinder, but, got the feeling that there could be other impacts. Not playing with that code myself. :o
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Genre Finder 4.1 [MM2+3]

Post by trixmoto » Wed Nov 11, 2009 5:01 am

@Kevinowpb - I tried this once but the architecture of the script really doesn't allow for it. It would be better to run in track mode sending all the unknown tracks to a playlist, and then run artist mode on that playlist.

@Owyn - I've added this to my list :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

HyperCriSiS

Re: Genre Finder 4.1 [MM2+3]

Post by HyperCriSiS » Sun Nov 22, 2009 9:04 pm

Hello,

i really like this plugin, thanks for it!
I have a suggestion. Can u maybe add some more sites to query?
For example https://www.beatport.com which has nearly every electronic track.
Would be really aweseome if you add some more sites!

Hyper

mohikaani
Posts: 63
Joined: Wed Oct 31, 2007 2:25 pm

Re: Genre Finder 4.1 [MM2+3]

Post by mohikaani » Mon Nov 23, 2009 5:13 pm

I get these errors while running in artist mode:
Image
Image

It happens always on some artists like "Bliss", "Beta 2 & Zero Tolerance", "Beth Gibbons & Rustin Man", "bülent"

Does it matter that I have Finnish localization?
Windows 7 | MediaMonkey 3.2.0.1294
Dell Studio 1537 (Core 2 Duo T6400, 320GB HD, 4GB RAM, ATI Radeon HD 3450)

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Genre Finder 4.1 [MM2+3]

Post by trixmoto » Tue Nov 24, 2009 4:10 am

Hmmm, I'm not sure, I don't think localisation should affect anything. I'll investigate and try to get this fixed in the next version.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

Aff
Posts: 301
Joined: Sun Oct 05, 2008 4:46 pm
Location: Switzerland

Re: Genre Finder 4.1 [MM2+3]

Post by Aff » Sun Nov 29, 2009 8:12 am

MM crashes with GenreFinder when I change to the next song (after a few songs).
The debug version says:

2.2 Address : 008904B8
2.3 Module Name : MediaMonkey.exe - (MediaMonkey - Audio Librar)
2.4 Module Version: 3.2.0.1294
2.5 Type : EAssertionFailed
2.6 Message : Error:_Starting a transaction while some query is open. Running queries are:_
SELECT Songs.*
FROM Songs
WHERE IDAlbum=4181 ORDER BY CAST(TrackNumber AS INTEGER) LIMIT 1
.
(C:\Sources\MediaMonkey 311\MP3Datab\SQLiteDB.pas, line 209).
2.7 ID : F8B3

Any idea?

Post Reply