Help - Search - Members - Calendar
Full Version: Questions regarding Title formatting for albumlist
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Benji99
Hi guys, I have a few a questions regarding formatting titles for the albumlist panel I hope someone will be able to answer...

1.) Regarding the $if statement, is it possible to have it check for the value of a tag instead of just wether a tag is valid or not? Ex. I want it to check %genre2% and IF the value is classical then do something, if it's not, do something else. What other kind of values/statements can I use in the $if statements? what else returns true/false

2.) Is it possible to have more complicated If statements? Basically, I have a very different tags for classical music than I do for everything else, I'd like for example, depending on the value of %genre2% to have completely different branches with different levels, including different numbers of levels.

3.) I've extracted and stored lots of Performer information for my tracks, I've decided to format them this way %PERFORMER_PIANO%, %PERFORMER_VOCALS%, etc... the value contains just the name. The problem is that the string after the
'_' is variable, it could theoretically be anything, and so far have A LOT of different instruments/credits used. Each Track can have a variable number of %PERFORMER_% tags, anywhere from 0 to dozens of them, and each can have multiple values. Knowing this I have the following questions:

a.) Is it possible to list/categorize by the peformer type (the value after the _ in %PERFORMER_****%? So basically, 1st level: All Peformers, 2nd level: Piano or Violin, or Vocals or Trumpet, etc...

b.) Is it possible to treat all tags that start with %PERFORMER_% treated like one? Essentially, I'm looking for something that would work like a wildcard (%PERFORMER_*%) This so I can list ALL Peformers regardless of which type of performer they are.

c.) The reason I stored/ordered my Peformer info in the way I did was to accomplish the following: Be able to differentiate between different type of performers (Piano, conductor, orchestra, vocals, etc...) I only wanted to the name to show up in the value field to make the listings look cleaner, and I didn't really want to include the performance type in the value with the name. If the way I've done it makes it impossible to reach my goals, does anyone have any suggestions as to how I could re-organize my tags?

4.) Is there anyway to parse text through Regex type functions? Say, take a tag value, run a function to extract some information from it, then use that somewhere. The idea I have in mind is this, I list my classical work by Work Title and not by Album, what happens is that I have some works which are named exactly the same, so they show up as one work in the album list, I wanted to defferientate them this way: So that say Piano Concerto No. 1 would be listed as Piano Concerto No. 1 (Conductor Name) (Recording date). The problem is that the conductor includes the full name, say Karajan, Herbert Van, I'd like only the Last name to show up in the Work Title, basically anything before the ','. The same for the recording date which can be quite complicated such as Mar 1 1957 to Apr 4 1968. I'd like to only show only the YEAR extracted from the above. So that basically I could have a work title that looks like: Piano Concerto No. 1 (Karajan) (1957)

That's about it, thanks in advance for the help!

Benji99
Synthetic Soul
Have you taken a look at the file "titleformat_help.html" in your foobar directory? This should be your first step toward what you want.

1. Take a look at the $strcmp() function

2. You can nest your $if()s which will give you your branching, i.e.:

$if(<condition>,<true statement>,<false statement>)

... becomes:

$if(<condition 1>,$if(<condition 2>,<true statement 2>,<false statement 2>),<false statement 1>)

You can use $and() also to perform logical AND operations.

3.a./b. There's no easy way to treat all your "PERFORMER_" tags as one. You will need to query each one, and then use some serious scripting to do those things you require. Best of luck.

c. Do a HA search for classical tags - I have seen this discussed before

4. No RegExpr, but you do have string functions like $left(), $strchr(), $strstr(), $substr(), etc.
gfngfgf
QUOTE(Benji99 @ Feb 1 2005, 08:53 AM)
1.) Regarding the $if statement, is it possible to have it check for the value of a tag instead of just wether a tag is valid or not? Ex. I want it to check %genre2% and IF the value is classical then do something, if it's not, do something else. What other kind of values/statements can I use in the $if statements? what else returns true/false
*



$strcmp() should help you there. Check out the titleformat_help.html file in the main foobar directory for a list of all the commands you can use. It should be pretty easy to figure out which ones return true/false (I think it's actually 1/0 in this case).

QUOTE(Benji99 @ Feb 1 2005, 08:53 AM)
2.) Is it possible to have more complicated If statements? Basically, I have a very different tags for classical music than I do for everything else, I'd like for example, depending on the value of %genre2% to have completely different branches with different levels, including different numbers of levels.
*



If you're talking about something like "$if(condition1,$if(condition2,...,...),...)", then yes, it is possible.

QUOTE(Benji99 @ Feb 1 2005, 08:53 AM)
3.) I've extracted and stored lots of Performer information for my tracks, I've decided to format them this way %PERFORMER_PIANO%, %PERFORMER_VOCALS%, etc... the value contains just the name. The problem is that the string after the
'_' is variable, it could theoretically be anything, and so far have A LOT of different instruments/credits used. Each Track can have a variable number of %PERFORMER_% tags, anywhere from 0 to dozens of them, and each can have multiple values. Knowing this I have the following questions:

  a.) Is it possible to list/categorize by the peformer type (the  value after the _ in %PERFORMER_****%? So basically, 1st level: All Peformers, 2nd level: Piano or Violin, or Vocals or Trumpet, etc...

  b.) Is it possible to treat all tags that start with %PERFORMER_% treated like one? Essentially, I'm looking for something that would work like a wildcard (%PERFORMER_*%) This so I can list ALL Peformers regardless of which type of performer they are.

  c.) The reason I stored/ordered my Peformer info in the way I did was to accomplish the following: Be able to differentiate between different type of performers (Piano, conductor, orchestra, vocals, etc...) I only wanted to the name to show up in the value field to make the listings look cleaner, and I didn't really want to include the performance type in the value with the name. If the way I've done it makes it impossible to reach my goals, does anyone have any suggestions as to how I could re-organize my tags?
*



As far as I know, this isn't possible. I've never heard of using wildcards within a tag name. I can think of some tricks that *might* help you acheive *some* of your goals, but it would involve a lot of serious retagging of your files. (Basically, you could include a tag like %instruments% that would contain multiple values of all the possible xxx's in %PERFORMER_xxx% for that particular file, but again, I'm not sure how far that would take you)

QUOTE(Benji99 @ Feb 1 2005, 08:53 AM)
4.) Is there anyway to parse text through Regex type functions? Say, take a tag value, run a function to extract some information from it, then use that somewhere. The idea I have in mind is this, I list my classical work by Work Title and not by Album, what happens is that I have some works which are named exactly the same, so they show up as one work in the album list, I wanted to defferientate them this way: So that say Piano Concerto No. 1 would be listed as Piano Concerto No. 1 (Conductor Name) (Recording date). The problem is that the conductor includes the full name, say Karajan, Herbert Van, I'd like only the Last name to show up in the Work Title, basically anything before the ','. The same for the recording date which can be quite complicated such as Mar 1 1957 to Apr 4 1968. I'd like to only show only the YEAR extracted from the above. So that basically I could have a work title that looks like: Piano Concerto No. 1 (Karajan) (1957)
*



You can't use Regex functions explicitly, but there are some string functions that can help you out with those specific examples you gave. Particularly, a combination of $strchr() and $substr() should be able to take care of the composer. Also, $substr() should help you with extracting the year, too, except you might have trouble since you use single-digit numbers for the day. Take a look at titleformat_help.html and see if that helps. Sorry that I couldn't type up examples, but class starts real soon and I gotta go. Best of luck.
Benji99
QUOTE
As far as I know, this isn't possible. I've never heard of using wildcards within a tag name. I can think of some tricks that *might* help you acheive *some* of your goals, but it would involve a lot of serious retagging of your files. (Basically, you could include a tag like %instruments% that would contain multiple values of all the possible xxx's in %PERFORMER_xxx% for that particular file, but again, I'm not sure how far that would take you)


Sorry for the very late reply, I haven't had a chance to dwelve into this till now, I've been attempting what you said which I think is a fantastic idea, basically, the tags are now %Credit_xxx% where xxx is the credit Type which I've stored in %Credit_Type%. I've ran into a few more roadblocks.

1.) I've been having problems getting this formatted in the album list however.
How do I 'insert' the Credit_type into xxx? I've tried using the $put and $get functions without luck, basically $put(x, %credit_type%) and %Credit_$get(x)%. Or can I insert the %Credit_Type% into %Credit_xxx% so that %Credit_Piano% or %Credit_Violin% will be possible without hardcoding these into foobar.

2.) I also have another weird issue, I have certain tags which have multiple values, such as %Credit_Type%, or %Conductor%, or %Composer%. If I use %Credit_Type%, I get a list of all the values separated by commas, if I just use Credit_type I get them listed as they should, which is separatly. Is this normal? Why isn't %Credit_Type% separating the values?

Basically, I'm looking for 2 ways of sorting with the tags:
1.) Genre -> %Credit_Type% -> %Credit_%Credit_Type%%
ex:
Jazz -> Piano -> (all values of %Credit_Piano%)

2.) Genre -> %Credit_***%
ex:
Jazz - (All Credits irregardless of the Credit Type)

Thanks in advance for the assistance!
Benji99
Benji99
Oh, if what I need is not possible with the current AlbumList plugin, do you have another plugin or program that may the added functionality?

Anyone know of any other music player which allows sorting/cateloging of custom tags in it's media library? (And it also supports FLAC!)
Benji99
Anyone?
Benji99
Ok if you can't tell yet, I'm determined to get this to work somehow.
I've done this, created a tag called Credit_type with the exact tag fields contained in the file.
ie:

Credit_Piano=Bob
Credit_Organ=Tim
Credit_Guitar=Larry
Credit_Type=Credit_Piano\Credit_Organ\Credit_Guitar

Obviously, it's easy to list all the credit_types in albumlist.
But I haven't been able to get the albumlist to show the Value of those types.
Is this possible?

I still want to be able to achieve the following:
Genre -> Credit_Type -> Credits under that Credit_Type
ie: Jazz -> Credit_Piano -> Bob
Jazz -> Credit_Organ -> Tim
-> Steve
Genre -> All values under whichever credits irregardless of the Credit_Type
ie: Jazz -> Bob
-> Tim
-> Steve
Olive
I believe it isn't possible because AFAIK you can have only one tag per level. If it was possible then this would be too:

+genre
|
....+year
|
....+artist
|
....
gfngfgf
ooo, slight revelation here. Have you tried using the $meta() function instead of %% to retreive tag information? I think using $meta will allow you to use functions like $substr and $cut to manipulate the name of the tag that you want to retreive. This is based only on a rough test I did, which was to paste the following in my track info panel:

CODE
$meta($cut('artistaaa',6))


And this returned the name of the current artist playing. You'll still have some issues to work through, but I think this helps. My interest in this problem is renewed, so when I have some time later tonight, I'll probably look into it more.

PS: don't get your hopes up too much, though, yeah? I think Olive is generally correct that you won't be able to get a perfect solution using Album List. Sorry that I don't know of any other programs/plugins that could help.
Benji99
QUOTE(gfngfgf @ Mar 4 2005, 07:32 PM)
ooo, slight revelation here.  Have you tried using the $meta() function instead of %% to retreive tag information?  I think using $meta will allow you to use functions like $substr and $cut to manipulate the name of the tag that you want to retreive.  This is based only on a rough test I did, which was to paste the following in my track info panel:

CODE
$meta($cut('artistaaa',6))


And this returned the name of the current artist playing.  You'll still have some issues to work through, but I think this helps.  My interest in this problem is renewed, so when I have some time later tonight, I'll probably look into it more.

PS: don't get your hopes up too much, though, yeah?  I think Olive is generally correct that you won't be able to get a perfect solution using Album List.  Sorry that I don't know of any other programs/plugins that could help.
*



Hi there, thanks for the reply!
I did try using the $meta() version without success, but I was more trying to use the $put $get functions, I'll give the functions you suggested a try, I'll report back with the results.
Thanks big time for the help!
Benji99
Ok, following you're logic, I've tried the following:
|%genre%|Credit_Type|$meta($cut('Credit_Type',99))
or
|%genre%|Credit_Type|$meta(Credit_Type)

Technically, the value stored in Credit_Type should then act as a type to $meta which would return the value of that type, except what I get here is a list of credit_types all in in a list one after the other.

Which leads me to another problem, my tracks have many Credit_Types, if I use $meta(Credit_Type), or %Credit_Type% I don't see all the items listed individually, meaning they're all bunched into one value. If I use Credit_Type alone I get the desired effect, which in my case is all the Credit_Types being on their own independent of which file they're in (as it should be). The same applies for when I put multiple artists for example, If I put both B.B. King and Eric Claption as artists, I'd want that album to show up under BOTH B.B. and Clapton and not under something that looks like: B.B. King, Eric Clapton.

The same thing happens to my Credit_Types, instead of seeing something along this line:

Jazz -> Credit_Piano
-> Credit_Organ
-> Credit_Vocals

I see this:
Jazz -> Credit_Piano, Credit_Organ, Credit_Vocals

I get different values though since different albums/tracks have different sets of credit_types, so they appear as different values in the album list.
Benji99
Ok I can confirm that you're example works fine here as well which means that we can deffinatly have functions running inside $meta().
However this doesn't: |%genre%|Credit_Type|$meta($meta(Credit_Type))
Which for some reason doesn't work, the 3rd level shows nothing, I only see 2 levels.

If I follow the logic correctly, $meta(Credit_Type) should return the 'values' stored in the Tag %Credit_Type%. Which means that $meta(values returned from Credit_Type) should then return the values of the fields which were retrieved from Credit_Type. This all seems logical and possible somehow, but I seem to be missing something...

I mean $cut( , ) returns a simple string which is what $meta() uses with success as you've demonstrated.
$meta() should also simply return a string just like $cut does but this time the 2nd $meta() is handling that information properly...

I'm gonna keep trying
gfngfgf
QUOTE(Benji99 @ Mar 4 2005, 11:47 PM)
Ok I can confirm that you're example works fine here as well which means that we can deffinatly have functions running inside $meta().
However this doesn't: |%genre%|Credit_Type|$meta($meta(Credit_Type))
Which for some reason doesn't work, the 3rd level shows nothing, I only see 2 levels.
*



The problem with that example is that $meta(Credit_Type) will return all the credit_types, "bunched together" as you put it. You can use $meta(Credit_Type,x) (where x is a number) to extract each individual credit_type, but then I'm not sure how to integrate that into the album list.

As you discovered, the albumlist can deal with multiple values pretty well. I think that's something specific and internal to albumlist, though. I think that when you include a TAGZ expression in a specific branch, the song can only appear once in the tree. That would pretty much make what you're trying to do impossible to accomplish as long as TAGZ are involved.
Benji99
QUOTE(gfngfgf @ Mar 5 2005, 01:15 AM)
QUOTE(Benji99 @ Mar 4 2005, 11:47 PM)
Ok I can confirm that you're example works fine here as well which means that we can deffinatly have functions running inside $meta().
However this doesn't: |%genre%|Credit_Type|$meta($meta(Credit_Type))
Which for some reason doesn't work, the 3rd level shows nothing, I only see 2 levels.
*



The problem with that example is that $meta(Credit_Type) will return all the credit_types, "bunched together" as you put it. You can use $meta(Credit_Type,x) (where x is a number) to extract each individual credit_type, but then I'm not sure how to integrate that into the album list.

As you discovered, the albumlist can deal with multiple values pretty well. I think that's something specific and internal to albumlist, though. I think that when you include a TAGZ expression in a specific branch, the song can only appear once in the tree. That would pretty much make what you're trying to do impossible to accomplish as long as TAGZ are involved.
*



Ok, I concur, with this string:
|%genre%|Credit_Type|$meta($meta(Credit_Type))
if I only have ONE Credit_Type, the name of the credit shows up fine.

Do you think there's any chance I could use the function $meta_num(x) somehow?
How about somehow using both $meta_num() and $repeat(,)?
gfngfgf
Since you seem so determined to do this, and since the more I look at it, the more I believe it's not possible with album list, I'll mention another component for foobar which might help: foo_playlist_tree. I haven't tried it, so I can't say too much about it, other than my understanding is that it provides more flexibility in creating nested playlists and trees than album list. However, it's also on the Known Problematic Components list, which means that I'm supposed to warn you that you might suffer crashes and other bad stuff. Just make sure you read through the two links I gave you before you try to use it. Like I said, I haven't used playlist_tree, so if that's the route you decide to go, I wouldn't be able to offer you the help that I have been giving. Good luck.
Olive
QUOTE(Olive @ Mar 4 2005, 11:44 PM)
I believe it isn't possible because AFAIK you can have only one tag per level.

QUOTE(Benji99 @ Mar 5 2005, 05:47 AM)
I'm gonna keep trying

QUOTE(gfngfgf @ Mar 5 2005, 06:15 AM)
I think that when you include a TAGZ expression in a specific branch, the song can only appear once in the tree.  That would pretty much make what you're trying to do impossible to accomplish as long as TAGZ are involved.

I'm not sure what part of it-is-not-possible you're failing to comprehend anyway tongue.gif
You might get something somewhat similar by using Database Explorer instead of Album List, for it does support several hierachies within the same pannel at the same time.

Examples:
harp|%credit_harp%
flute|%credit_flute%
...
or
violin|%credit_violin%|%date%
or
piano|%genre%|%credit_piano%
etc..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.