Difference between revisions of "Foobar2000:Components/Masstagger (foo masstag)"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
m (added template)
Line 1: Line 1:
{{Foobar Component Infobox
{{Foobar Component Infobox
| name = foo_masstag
| name = foo_masstag

Revision as of 11:31, 29 July 2007


Developer(s) Official
Repository {{{repository}}}
Release information
Initial release {{{released}}}
Stable release 1.6
Preview release
foobar2000 compatibility
Minimum version 0.9.4.x
Maximum version {{{foobar2000_maximum}}}
UI module(s) N/A
Additional information
Use Tagging
License -
Discussion thread


Masstagger is an advanced tool for editing the information of tags in multiple files. Note: It's not available by default, You must select it during installation under Tools\Masstagger. What makes Masstager so powerfull in editing tags is it's use of titleformat scripts (see introduction and reference.

Available actions

Add value

Adds desired tag field and sets it to whatever you enter in the masstagger input window.

Auto track number

This gives the track number according to the order of the files in the selection.

Copy value

Copies one tag field to another.

Format value from other fields

This is where it becomes interesting. This option lets you enter a specific formatting pattern for any tag field you wish to edit or create.

Note that when using complex formatting patterns I would recommend to first format a temporary %temp% tag with the desired pattern and then copy that one into the value that you wish. Afterwards you can remove the temp value. When processing a large batch of files you could probably just do a test run on one of the files and then do the rest in one go. Think about what you are doing beforehand though. After all I don't want to be held responsible for messing up anyones music collection.

I will explain how to create formatting strings for different situations further down .

Guess values from filename

Guesses values from filename and lets you enter a certain formatting pattern for it. For example if your files are named artist - album_title.


%artist% - %album%_%title%

as formatting pattern.

Guess values from other fields

Guesses values from other tags and lets you enter a certain fromatting pattern for it. For example if your files are tagged artist / title in the title field.

Input data (one line per track)

Enter the data for each song with the pattern indicated, line by line, (one line per song as it is said). Don't worry about the length, the lines could be very long (only adds a vertical scroll bar if it is too long).

Remove all fields

Removes all tag fields (who would have guessed)

Remove all except for...

Does just as it says, removes all values and lets you specify wich ones not to remove in a second field in the following pattern ie.:


Remove field

Removes desired tag field.

Set value

Sets desired tag field (artist, album,custom,etc) to whatever you enter in the masstagger input window.

Split multiple artist field

Note that it is possible to perform several of these actions at once and in that case the order of those actions can be very important. So removing field A before copying it to field B is probably a bad Idea and should be performed the other way around, etc.

Writing format strings for the masstager

Extracting Information from Relative File Paths:

As suggested I have included a small section on how to extract different values from their relative file paths. To do so I will use the following example path to extract information from


sets title:

%_filename% returns title as 01_Title.mpc and
returns title as Title.mpc

sets album:

$directory(%_path%,1) returns title as Album[Date]

returns album as Album

NOTE: that the [ is quotes as '[' , the reason for this is for it to be recognized as a character and not as a command syntax, you will probably have to ommit the quotation marks for most other characters.

sets artist:

$directory(%_path%,2) returns artist as Artist

sets genre:

$directory(%_path%,3) returns genre as Genre

sets tracknumber:

$num($left(%_filename%,2),2) returns tracknumber as 01

Obviously a lot more is possible, but then this was just supposed to be a short introduction. I would say simply copy a few of your files, and play around with it.

The Rename Files Dialog

The rename files dialog enables you to automatically rename your files according to your metadata tags in an automated way. You will first need to select all the tracks you want to rename and then right click and select: Masstagger/rename files.

Select in the masstagger dialog wich output directory you mant to use and wether to generate subdirectories according to the / \ characters. I will give a few examples for renaming strings below.


To rename your files to "tracknumber_title.ext (i.e. 08_The Glass Bead Game.mpc)" you will need to enter the following syntax in the Output file name format field


No need to create subdirectories in this case.

To rename your files to "/artist - album/title.ext (i.e. Thievery Corporation - Sounds of the Thievery Hi-Fi/08_The Glass Bead Game.mpc) and create the appropriate subdirectories you will need the following syntax

/%artist% - %album%/%tracknumber%_%title%

In this case make sure the "create subdirectories" checkbox is ticked.

To rename your files to "/artist/album/tracknumber_title.ext (i.e.: /Thievery Corporation/Sounds of the Thievery Hi-Fi/08_The Glass Bead Game.mpc) use the following syntax


In case you generally make use of "album artist" tags (or anything similar) for various albums files you can replace %artist% with

$if2(%album artist%,%artist%)

in any of the above strings.

Note: One reason why it is convenient to use the masstaggers rename files function is that this way Foobar2000's database will automatically get updated to the current changes.

Of course this only gives a general idea of what is possible and all kind of different filenaming schemes can be used for this. And as usual, please don't hold me responsible in case this makes a mess out of any of your files wink.gif In case the renamer ever does anything unexpected, don't dispair, it is usually very easy to fix with just another renaming operation.

Well, if your still with me now I guess thats quite a good sign and at least you didn't get all to bored along the way. Hope this is all somewhat comprehensible and can give people who are new to this a general idea on how things work. Concerning Foobars Masstagger at least. Any suggestions and especially critisism, corrections and add ons extremely welcome.

Oh yeah and in case you ever get bored of any of those old bad quality Kazaa files that might still be lying around on your harddisk you can

always replace %tag% by $rot13(%tag%) , mess them all up a bit and make your filenames gow all blowfish. (allright, for all humorless people, it's a joke, PLEASE DON'T DO THIS, except of course if you are really bored with them)

Hmh lots of blehs and blahs, guess I should have used something a bit more creative . Otherwise I might as well have called this thread BlahBlah.

In case you find any ingenious strings or even better simple ones, I suggest everyone can simply post them in this thread.


This page is based on picmixer's Unofficial masstagger guide on the foobar2000 forum.

You can find a tutorial with videos here Unofficial masstagger tutorial