INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Expression for advanced tagging  (Read 1798 times)

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1266
Expression for advanced tagging
« on: June 28, 2011, 05:58:39 pm »

I am not very skilled with all the expression oppurtunities in MC, so i wondered if something like this is possible:

The case: I am planning to use musicbrainz picard to tag all my Mp3s, this is a program wich analyses the tracks audio signature, and looks up info from an online database. My tag info is basically pretty good, but i want to get Last-fm-info, like mood, grouping, genre and so on. This works OK, but some songs are not in the musicbrainz database.

So my question is. is there a way to use expressions to copy tags from the other files on the album if a song is not found? None of my files have the tag "grouping" at the moment, so i would think the easiest way would be an expression that does "if song does not have the tag "grouping", and other songs in the same folder has the tag "grouping" copy tag "grouping" (or mood or whatever) from one of the other songs" Is it possible to make an expression that accomplishes something like this?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8973
Re: Expression for advanced tagging
« Reply #1 on: June 28, 2011, 11:54:12 pm »

As per the Wiki expressions page, we cannot use expressions to compare tags in one file with those in another, therefore, the direct answer to your question is "No".

I am no expert in mp3 tagging and know even less about Musicbrainz, so you may want to wait for someone more knowledgeable in this area to add their thoughts, but I'm wondering if you couldn't use the new MC16 'relational' field feature for this purpose.

The only possible downside I can see with this approach is that the relational nature of a field is global, ie. it cannot be set on a per album basis.

Only one file in an album would need to be tagged, and all other tracks in that album would adopt the same information.
I do not know what would happen to existing albums that already contained differing information at the time you switch the field to relational.
I do not know if the tags would be saved in the file (assuming you the field set to be saved in the file) in the desired fashion.

We can only change the relational nature of fields that are deemed "User" fields in the MC library. To get at the field manager, go to "Tools>Options>Library and Folders>Manage Library Fields".
Set the drop-down in the top left to "Show only user fields", select your chosen field in the list below it, then edit the relational status over on the right hand side, in the "Data" section.

If you do end up experimenting with this, it may be prudent to perform a library backup before you start.

-marko.

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1266
Re: Expression for advanced tagging
« Reply #2 on: June 29, 2011, 02:45:11 am »

THanks for the feedback, informative, although a bit discouraging. I guess i can just use the "Isempty"-function to check if the "grouping"-tag is there, however without being able to compare to the other songs, I won't easily be able to do the  rest of the steps. I will see if i can understand the whole relational field-thing.

I guess it using musicbrainz isn't very important, the main point is that most songs have "grouping", "mood" and so on, but a few does not.
Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Expression for advanced tagging
« Reply #3 on: June 29, 2011, 04:49:22 am »

Quote
without being able to compare to the other songs, I won't easily be able to do the  rest of the steps.

It would be cool to be able to compare values between files, but that would add a whole order of complexity to designing how data is to be collected and presented. Just taking advantage of relational fields requires careful planning. It pays to consider carefully the exact nature of the data available, how it's going to be obtained, it's integrity maintained, and how it's going to be used.

I'm not familiar with the sources you're using, so let me make up my own example to illustrate. Let's say Source1 assigns moods (list items) to albums. Since there's one value per album, it would make sense (mainly for data integrity) to store this in an album-relational field [a.Moods.1]. Now let's say Source2 assigns moods (also list items) to tracks. Those aren't related to albums, and maybe the data won't even be retrieved by album, so there's no point in trying to associate these values with albums. It's best put in a regular non-relational field [t.Moods.2].

So now I have two similar sets of data, each in their own fields. This way, I know exactly what they are and will find it easier to keep them up-to-date and maintain their integrity. This, however, is probably not how I want to use them. That's okay—they're just "raw" data—I'll use expressions to manipulate and present them any way I please. Exactly what that is depends on the circumstances and my preferences. For example, if the data from the two sources is very similar and two sources are used simply because neither are complete, an expression might use one source just to fill gaps in the second. Or they could be combined together into one list without regard to the source. Although it can't be done automatically, [t.Moods.2] could be combined by album and used to fill [a.Moods] in cases where there is no data from Source1.

In the end, the objective may be to fill [Moods]—an expression field that in some way combines the data in the other fields. And this may be the only field used or displayed. Or expressions might be used wherever necessary to display exactly what's required for a column, caption, info panel, etc.

This can also be a good approach for the situation where one source has data for most of your files, but not all. Rather than "filling the holes" manually, it might make sense to keep the data from the source and that which you enter manually in separate fields. Doing so allows you to update from the source without fear of losing the manually-entered data (should it remain "better"). And the two can easily be combined with an expression.
Logged

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1266
Re: Expression for advanced tagging
« Reply #4 on: June 29, 2011, 10:59:48 am »

I tried making mood a relational field now (album-based, whats the difference between that and "series-based?"). However i have little luck. If i update the tag, or update library from the tag with a file on the album with the mood-tag, nothing happens (its treated as a single file with no relation), the same if i try to update tags, or update library on one of the files with no info in the mood-field. Is there a special way to do it, a right order or something? Furthermore, after doing this, the setting for the field automatically jumps from relational to non-relational (its back to no-relational if i go back into the options)
Logged

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Expression for advanced tagging
« Reply #5 on: June 29, 2011, 12:43:37 pm »

Furthermore, after doing this, the setting for the field automatically jumps from relational to non-relational (its back to no-relational if i go back into the options)

Mood is probably a stock field then that is not capable of being relational.

If you are getting tags from MB, set the MC library field to the exact name of the MB field and make the MC field relational per album (and update all files from its tags). I am not sure exactly how relational fields behave when updating one file from its file tags, but I remember that it worked fine for me when I used a relational field (per artist). You will have to try that out.

If Picard puts data in a tag which the MC stock Mood field reads, I do not think there is any practical way of importing data from the file tags to a relational MC field. I would in this case use smartlists to check for consistency. Here is an expression I use for this (checking the Mood, Theme and Style MC fields in one go):
Code: [Select]
[Media Type]="audio" ~nodup=[Album],[Style],[Album Artist (Auto)],[Theme],[Mood] ~sort=[Album] ~dup=[Year /- Album /(Album Artist/)] ~a ~sort=[Track #]
[Year /- Album /(Album Artist/)] is a custom expression type field I use to get unique album names, but I think you could substitute that with [Album],[Album Artist (auto)].

Any album showing up in that smartlist should have inconsistencies in its tags. Select all files in one album and use the Tag action window to select, one at a time, the fields that says [Varies] and select from the top of the drop down menu the value that seems correct.

PS. If you are playing with relational fields, I strongly recommend using frequent backups of both your MC library and your music files (if you have set MC to write library data to the file tags.
Logged

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1266
Re: Expression for advanced tagging
« Reply #6 on: July 03, 2011, 06:10:36 am »

Thanks for the help on the smart-list, I have run into a few problems though.

1. I have added to the smartlist "filename begins with", because i have all the files i am experimenting on in a separate location. The problem is that if i have a smartlist with this modifier, it will contain both the song that I have moved to my experimenting folder, and also the original file that already was in the library (same song, stored another place).

2. Possibly related, I have changed "mood" to "grouping" as thats a bit easier to handle, but the smartlist also contains albums where the grouping is the same on all tracks. Not just the ones with inconsistencies. It might however be because the "original file" have no grouping at all.
Logged
Pages: [1]   Go Up