Syntax For Multiple Artists

Hello,

I am trying to convert my tag info to file names. The problem I'm having is that if a song has multiple artists, their names are written together without any spaces and I would like to have something in between them to separate the two names.

For example if my tag info is like follows:

Track: 01
Title: I Want Your Chili Powder
Artist: The Luminous/Alice Thomson

When I do this:

$num(%track%,2) - %artist% - %title%

The output would be:

01 - The LuminousAlice Thomson - I Want Your Chili Powder

Is there a way to to be able split the two artist names to something like this?

01 - The Luminous, Alice Thomson - I Want Your Chili Powder

Also if that's possible, I'd like to know how to do the opposite process as well (though I might be able to figure it out after I have an answer to my former question). :stuck_out_tongue:

Many thanks for help,
LD

Hi,

If your Artist in the tag is like this.
The Luminous/Alice Thomson

You first have to create an action

Split Field by Seperator
Field: ARTIST
Seperator: /

This creates a Multiple Artist Field (Look at Extended Tags (ALT + T) and you will see 2 ARTIST fields)

Then
To create a filename like:
01 - The Luminous, Alice Thomson - I Want Your Chili Powder

You do Tag - Filename (ALT + 1)
and as format string:
%track% - $meta(artist) - %title%

As always try it on an test file.

And opposite:

If %_filename% is

01 - The Luminous, Alice Thomson - I Want Your Chili Powder.mp3

And you want to split this in
%track% = 01
%artist% = The Luminous
%artist% = Alice Thomson
%title% = I Want Your Chili Powder

First:
Filename - Tag (ALT + 2)
Format String: %track% - %artist% - %title%

Then create an Action
Split Field by Seperator
Field: ARTIST
Seperator: /

If you don't want to create a multi-value field use this string in the converter:
$num(%track%,2) - $replace(%artist%,/,', ') - %title%

Thanks very much! I have a question though. So $meta(artist) returns The Luminous, Alice Thomson by chance separated by comma. What if I wanted the names to be separated by something else? Say the semicolon so it would be like:

01 - The Luminous; Alice Thomson - I Want Your Chili Powder

I know this can be done the way that dano suggested but I just wanna know if it's feasible using your way.

Also:

First:
Filename - Tag (ALT + 2)
Format String: %track% - %artist% - %title%

Then create an Action
Split Field by Seperator
Field: ARTIST
Seperator: /

Did you mean Separator: ", "

A question for you as well dano :slight_smile:
Is there a way to implement your method to do the opposite? Filename to Tag?

Many thanks for your help,
LD

At first try to understand what you have been taught before and read the manual.
Understanding is doing and sometimes also a repeated sequence of trial and error.
Did you do any experiment for yourself before you have asked these questions here in the forum?
What are your results?
Where are the problems, you have detected?

DD.20101102.2340.CET

use $meta_sep(artist,; )
btw:
you can also use $validate(%track% - %artist% - %title%,) to get "" for every character which is invalid for filenames ( /?*"<>|: )

yes, he did.

just turn around the replace parameters.
the reverse of
$replace(%artist%,/,', ')
is
$replace(%artist%,', ',/)

EDIT:
DetelvD, you are right. Basically my answere are all at the help pages.
http://help.mp3tag.de/main_scripting.html
And for the "did you mean..." question: yes, just try LD PVL, it's much faster then asking here and waiting for answer.

I did try earlier guys suggestions. I looked through help but the stuff on metadata was new to me so asked a question. For the "did you mean..." question, I was just pointing out.

But this don't work though :frowning:. I tried that.

just turn around the replace parameters.
the reverse of
$replace(%artist%,/,', ')
is
$replace(%artist%,', ',/)

It's counter intuitive as well. When you do Tag to Filename then doing $replace(%artist%,/,', ') is fine, 'cos you're reading from %artist% as a variable containing the name of the artist, so doing replace on it is completely fine. But when you do the opposite, Filename to Tag, the opposite happens, value is being written into %artist% - I mean what you want to do the operation replace on now is The Luminous, Alice Thomson and not %artist%?

I tried this as well but didn't work: %track% - %artist%, %artist% - %title%

Many thanks for your help, Pone,
LD

it's ok with me. otherwise i would not answer at all. and i can remember asking similar questions when i was new here.

QUOTE
But this don't work though :frowning:. I tried that.
just turn around the replace parameters.
the reverse of
$replace(%artist%,/,', ')
is
$replace(%artist%,', ',/)<!--QuoteEnd--></div><!--QuoteEEnd-->

It does not work in the Filename - Tag Converter, you are right.
You would have to create a extra action which you run afterwards:
Action: Format Value
Field: ARTIST
Format String: $replace(%artist%,', ',/)

You also could do it in one step with a different action:
Action: Guess Values
Source Format: $replace(%_filename%,', ',/)
Guessing Pattern: %track% - %artist% - %title%

but there, all ", " get replaced by "/", which would not be your desired result for the title.

QUOTE (LD PVL @ Nov 3 2010, 01:13) <{POST_SNAPBACK}>
... But this don't work though :frowning:. I tried that.
just turn around the replace parameters.
the reverse of
$replace(%artist%,/,', ')
is
$replace(%artist%,', ',/)<!--QuoteEnd--></div><!--QuoteEEnd-->

I do not want to be too nitpicking, but want to try to clarify concepts ...

The function call ...

$replace(%ARTIST%,'\',', ')

... replaces all occurences of the backslash character with the character sequence of comma and space.

To reverse the previous process you can use the inverse function call ...

$replace(%ARTIST%,', ','\')

..., which replaces all occurences of the character sequence of comma and space with the backslash character.

If both cases will be combined into one function call, the resulting string should be, will be, the same as the input string, because of the successively inversion ...

$replace(%ARTIST%,'\',', ',', ','\')

.... The content of the tag-field ARTIST will not be changed, presuming there is no comma and space sequence in the original value of the ARTIST tag-field.

Although the names of the both Converter dialogs "Tag - Filename" and "Filename - Tag" gives the impression, that the one will be work inverse to the other, these Converter dialogs are technical different. Especially the inaccuracy of the term 'Format string' in both dialogs makes significant problems in understanding and using.

The Converter "Tag - Filename" offers an edit field named 'Format string' for entering a textual expression to assemble the new filename from values of existing tag-fields with full support by the Mp3tag Scripting Language.

The Converter "Filename - Tag" offers an edit field named 'Format string' for entering a textual expression to split an existing filename (or filepath) into components, which then will be stored into tag-fields, using the names of 'placeholders' given by the 'Format string'.
Each character, which is not enclosed into percent signs will be respected 'as is' as part of the pattern mask.
There is no further support by the Mp3tag Scripting language.
It is not possible to insert a Mp3tag string literal here as it would be used at other places in the Mp3tag application.
The Converter "Filename - Tag" is a guessing machine and works the same as the Action "Guess values".
The user enters a pattern, and the Converter tries to do the best match.

Having this filepath ...
O:\TEST\T1\Some Folder\Best Of (Rocking Beatles Stones #0101) - 1999.mp3

... the Converter "Filename - Tag" can guess ...
Format string: %GENRE1%\%GENRE2%\%DISCNUMBER%\%TRACK% - %TITLE%
GENRE1: TEST
GENRE2: T1
DISCNUMBER: Some Folder
TRACK: Best Of (Rocking Beatles Stones #0101)
TITLE: 1999

... the Converter "Filename - Tag" can guess ...
Format string: %ALBUM% - %YEAR%
ALBUM: Best Of (Rocking Beatles Stones #0101)
YEAR: 1999

... the Converter "Filename - Tag" can guess ...
Format string: %ALBUM% (%DUMMY% %ARTIST% %ARTIST% #%CATNO%) - %YEAR%
ALBUM: Best Of
ARTIST: Beatles Stones
CATNO: 0101
YEAR: 1999

... the Converter "Filename - Tag" can guess ...
Format string: %ALBUM% (%DUMMY% %ARTIST% %DUMMY%) - %YEAR%
ALBUM: Best Of
ARTIST: Beatles
YEAR: 1999

The usage of the percent sign, for enclosing and creating the placeholder names, is a relict from the programmer who introduced this technique at first.
Be aware that these placeholder names, while written in the 'Format string', are only literals, nothing more.
They do not carry a value from any existing tag-field with the same name.
They are only names to make the user think of distributing data into tag-fields named by these names.

It is obvious, the Converter "Filename - Tag" opens a rather open field of usage.
It is obvious, the Converter "Filename - Tag" is not the inverse function of the Converter "Tag - Filename"

DD.20101103.0752.CET
Edit. Changed comment regarding function $replace().
DD.20101103.1619.CET

you are

I never said that. Additionally I have already made clear how to get the reverse result by using the reverse function in other ways.

to do a little revenge nitpicking:

this changes artist names with comma and space in it.
e.g. Peter, Bjorn and John will be replaced by Peter/Bjorn and John.

Thanks Pone and DetlevD,

Yeah, I figured we can do it by other means as the other member showed me in earlier posts, was just wondering if we could do a one liner :slight_smile:.

Cheers,
LD

pone, as you can see within my reply from above "QUOTE (LD PVL @ Nov 3 2010, 01:13)", I did not speak to you but to the Open Poster.
I know that you give your really best, like me too, to understand Mp3tag and to publish knowledge about Mp3tag.
And do not forget, we are humans, and we are allowed to make mistakes.

DD.20101103.1613.CET

allright, peace.
i really appreciate your postings in the form, lots of knowledge which helped me out some times.