Help - Search - Members - Calendar
Full Version: playlist artist names: first last -->last, first?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
krabapple
if possible, I need help crafting a playlist format string that will convert

Aaron Copland
Igor Stravinsky

to

Copland, Aaron
Stravinsky, Igor

etc.


thanks!

picmixer
I really don't think there is a reliable way to detect wether a certain two word combination is actually the name of the artist or the name of a band, etc etc.

I can certainly think of a way to simply switch around the first and second word of the artist formatting, but I think this would mess up in many cases.
krabapple
QUOTE(picmixer @ Feb 21 2005, 02:50 PM)
I really don't think there is a reliable way to detect wether a certain two word combination is actually the name of the artist or the name of a band, etc etc.

I can certainly think of a way to simply switch around the first and second word of the artist formatting, but I think this would mess up in many cases.
*




I work around that this way: I have some playlist rules that only apply if there is a 'composer' tag, and my convention is to only populate the composer tag for classical works.
Based on this, I have my playlist 'artist' column string set to show me the %composer% tag in the artist column if there is a composer, otherwise show %artist%. It works! I'll post it if you like.

So let me know what the switch string would be, and I'll see if I can restrict it
to just classical files.
picmixer
CODE
$puts(space,$strchr(%artist%, ))

$puts(artist,$right(%artist%,$sub($len(%artist%),$get(space)))',' $left(%artist%,$get(space)))

$get(artist)


Something like this should do the trick. Although there are a few ways to play around with this depending on how you want it implemented in your formatting.

EDIT: Ah yes, and of course replace %artist% with %composer% in case you want it to apply to that tag. smile.gif
krabapple
QUOTE(picmixer @ Feb 21 2005, 03:21 PM)
CODE
$puts(space,$strchr(%artist%, ))

$puts(artist,$right(%artist%,$sub($len(%artist%),$get(space)))',' $left(%artist%,$get(space)))

$get(artist)


Something like this should do the trick. Although there are a few ways to play around with this depending on how you want it implemented in your formatting.

EDIT: Ah yes, and of course replace %artist% with %composer% in case you want it to apply to that tag.  smile.gif
*




I got it to work, thanks!

But I don't quite get what it's doing -- could you describe in words what each line does? This would help me write a version that could handle names like 'Wolfgang Amadeus Mozart'. ;>

bark
QUOTE(krabapple @ Feb 24 2005, 02:12 AM)
I got it to work, thanks!

But I don't quite get what it's doing -- could you describe in words what each line does?  This would help me write a version that could handle names like 'Wolfgang Amadeus Mozart'. ;>
*




Well, your solution for Wolfgang Amadeus Mozart would mess up Ludwig van Beethoven or James van der Beek (hey, anything's possible!). This is what the first responder was saying. Without a list of common names to programmatically check against this is best done by permanently changing the metadata manually, IMO.
picmixer
QUOTE(krabapple @ Feb 24 2005, 10:12 AM)

But I don't quite get what it's doing -- could you describe in words what each line does?
*



First line sets space to the number on wich the first space character is found in the tag.

The second line sets artist to your desired formatting by subtracting the space value from the entire string and returns the first right characters of the tag. The it sinserts a comma and a space character. After that it returns the first characters with the value of space.

The third line get the new artist variable.

Hmh, no idea if my explanations make sense here. Mybe just have a look at titleformat_help.html yourself and look at the functions.

Good luck smile.gif
krabapple
QUOTE(bark @ Feb 24 2005, 08:09 AM)
QUOTE(krabapple @ Feb 24 2005, 02:12 AM)
I got it to work, thanks!

But I don't quite get what it's doing -- could you describe in words what each line does?  This would help me write a version that could handle names like 'Wolfgang Amadeus Mozart'. ;>
*




Well, your solution for Wolfgang Amadeus Mozart would mess up Ludwig van Beethoven or James van der Beek (hey, anything's possible!). This is what the first responder was saying. Without a list of common names to programmatically check against this is best done by permanently changing the metadata manually, IMO.
*



I understand that -- and I can work with that . in fact I'd rather have Beethoven be sorted with the 'Bs' than the 'vs' anyway. What really gets screwed up is a name like Ralph Vaughn Williams. ;>

But again I can deal with that -- I was really interested to know, as part of my ongoing education in string syntax, what the supplied string actually does, step by step. Thanks, picmixer
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.