iTunesMonkey 1.0 + Acoustid

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Thank you for the explanations!

One more question:
If I select 10 random tracks without album name stored in the id3tag, press CTRL-L (with the option 'iTunes Search') I get 8 track suggestions back from iTunes, including the matching cover. That's great.

But how can I configure your script to store not only the metadata like the album name back to the tracks?
In my case, I have selected 'Artwork' in the options too, but no cover will be saved the tracks.
I'm aware, that in the first step all the collected metada from iTunes will only be written automatically to the musicbrainz database. I have to synchonize this changes manually with CTRL-S back to my tracks. This works fine for the metadata like album name, but not for the artwork/cover.

What can I do/check/configure?

SORRY, I forgot to say: Yes, I press the little circle in the higher left corner, which asks me to save all the artwork to the selected tracks. But that doesn't happens...
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

I'll try to address all the points. If I miss something, please point it out.
MMuser2011 wrote: I'm aware, that in the first step all the collected metada from iTunes will only be written automatically to the musicbrainz database.
Um... I'm not sure what you meant. iTunesMonkey never contacts MusicBrainz. (In Acoustid Fingerprint Mode the metadata is from the Acoustid Service which they collected from MusicBrainz, but there's no direct communication with MusicBrainz in this tagging process.)

MMuser2011 wrote: I press the little circle in the higher left corner, which asks me to save all the artwork to the selected tracks. But that doesn't happens...
I believe this is your main issue.

So, first note that there is an expected exception to tagging artwork in this script.
If you are in the "My Computer" tree node, those tracks are not actually in your library, you're just exploring the content of the drive. Those just won't work.

When metadata is retrieved from the services you get to see it all, title, artist, album, etc. in the results.
In Tools > Options > Library > iTunesMonkey > Replace when something is selected it means that that field will be checked by default so it can replace the old content.
When a field is checked, you can see a little bold "check" symbol to the left of the title, artist or whatever field (if no changes will be made the symbol can be seen by moving the cursor over it).
In the case of the artwork, a "check" is represented by a blue background in the image's resolution. Unchecked are black.
Pressing the Artwork Circle will only tag those with a "checked" (blue background resolution) artwork.
Also, by selected tracks the warning means those tracks that in the bottom part of the "Auto-Tag from Web" window have a check mark on the very left, under where it says "Select which files to update".

And also, and this may be key to your solution, for the artwork tagging to work, Tools > Options > Library > Tags & Playlist > Update tags when editing properties has to be checked.
MediaMonkey just won't commit the new artwork otherwise.
I think I should put a warning when this is disabled to avoid the confusion.


I'm really sorry if artwork tagging seems too complicated, but "Auto-Tag from Web" scripts are not suppose to deal with multiple artworks. I did my best with the scripting tools MediaMonkey provides.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Thanks again for your time and explanations!
CarlitoGil wrote:
MMuser2011 wrote: I'm aware, that in the first step all the collected metada from iTunes will only be written automatically to the "musicbrainz database".
Um... I'm not sure what you meant.
That was a typo. I meant "MediaMonkey database". Sorry :oops:

This information is EXTREMELY important for me:
CarlitoGil wrote: In the case of the artwork, a "check" is represented by a blue background in the image's resolution. Unchecked are black.
Pressing the Artwork Circle will only tag those with a "checked" (blue background resolution) artwork.
CarlitoGil wrote:...And also, and this may be key to your solution, for the artwork tagging to work, Tools > Options > Library > Tags & Playlist > Update tags when editing properties has to be checked.
MediaMonkey just won't commit the new artwork otherwise.
I think I should put a warning when this is disabled to avoid the confusion.
CarlitoGil wrote:I did my best with the scripting tools MediaMonkey provides.
And the result is already a HUGE help!
It is only my lack of understanding of certain points 8)


Unfortunately, even if
- I am in the 'Entire library' tree node
- the cover dimension has a blue background color
- the 'Update tags when editing properties' option is checked
- I press the 'Artwork Circle' manually on the result page
- the warning appears, that the selected tracks will be updated
I can't see any cover inside my tracks (checked with the external tool Mp3tag).

Am I stupid?
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

MMuser2011 wrote:Am I stupid?
I don't think stupid people ask themselves that. I may be wrong, hehe.

Seriously, let me just double check this; in your list of bullet points I didn't see that you made sure the tracks were selected. You know, on the bottom half of the window, on the left side.
I'll assume they are checked.

I've seen many times MediaMonkey being quirky about tagging artwork, like random bugs unrelated to any script that prevent tagging. When debugging my script I encountered problems about artwork that just came and went, seemingly unrelated to the script. Very frustrating to debug. In my system it works well now. I think it worked consistently after I reinstalled MediaMonkey from scratch. Let's avoid that for now.

Please try to tag albumart for those same songs with other methods, like dropping an .jpg file on the albumart viewport, or use another script, preferably not an "Auto-Tag from Web" script like mine. Check if it works.

Also, check Options > Library > Tags & Playlists > Artwork > Image location.
Does it save the image to tag (the file)?

And just to know, what version of MediaMonkey are you using? And, which Windows?


I gotta say, I spent a lot of time worrying and working with tagging artwork. So, as far as I know the code works. I worried about possible bugs in MM. But, I think this is a configuration problem, some weird variable in the options or something.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Yes, the tracks are selected (and shows some yellow fields with the changes),
image location is set to store inside tags...

Short story:
Today, I started MediaMonkey with administrator rights (Win7 Ultimate, 64bit, MM v4.0.7.1511)
BINGO!!
Not it works as expected, the cover(s) will be saved inside the track (after pressing the Artwork Circle).

Thank you very much for all your help and patience!
You can't imagine how many missing album titles and covers I already found with your fantastic script! :D

P.S. I assume that your script write the cover comment "by iTunesMonkey"? (Line 2777)?
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

MMuser2011 wrote: Today, I started MediaMonkey with administrator rights [...]
BINGO!!
Not it works as expected
Great thinking!
In the next post I was going to start asking weird things like that (I was running out of ideas).
I'm just glad I it wasn't a bug of mine.
By the way, you wrote "Not it works". I know you meant "Now it works".
MMuser2011 wrote: Thank you very much for all your help and patience!
You can't imagine how many missing album titles and covers I already found with your fantastic script! :D
My pleasure. Enjoy.
I think you may have done it already, anyway, I see you're European, so choose your home country in the options. It may increase results for national songs.
MMuser2011 wrote: I assume that your script write the cover comment "by iTunesMonkey"? (Line 2777)?
Yep. It's lame, I know. Sorry about that, couldn't resist.
Feel free to change or remove that.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

CarlitoGil wrote:By the way, you wrote "Not it works". I know you meant "Now it works".
Uups, you are right. I was so happy that it works now. :wink:
CarlitoGil wrote:Feel free to change or remove that.
Thanks.
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Your script is incredible helpful!!

Could you please check this little inconsistency:
I select 92 tracks without album and without a year in the id3 tags. They have at least an artist and a title.
Then I start your script with the option 'AcoustID Fingerprint'.
When the progress bar shows 100%, I hoover over this bar and get:
'91 complete
1 remaining
19 not found'
The incosistency is in the first to numbers. They always show '1 remaining', and the complete number is always the total number -1. They never show 100% complete, 0 remaining.

This has no influence for the result, it's just a wrong summary. :wink:
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

MMuser2011 wrote:Your script is incredible helpful!!
Wow, in bold letter. I'm truly glad you're getting good results!

MMuser2011 wrote:Could you please check this little inconsistency
Well, it bugs me to have made a mistake like that, but sure, that should be easy enough to fix.
To fix it I need to reproduce the problem, so, I need to ask you a big favor.

Could you upload those songs that are causing the problem?
I need them because that doesn't happen (that I noticed) with the songs I have.

You could try Dropbox or Google Drive.
Put them in a shared folder and send me the address via private message.

Thank you.

PS. If you send it soon I promise to work on it before this weekend ends.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

Crap.
I just reproduced the problem. Never mind about uploading the songs.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

Don't hurry. It's after midnight here in Europe. :wink:
The most important thing is that you can reproduce the problem. I'm sure, you will fix it.
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
MMuser2011
Posts: 1308
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: iTunesMonkey 1.0 + Acoustid

Post by MMuser2011 »

I'm still fascinated about the incredible high recognition rate for missing album names and years!

And it's really like magic, if I see how your script detects the wrong spelled artists, like:
- Jimmy Hendrix -> Jimi Hendrix
- Jessica Folker -> Jessica Folcker
- Jocelyn Labille -> Jocelyne Labylle
- Jenna and Ron - > Jenna+Ron
- John Davis -> John Davies
and of course all the little typos (and additions!) in my titles.

Could you please tell us something about the "magic" behind your script?
Maybe starting with the option 'AcoustID Fingerprint'?
What exactly do you compare?
When do you set a track with the (yellow) 'to change' flag?

In extremely rare cases, I see a (yellow) 'to change' entry in the preview panel with completely different artist/album artist and year. How can I be sure in this cases, that my existing tags are simply wrong?
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

Most users just want a script to work, and I wanted those users to be happy with an intuitive and simple script.
An avid, power-user like you, MMuser2011, is also very welcome to use it, so I'll give some details of the inner workings of the script.
The post will be a little long, but I'm sure you'll enjoy it, and surely benefit from knowing some things.

I'll try to explain as clearly as possible. If I fail, please ask.

This script started after I got the iTunes Match service from Apple, which lets you analyse your music library and if, let's say, an old 128kbps .mp3 matches a song in the iTunes Store then they let you download their 256kbps .m4a through iTunes, effectively cleaning up your library, except that you keep the same old tags and artwork.
So I wanted a way to clean up these tags and, although I found a plug-in for iTunes, I wanted more control.
Then I made what would become iTunesMonkey. First, It would only detect those .m4a downloaded from iTunes, read an unique number their metadata had, and get the exact information that the iTunes Store had for that specific song. This is all done through an API that apple offers, that's why there's no need to install Apple software.
I even discovered a little hack that let me download those 600x600 artworks, instead of their thumbnails.
This method is almost perfect, but many songs downloaded from iTunes return no metadata through the API, and not all songs are in all the stores, so you have to specify which counties you want to search. The more countries you specify, the slower the match is. So it's good to prioritize, you local store first, from which you may find you local songs, then big stores like the United States one.
This would become the "iTunes Match" mode from iTunesMonkey.

Then I wanted a way to get metadata, specially those artworks, into songs that are not downloaded from iTunes and this would become the "iTunes Search" mode.
This mode uses text search. You get the same results as typing the same text into the iTunes search box. But, what text?
It uses the tags you already have, which of course may be wrong. So, for each song, it searches for different patterns. It would search for "Title - Artist", or "Title - Album", and many combinations, until a good match is found.
What is a good match? Each pattern may return multiple results, and each one is ranked.
Ranking the results is done by comparing the existing tags with the results.
Each tag, like title, is compared using the "Levenshtein distance", which assigns a value to determine how different two strings are, so "Jimmy Hendrix" is a lot like "Jimi Hendrix" because they have a lot of letters in common, and in almost the same places.
I also compare "Album - Artist - Title", because you may have switched Artist and Title, so they would never match, but if you compare them together, like "Artist - Title" against "Title - Artist", the match would be closer than none at all. In the iTunesMonkey options this is called "Swap".
I also compare the length of the song. So, if you have the radio edit of a song, the length could be very different from the album version, and helps determine which one you have.
The user can use the iTunesMonkey options, under "Score", to assign an importance to each tag. A user may have tagged titles correctly or close to correct, but the albums may not be trusted, so In the options "Title" should be a high number and "Album" a low one, so if the script finds a match with a similar title it will give it more importance that not having found a similar album.
This ranking system will show the result with the highest score. That score is represented by the colored bars shown next to the song's length in the results.
If you want to have a minimum score, so only results with similar tags to the existing ones are shown, you can set "Minimum" under "Score" in the options.
If the file was downloaded from iTunes, then "iTunes Match" mode is used.

I also wanted a traditional approach. All other Search Scripts I've seen in MediaMonkey assume all the tracks you select are from the same album, and use the information from multiple tracks to determine which album fits them best; presenting you in the results with only one album at the time. This concept is what I tried to capture in the "iTunes Album" mode.
Other possible albums are listed in the drop-down near the top of the window. In the drop-down you can also write anything you want and it will get many albums that match that query and determine which album is more likely to have the tracks that were selected. This is a good way to influence the results, and unify tracks under the same album.

Now, "Acoustid Fingerprint". Why would I add Acoustid to an iTunes script? Because many people don't download their music from iTunes, so "iTunes Match" won't work for them, And, if you're looking to fix your tags, probably your tags are wrongs, so using them to search for correct ones is futile. So I needed a way to fingerprint the songs so I could get better tags based on the audio itself and then use those tags to search for the iTunes metadata, including artwork.
Acoustid is a great project, it's free, it's open. They work with MusicBrainz, which is another great project.
In this mode your audio is analysed generating an audio fingerprint, that fingerprint is compared in the Acoustid servers to other similar ones. For those fingerprints there is an unique ID to unify them, and that ID is associated with a MusicBrainz recording ID.
So Acoustid provides the script with metadata obtained from MusicBrainz and the script determines which one is most similar to the current metadata just like the "iTunes Search" mode does; taking clues from the current metadata to determine the best match; an track number, song length, etc.
In this mode there are no artworks because the metadata comes from MusicBrainz, not iTunes. The metadata in this mode is provided by users that contribute to MusicBrainz, so sometimes it's not perfect, but helps.

And then there's the "iTunesMonkey" mode. If a file is downloaded from iTunes, "iTunes Match" mode is used. If not, "Acoustid Fingerprint" is used to get better tags for that song and then those tags are used like in "iTunes Search" mode to search for the metadata from iTunes, including artwork. This is meant to be the most powerful mode.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: iTunesMonkey 1.0 + Acoustid

Post by CarlitoGil »

I forgot to answer a couple of questions.
MMuser2011 wrote:When do you set a track with the (yellow) 'to change' flag?
As explained in my previous post, there is a ranking system to determine the best match.
The system gives a score to the match, represented by the colored bars next to the title.
In the iTunesMonkey options, under "Score", you can specify "Minimum" and any match below that won't be presented.
Of those that are presented, you can choose which ones enable the check mark next to the track in the bottom grid, thus showing the yellow highlights.
To do this, go to the options, under "Score", there you'll see "Select". You can set how much score is needed for a match to be safe enough to toggle the "'To Change' flag".

MMuser2011 wrote: In extremely rare cases, I see a (yellow) 'to change' entry in the preview panel with completely different artist/album artist and year. How can I be sure in this cases, that my existing tags are simply wrong?
Remember, If you use the "Acoustid Fingerprint" mode the metadata comes from MusicBrainz, not iTunes. But, every other mode, including the "iTunesMonkey" mode, which combines "Acoustid Fingerprint" and "iTunes Search" you will get an "iTunes Preview". This is represented by a play button next to each track in the results.
If the metadata seems too different, you should use the play button to compare the audio from your file against the audio iTunes has for that metadata.
Clicking the play button will play the preview, and right-clicking it will play your local file, so you can switch between them quickly.

If the sound from preview is the same from your file then the metadata can be mostly trusted.

I know you like the "Acoustid Fingerprint" mode, in these cases you should try the "iTunesMonkey" mode so you get the preview button.
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid
gpzbc
Posts: 1226
Joined: Sat Sep 13, 2008 12:02 am
Location: Colorado, USA

Re: iTunesMonkey 1.0 + Acoustid

Post by gpzbc »

Thank you for the explanation. It helps me to better understand it. And thanks for your work on a fantastic script!
--
The gpzbc
Post Reply