<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hydrogenaudio.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Phi</id>
	<title>Hydrogenaudio Knowledgebase - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hydrogenaudio.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Phi"/>
	<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Special:Contributions/Phi"/>
	<updated>2026-04-25T16:10:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Masstagger_(foo_masstag)&amp;diff=10098</id>
		<title>Foobar2000:Components/Masstagger (foo masstag)</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Masstagger_(foo_masstag)&amp;diff=10098"/>
		<updated>2006-02-03T10:45:33Z</updated>

		<summary type="html">&lt;p&gt;Phi: /* Guess values from filename */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=picmixer&#039;s &amp;quot;The Unofficial Guide to FB&#039;s Masstagger&amp;quot;=&lt;br /&gt;
&lt;br /&gt;
FB&#039;s masstagger tends to be quite a convenient tool when editing the information of tags in multiple files. I will first briefly list the options you have using it. Basically you can choose to either use it to edit tags or to rename files from the FB2K context menu. Here I will go into details of the first option. Although the second option should become quite self explanatory after reading this.&lt;br /&gt;
&lt;br /&gt;
Basically there are several actions you can choose from to perform.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available actions ==&lt;br /&gt;
&lt;br /&gt;
=== Add value ===&lt;br /&gt;
Adds desired tag field and sets it to whatever you enter in the masstagger input window.&lt;br /&gt;
&lt;br /&gt;
=== Auto track number ===&lt;br /&gt;
This gives the track number according to the order of the files in the selection.&lt;br /&gt;
&lt;br /&gt;
=== Copy value ===&lt;br /&gt;
Copies one tag field to another.&lt;br /&gt;
&lt;br /&gt;
=== Format value from other fields ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; 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&#039;t want to be held responsible for messing up anyones music collection.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I will explain how to create formatting strings for different situations further down .&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Guess values from filename ===&lt;br /&gt;
Guesses values from filename and lets you enter a certain formatting pattern for it. For example if your files are named artist - album_title.&lt;br /&gt;
&lt;br /&gt;
Enter &lt;br /&gt;
 %artist% - %album%_%title%&lt;br /&gt;
as formatting pattern.&lt;br /&gt;
&lt;br /&gt;
=== Guess values from other fields ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Input data (one line per track) ===&lt;br /&gt;
Enter the data for each song with the pattern indicated, line by line, (one line per song as it is said). Don&#039;t worry about the length, the lines could be very long (only adds a vertical scroll bar if it is too long).&lt;br /&gt;
&lt;br /&gt;
=== Remove all fields ===&lt;br /&gt;
Removes all tag fields (who would have guessed)&lt;br /&gt;
&lt;br /&gt;
=== Remove all except for... ===&lt;br /&gt;
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.:&lt;br /&gt;
&lt;br /&gt;
 %artist%;%title%;etc&lt;br /&gt;
&lt;br /&gt;
=== Remove field ===&lt;br /&gt;
Removes desired tag field.&lt;br /&gt;
&lt;br /&gt;
=== Set value ===&lt;br /&gt;
Sets desired tag field (artist, album,custom,etc) to whatever you enter in the masstagger input window.&lt;br /&gt;
&lt;br /&gt;
=== Split multiple artist field ===&lt;br /&gt;
Haven&#039;t really tried out this one in depth, guess it does kind of what it says. Never really used it yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
== Writing format strings for the masstager ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Well I guess the most powerful feature of FB&amp;quot;s masstager is the fact that it can use [[Foobar2000:Tagz|Tagz]] format strings. For reference to all TAGZ commands please check the titleformatting help in your Foobar preferences.&lt;br /&gt;
&lt;br /&gt;
You can see that all the following samples contain %tag% and capital variables in the form of X, Y, Z. The idea is that you replace %tag% by what ever field value you would like to read from (ie,%artist%, %title%, etc. . What X,Y, Z stands for should be explained above the strings. (Well and it obviously should also be replaced by whatever fits your needs)&lt;br /&gt;
&lt;br /&gt;
I can only say once more please check the titleformatting help for reference since it explains all available tag fields and commands. Instead of %tag% you could for example also use %_filename%, etc as input fields.&lt;br /&gt;
&lt;br /&gt;
Allright before everyone gets bored with me blabbing on for to long I&#039;ll simply throw in those scripts. Everything starts extremely simple to give a basic idea on how everything works. After all this is basically meant for new users.&lt;br /&gt;
&lt;br /&gt;
The idea is that by the end of this you can write your own little scripts easily. Or of course simply copy and paste these into the Masstager window for further editing. Just don&#039;t hold me responsible to what happens to your files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Masstagger Strings ==&lt;br /&gt;
&lt;br /&gt;
Please make sure you rejoin scripts that have been split into multiple lines, before pasting them into the masstagger window. The reason they are split is to keep this page&#039;s formatting readable in your browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns corresponding tag field:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 %tag%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; if artist field is blah %artist% will return blah. Note that you can insert any character (or space) in between two tags, in front or after, so if artist is blah and title is bleh  &lt;br /&gt;
 %artist%X%title%&lt;br /&gt;
returns blahXbleh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Trunctuates %tag% to a length of X characters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $cut(%tag%,X)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; if artist field is blah $cut(%artist%,3) returns bla&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Truncuates %tag% by X characters and adds ... at the end of the cut.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $cut(%tag%,X)...&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Example:&#039;&#039;&#039; if artist field is blah $cut(%artist%,3)... returns bla...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns numerical value of %tag% and pads with 0s up to x characters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $num(%tag%,X)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; if tracknumber field is 3 $num(%tracknumber%,2) will return 03. If 13 it will return 13.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns first two characters of a filename and displays as number (if present) padded with 0s up to X characters:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $num($left(%_filename%),2)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; if filename is 03_artist_title.mpc will return 03.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds first occurence of character X in %tag% and returns everything in front of X:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(spacer,$strchr(%tag%,X))&lt;br /&gt;
 $trim($left(%tag%,$sub($get(spacer),1)))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; blah X bleh or blah X bleh X bluh returns blah (ie.: artist_album_title -----&amp;gt; title, in case X is _ )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;In the next few strings I have decided to make it possible to define the %tag% that should be edited and the character or string that is used to determine where to trunctuate as variables in the beginning of the string as $puts(tag,%tag%), $puts(char,X), etc. Basically the reason I have done this is to make it simpler to edit these strings, to what you exactly want them to do at the very moment, in the rather narrow masstager input field. That way it is possible to enter the needed tags and characters only once in the beginning of the line. Again simply replace %tag% and X by the desired values. Also all of these strings will trim off the trailing and leading spaces of the output (in case there are any).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds first occurence of character X in %tag% and returns everything in front of X:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))&lt;br /&gt;
 $trim($left($get(tag),$sub($get(spacer),1)))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; blah X bleh or blah X bleh X bluh returns blah (ie.: artist_album_title -----&amp;gt; title, in case X is _ )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; this does exactly the same as the last string mentioned above, except for the introdution of the two variables in the front, meant for easy editing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds last occurence of character X in %tag% and returns everything in front of X:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))&lt;br /&gt;
 $trim($left($get(tag),$sub($get(spacer),1)))&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Example:&#039;&#039;&#039; blah X bleh returns blah and blah X bleh X bluh returns blah X bleh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds first occurence of character X in %tag% field and returns everything after X:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))&lt;br /&gt;
 $trim($right($get(tag),&lt;br /&gt;
 $sub($len($get(tag)),$get(spacer))))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; blah X bleh returns bleh and blah X bleh X bluh returns bleh X bluh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds last occurence of character X in %tag% field and returns everything after X:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))&lt;br /&gt;
 $trim($right($get(tag),&lt;br /&gt;
 $sub($len($get(tag)),$get(spacer))))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; blah X bleh returns bleh and blah X bleh X bluh returns bluh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds first occurence of character X and last occurence of character Y and returns everything in between:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(char1,X)$puts(char2,Y)$puts(tag,%tag%)&lt;br /&gt;
 $puts(spacer1,$strchr($get(tag),$get(char1)))&lt;br /&gt;
 $puts(spacer2,$strrchr($get(tag),$get(char2)))&lt;br /&gt;
 $trim($substr($get(tag),$add($get(spacer1),1),$sub($get(spacer2),1)))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; blah X bleh Y bluh returns bleh&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; that in most cases X will probably be equal to y here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds first occurence of string XYZ and returns everything in front of string XYZ:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(string,XYZ)$puts(tag,%tag%)$puts(spacer,$strstr($get(tag),&lt;br /&gt;
 $get(string)))&lt;br /&gt;
 $trim($left($get(tag),$sub($get(spacer),1)))&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Example:&#039;&#039;&#039; blah XYZ bleh returns blah&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; that string XYZ can basically be any combination of characters or words.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Finds first occurence of string XYZ in %tag% field and returns everything after XYZ:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $puts(string,XYZ)$puts(tag,%tag%)&lt;br /&gt;
 $puts(spacer,$strstr($get(tag),$get(string)))&lt;br /&gt;
 $trim($right($get(tag),$sub($len($get(tag)),&lt;br /&gt;
 $add($get(spacer),$len($get(string))))))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; blah XYZ bleh returns bleh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Extracting Information from Relative File Paths:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;...\Genre\Artist\Album[Date]\01_Title.mpc&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sets title:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 %_filename% returns title as 01_Title.mpc and&lt;br /&gt;
&lt;br /&gt;
 $puts(char,_)$puts(tag,%_filename%)&lt;br /&gt;
 $puts(spacer,$strchr($get(tag),$get(char)))&lt;br /&gt;
 $trim($right($get(tag),$sub($len($get(tag)),$get(spacer))))&lt;br /&gt;
 returns title as Title.mpc&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sets album:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $directory(%_path%,1) returns title as Album[Date]&lt;br /&gt;
&lt;br /&gt;
 $puts(char,&#039;[&#039;)$puts(tag,$directory(%_path%,1))&lt;br /&gt;
 $puts(spacer,$strchr($get(tag),$get(char)))&lt;br /&gt;
 $trim($left($get(tag),$sub($get(spacer),1)))&lt;br /&gt;
returns album as Album&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; that the [ is quotes as &#039;[&#039; , 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sets artist:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $directory(%_path%,2) returns artist as Artist&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sets genre:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $directory(%_path%,3) returns genre as Genre&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
sets tracknumber:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 $num($left(%_filename%,2),2) returns tracknumber as 01&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Rename Files Dialog ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To rename your files to &amp;quot;tracknumber_title.ext (i.e. 08_The Glass Bead Game.mpc)&amp;quot; you will need to enter the following syntax in the Output file name format field&lt;br /&gt;
&lt;br /&gt;
 %tracknumber%_%title%&lt;br /&gt;
No need to create subdirectories in this case.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To rename your files to &amp;quot;/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&lt;br /&gt;
&lt;br /&gt;
 /%artist% - %album%/%tracknumber%_%title%&lt;br /&gt;
In this case make sure the &amp;quot;create subdirectories&amp;quot; checkbox is ticked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To rename your files to &amp;quot;/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&lt;br /&gt;
&lt;br /&gt;
 /%artst%/%album%/%tracknumber%_%title%&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In case you generally make use of &amp;quot;album artist&amp;quot; tags (or anything similar) for various albums files you can replace %artist% with&lt;br /&gt;
&lt;br /&gt;
 $if2(%album artist%,%artist%)&lt;br /&gt;
in any of the above strings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
One reason why it is convenient to use the masstaggers rename files function is that this way Foobar2000&#039;s database will automatically get updated to the current changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course this only gives a general idea of what is possible and all kind of different filenaming schemes can be used for this.&lt;br /&gt;
And as usual, please don&#039;t hold me responsible in case this makes a mess out of any of your files wink.gif&lt;br /&gt;
In case the renamer ever does anything unexpected, don&#039;t dispair, it is usually very easy to fix with just another renaming operation.&lt;br /&gt;
&lt;br /&gt;
Well, if your still with me now I guess thats quite a good sign and at least you didn&#039;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.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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&#039;s a joke, &#039;&#039;&#039;PLEASE DON&#039;T DO THIS&#039;&#039;&#039;, except of course if you are really bored with them)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
In case you find any ingenious strings or even better simple ones, I suggest everyone can simply post them in this thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Original forum thread ==&lt;br /&gt;
&lt;br /&gt;
This page is based on picmixer&#039;s [http://www.hydrogenaudio.org/forums/index.php?showtopic=12302|Unofficial masstagger guide] on the foobar2000 forum.&lt;/div&gt;</summary>
		<author><name>Phi</name></author>
	</entry>
	<entry>
		<id>https://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Title_Formatting_Reference&amp;diff=9017</id>
		<title>Foobar2000:Title Formatting Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Title_Formatting_Reference&amp;diff=9017"/>
		<updated>2005-10-20T01:28:49Z</updated>

		<summary type="html">&lt;p&gt;Phi: /* $stricmp(s1,s2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Field remappings =&lt;br /&gt;
&lt;br /&gt;
Some of the fields accessible through &#039;&#039;%name%&#039;&#039; are remapped to other values to make writing titleformat scripts more convenient.&lt;br /&gt;
&lt;br /&gt;
== Metadata ==&lt;br /&gt;
&lt;br /&gt;
=== %album artist% ===&lt;br /&gt;
Defined as &#039;&#039;$if3($meta(album artist),$meta(artist),$meta(composer),$meta(performer))&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== %album% ===&lt;br /&gt;
Defined as &#039;&#039;$if3($meta(album),$meta(venue))&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== %artist% ===&lt;br /&gt;
Defined as &#039;&#039;$if3($meta(artist),$meta(album artist),$meta(composer),$meta(performer))&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== %disc% ===&lt;br /&gt;
Returns the discnumber. The discnumber is taken from the discnumber tag; if that does not exist, it is taken from the disc tag. If neither exist, the field is undefined.&lt;br /&gt;
&lt;br /&gt;
This is equivalent to the %discnumber% remapping.&lt;br /&gt;
&lt;br /&gt;
=== %discnumber% ===&lt;br /&gt;
Returns the discnumber. The discnumber is taken from the discnumber tag; if that does not exist, it is taken from the disc tag. If neither exist, the field is undefined.&lt;br /&gt;
&lt;br /&gt;
This is equivalent to the %disc% remapping.&lt;br /&gt;
&lt;br /&gt;
=== %track artist% ===&lt;br /&gt;
Defined as &#039;&#039;$meta(artist)&#039;&#039;, if &#039;&#039;$meta(album artist)&#039;&#039; is different than &#039;&#039;$meta(artist)&#039;&#039;, otherwise this field is empty.&lt;br /&gt;
&lt;br /&gt;
=== %title% ===&lt;br /&gt;
Defined as &#039;&#039;$if2($meta(title),%_filename_ext%)&#039;&#039;. Returns the &#039;&#039;title&#039;&#039; tag if available, otherwise it returns the filename including the extension.&lt;br /&gt;
&lt;br /&gt;
=== %track% ===&lt;br /&gt;
Returns the tracknumber padded to two digits from the left with zeroes. The tracknumber is taken from the tracknumber tag; if that does not exist, it is taken from the track tag. If neither exist, this field is undefined.&lt;br /&gt;
&lt;br /&gt;
This is equivalent to the %tracknumber% remapping.&lt;br /&gt;
&lt;br /&gt;
=== %tracknumber% ===&lt;br /&gt;
Returns the tracknumber padded to two digits from the left with zeroes. The tracknumber is taken from the tracknumber tag; if that does not exist, it is taken from the track tag. If neither exist, this field is undefined.&lt;br /&gt;
&lt;br /&gt;
This is equivalent to the %track% remapping.&lt;br /&gt;
&lt;br /&gt;
== Technical information ==&lt;br /&gt;
&lt;br /&gt;
=== %bitrate% ===&lt;br /&gt;
Defined as &#039;&#039;$if2($info(bitrate_dynamic),$info(bitrate))&#039;&#039;. Returns the current bitrate, if available, otherwise it returns the average bitrate. If neither is available, nothing is returned.&lt;br /&gt;
&lt;br /&gt;
=== %channels% ===&lt;br /&gt;
Defined as &#039;&#039;$channels()&#039;&#039;. Returns the number of channels in text form; returns &amp;quot;mono&amp;quot; and &amp;quot;stereo&amp;quot; instead of &amp;quot;1&amp;quot; and &amp;quot;2&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== %filesize% ===&lt;br /&gt;
Defined as &#039;&#039;%_filesize%&#039;&#039;. Returns the filesize in bytes.&lt;br /&gt;
&lt;br /&gt;
=== %samplerate% ===&lt;br /&gt;
Defined as &#039;&#039;$info(samplerate)&#039;&#039;. Returns the samplerate in Hz.&lt;br /&gt;
&lt;br /&gt;
=== %codec% ===&lt;br /&gt;
Defined as &#039;&#039;$codec()&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Special fields ==&lt;br /&gt;
&lt;br /&gt;
=== %playlist_number% ===&lt;br /&gt;
Defined as &#039;&#039;$num(%_playlist_number%,$len(%_playlist_total%))&#039;&#039;. Returns the position of the track as index into the playlist. The first track has index 1. The index is padded from the left with zeroes to the same number of digits as the last track.&lt;br /&gt;
&lt;br /&gt;
= Control flow =&lt;br /&gt;
&lt;br /&gt;
The functions in this section can be used to conditionally execute statements.&lt;br /&gt;
&lt;br /&gt;
=== [...] (conditional section) ===&lt;br /&gt;
&lt;br /&gt;
Evaluates the expression between &#039;&#039;[&#039;&#039; and &#039;&#039;]&#039;&#039;. If it has the truth value &#039;&#039;true&#039;&#039;, its string value and the truth value &#039;&#039;true&#039;&#039; are returned. Otherwise an empty string and &#039;&#039;false&#039;&#039; are returned.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;[%artist%]&#039;&#039; returns the value of the artist tag, if it exists. Otherwise it returns nothing, when &#039;&#039;artist&#039;&#039; would return &amp;quot;?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== $if(cond,then) ===&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;cond&#039;&#039; evaluates to &#039;&#039;true&#039;&#039;, the &#039;&#039;then&#039;&#039; part is evaluated and its value returned. Otherwise, &#039;&#039;false&#039;&#039; is returned.&lt;br /&gt;
&lt;br /&gt;
=== $if(cond,then,else) ===&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;cond&#039;&#039; evaluates to &#039;&#039;true&#039;&#039;, the &#039;&#039;then&#039;&#039; part is evaluated and its value returned. Otherwise, the &#039;&#039;else&#039;&#039; part is evaluated and its value returned.&lt;br /&gt;
&lt;br /&gt;
=== $if2(a,else) ===&lt;br /&gt;
&lt;br /&gt;
Like &#039;&#039;$if(a,a,else)&#039;&#039; except that &#039;&#039;a&#039;&#039; is only evaluated once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== $if3(a1,a2,...,aN,else) ===&lt;br /&gt;
&lt;br /&gt;
Evaluates arguments &#039;&#039;a1&#039;&#039; ... &#039;&#039;aN&#039;&#039;, until one is found that evaluates to &#039;&#039;true&#039;&#039;. If that happens, its value is returned. Otherwise the &#039;&#039;else&#039;&#039; part is evaluated and its value returned.&lt;br /&gt;
&lt;br /&gt;
=== $ifgreater(n1,n2,then,else) ===&lt;br /&gt;
&lt;br /&gt;
Compares the integer numbers &#039;&#039;n1&#039;&#039; and &#039;&#039;n2&#039;&#039;, if &#039;&#039;n1&#039;&#039; is greater than &#039;&#039;n2&#039;&#039;, the &#039;&#039;then&#039;&#039; part is evaluated and its value returned. Otherwise the &#039;&#039;else&#039;&#039; part is evaluated and its value returned.&lt;br /&gt;
&lt;br /&gt;
=== $iflonger(s1,s2,then,else) ===&lt;br /&gt;
&lt;br /&gt;
Compares the length of the strings &#039;&#039;s1&#039;&#039; and &#039;&#039;s2&#039;&#039;, if &#039;&#039;s1&#039;&#039; is longer than &#039;&#039;s2&#039;&#039;, the &#039;&#039;then&#039;&#039; part is evaluated and its value returned. Otherwise the &#039;&#039;else&#039;&#039; part is evaluated and its value returned.&lt;br /&gt;
&lt;br /&gt;
=== $select(n,a1,...,aN) ===&lt;br /&gt;
&lt;br /&gt;
If the value of &#039;&#039;n&#039;&#039; is between 1 and N, &#039;&#039;an&#039;&#039; is evaluated and its value returned. Otherwise &#039;&#039;false&#039;&#039; is returned.&lt;br /&gt;
&lt;br /&gt;
= Arithmetic functions =&lt;br /&gt;
&lt;br /&gt;
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string, that can be interpreted as number. Leading whitespace is ignored.&lt;br /&gt;
&lt;br /&gt;
Example: &amp;quot;c3po&amp;quot; -&amp;gt; 0, &amp;quot; -12&amp;quot; -&amp;gt; -12, but &amp;quot;- 12&amp;quot; -&amp;gt; 0&lt;br /&gt;
&lt;br /&gt;
=== $add(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Adds &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$add(a,b,...)&#039;&#039; is the same as &#039;&#039;$add($add(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $div(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Divides &#039;&#039;a&#039;&#039; through &#039;&#039;b&#039;&#039;. If &#039;&#039;b&#039;&#039; evaluates to zero, it returns &#039;&#039;a&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$div(a,b,...)&#039;&#039; is the same as &#039;&#039;$div($div(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $greater(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Returns true, if &#039;&#039;a&#039;&#039; is greater than &#039;&#039;b&#039;&#039;, otherwise false.&lt;br /&gt;
&lt;br /&gt;
=== $max(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$max(a,b,...)&#039;&#039; is the same as &#039;&#039;$max($max(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $min(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Returns the minimum of &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$min(a,b,...)&#039;&#039; is the same as &#039;&#039;$min($min(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $mod(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Computes the remainder of dividing &#039;&#039;a&#039;&#039; through &#039;&#039;b&#039;&#039;. The result has the same sign as &#039;&#039;a&#039;&#039;. If &#039;&#039;b&#039;&#039; evaluates to zero, the result is &#039;&#039;a&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$mod(a,b,...)&#039;&#039; is the same as &#039;&#039;$mod($mod(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $mul(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Multiplies &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$mul(a,b,...)&#039;&#039; is the same as &#039;&#039;$mul($mul(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $muldiv(a,b,c) ===&lt;br /&gt;
&lt;br /&gt;
Multiplies &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039;, then divides by &#039;&#039;c&#039;&#039;. The result is rounded to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
=== $rand() ===&lt;br /&gt;
&lt;br /&gt;
Generates a random number in the range from 0 to 2&amp;lt;sup&amp;gt;32&amp;lt;/sup&amp;gt;-1.&lt;br /&gt;
&lt;br /&gt;
=== $sub(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Subtracts &#039;&#039;b&#039;&#039; from &#039;&#039;a&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can be used with an arbitrary number of arguments. &#039;&#039;$sub(a,b,...)&#039;&#039; is the same as &#039;&#039;$sub($sub(a,b),...)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Boolean functions =&lt;br /&gt;
&lt;br /&gt;
The functions in this section can be used to work with truth values (&#039;&#039;true&#039;&#039; and &#039;&#039;false&#039;&#039;), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with &#039;&#039;$if&#039;&#039; and related functions.&lt;br /&gt;
&lt;br /&gt;
=== $and(...) ===&lt;br /&gt;
&lt;br /&gt;
Logical And of an arbitrary number of arguments. Returns &#039;&#039;true&#039;&#039;, if and only if all arguments evaluate to &#039;&#039;true&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Special case: &#039;&#039;$and(x,y)&#039;&#039; is &#039;&#039;true&#039;&#039;, if both &#039;&#039;x&#039;&#039; and &#039;&#039;y&#039;&#039; are &#039;&#039;true&#039;&#039;. Otherwise it is &#039;&#039;false&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $or(...) ===&lt;br /&gt;
&lt;br /&gt;
Logical Or of an arbitrary number of arguments. Returns &#039;&#039;true&#039;&#039;, if at least one argument evaluates to &#039;&#039;true&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Special case: &#039;&#039;$or(x,y)&#039;&#039; is &#039;&#039;true&#039;&#039;, if &#039;&#039;x&#039;&#039; or &#039;&#039;y&#039;&#039; is &#039;&#039;true&#039;&#039;, or if both are &#039;&#039;true&#039;&#039;. Otherwise it is &#039;&#039;false&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $not(x) ===&lt;br /&gt;
&lt;br /&gt;
Logical Not. Returns &#039;&#039;false&#039;&#039;, if &#039;&#039;x&#039;&#039; is &#039;&#039;true&#039;&#039;, otherwise it returns &#039;&#039;true&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $xor(...) ===&lt;br /&gt;
&lt;br /&gt;
Logical Exclusive-or of an arbitrary number of arguments. Returns &#039;&#039;true&#039;&#039;, if an odd number of arguments evaluate to &#039;&#039;true&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Special case: &#039;&#039;$xor(x,y)&#039;&#039; is &#039;&#039;true&#039;&#039;, if one of &#039;&#039;x&#039;&#039; and &#039;&#039;y&#039;&#039; is &#039;&#039;true&#039;&#039;, but not both. Otherwise it is &#039;&#039;false&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Color functions =&lt;br /&gt;
&lt;br /&gt;
=== $blend(color1,color2,part,total) ===&lt;br /&gt;
&lt;br /&gt;
Returns a color that is a blend between &#039;&#039;color1&#039;&#039; and &#039;&#039;color2&#039;&#039;. If &#039;&#039;part&#039;&#039; is smaller than or equal to zero, &#039;&#039;color1&#039;&#039; is returned. If &#039;&#039;part&#039;&#039; is greater than or equal to &#039;&#039;total&#039;&#039;, &#039;&#039;color2&#039;&#039; is returned. Otherwise a blended color is returned that is &#039;&#039;part&#039;&#039; parts &#039;&#039;color1&#039;&#039; and &#039;&#039;total&#039;&#039;-&#039;&#039;part&#039;&#039; parts &#039;&#039;color2&#039;&#039;. The blending is performed in the RGB color space.&lt;br /&gt;
&lt;br /&gt;
=== $rgb() ===&lt;br /&gt;
&lt;br /&gt;
Resets the text color to the default color.&lt;br /&gt;
&lt;br /&gt;
=== $rgb(r,g,b) ===&lt;br /&gt;
&lt;br /&gt;
Sets the color for text. &#039;&#039;r&#039;&#039;, &#039;&#039;g&#039;&#039; and &#039;&#039;b&#039;&#039; are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.&lt;br /&gt;
&lt;br /&gt;
=== $rgb(r1,g1,b1,r2,g2,b2) ===&lt;br /&gt;
&lt;br /&gt;
Sets the color for text. &#039;&#039;r1&#039;&#039;, &#039;&#039;g1&#039;&#039; and &#039;&#039;b1&#039;&#039; are the red, green and blue component of the color for unselected text. &#039;&#039;r2&#039;&#039;, &#039;&#039;g2&#039;&#039; and &#039;&#039;b2&#039;&#039; are the red, green and blue component for the color of selected text.&lt;br /&gt;
&lt;br /&gt;
=== $transition(string,color1,color2) ===&lt;br /&gt;
&lt;br /&gt;
Inserts color codes into &#039;&#039;string&#039;&#039;, so that the first character has &#039;&#039;color1&#039;&#039;, the last character has &#039;&#039;color2&#039;&#039;, and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying &#039;&#039;$transition&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Now playing info =&lt;br /&gt;
The following functions and fields are usable for scripts used with the currently playing item, for example the status bar, the main window title and the copy command script.&lt;br /&gt;
&lt;br /&gt;
== Special fields ==&lt;br /&gt;
&lt;br /&gt;
=== %_time_elapsed% ===&lt;br /&gt;
Returns elapsed time.&lt;br /&gt;
&lt;br /&gt;
=== %_time_remaining% ===&lt;br /&gt;
Returns remaining time until track ends.&lt;br /&gt;
&lt;br /&gt;
=== %_time_total% ===&lt;br /&gt;
Returns total length of track.&lt;br /&gt;
&lt;br /&gt;
=== %_time_elapsed_seconds% ===&lt;br /&gt;
Returns elapsed time in seconds.&lt;br /&gt;
&lt;br /&gt;
=== %_time_remaining_seconds% ===&lt;br /&gt;
Returns remaining time in seconds.&lt;br /&gt;
&lt;br /&gt;
=== %_time_total_seconds% ===&lt;br /&gt;
Returns total track length in seconds.&lt;br /&gt;
&lt;br /&gt;
=== %_ispaused% ===&lt;br /&gt;
Returns &amp;quot;1&amp;quot; if playback is paused and empty string otherwise.&lt;br /&gt;
&lt;br /&gt;
= Playlist info =&lt;br /&gt;
The following functions and fields are usable for playlist scripts.&lt;br /&gt;
&lt;br /&gt;
== Special fields ==&lt;br /&gt;
&lt;br /&gt;
=== %isplaying% ===&lt;br /&gt;
&lt;br /&gt;
Returns &amp;quot;1&amp;quot; if file is currently playing and empty string otherwise.&lt;br /&gt;
&lt;br /&gt;
The old version &amp;lt;code&amp;gt;%_isplaying%&amp;lt;/code&amp;gt; still works.&lt;br /&gt;
&lt;br /&gt;
=== %_ispaused% ===&lt;br /&gt;
&lt;br /&gt;
Returns &amp;quot;1&amp;quot; if playback is paused, empty string otherwise.&lt;br /&gt;
&lt;br /&gt;
=== %_playlist_number% ===&lt;br /&gt;
&lt;br /&gt;
Returns playlist index of specified item. The first item is at index 1.&lt;br /&gt;
&lt;br /&gt;
Also see [[Foobar2000:Titleformat Reference#%playlist_number%|%playlist_number%]].&lt;br /&gt;
&lt;br /&gt;
=== %_playlist_total% ===&lt;br /&gt;
&lt;br /&gt;
Returns number of items in the playlist.&lt;br /&gt;
&lt;br /&gt;
=== %playlist_name% ===&lt;br /&gt;
&lt;br /&gt;
Returns the name of the playlist containing the specified item.&lt;br /&gt;
&lt;br /&gt;
The old version &amp;lt;code&amp;gt;%_playlist_name%&amp;lt;/code&amp;gt; still works.&lt;br /&gt;
&lt;br /&gt;
= String functions =&lt;br /&gt;
&lt;br /&gt;
The functions in this section can be used to manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== $abbr(x) ===&lt;br /&gt;
&lt;br /&gt;
Returns abbreviation of &#039;&#039;x&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $abbr(x,len) ===&lt;br /&gt;
&lt;br /&gt;
Returns abbreviation of &#039;&#039;x&#039;&#039;, if &#039;&#039;x&#039;&#039; is longer than &#039;&#039;len&#039;&#039; characters, otherwise returns &#039;&#039;x&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $ansi(x) ===&lt;br /&gt;
&lt;br /&gt;
Converts &#039;&#039;x&#039;&#039; to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.&lt;br /&gt;
&lt;br /&gt;
=== $caps(x) ===&lt;br /&gt;
&lt;br /&gt;
Converts first letter in every word of x to uppercase, and all other letters to lowercase.&lt;br /&gt;
&lt;br /&gt;
=== $caps2(x) ===&lt;br /&gt;
&lt;br /&gt;
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.&lt;br /&gt;
&lt;br /&gt;
=== $char(x) ===&lt;br /&gt;
&lt;br /&gt;
Inserts Unicode character with code &#039;&#039;x&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $crlf() ===&lt;br /&gt;
&lt;br /&gt;
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system  notification area (&amp;quot;systray&amp;quot;) icon.&lt;br /&gt;
&lt;br /&gt;
=== $cut(a,len) ===&lt;br /&gt;
&lt;br /&gt;
Returns first &#039;&#039;len&#039;&#039; characters on the left of &#039;&#039;a&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $directory(x) ===&lt;br /&gt;
&lt;br /&gt;
Extracts directory name from the file path &#039;&#039;x&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $directory(x,n) ===&lt;br /&gt;
&lt;br /&gt;
Extracts directory name from the file path &#039;&#039;x&#039;&#039;; goes up by &#039;&#039;n&#039;&#039; levels.&lt;br /&gt;
&lt;br /&gt;
=== $ext(x) ===&lt;br /&gt;
&lt;br /&gt;
Extracts file extension from &#039;&#039;x&#039;&#039; which must be a file name or path.&lt;br /&gt;
&lt;br /&gt;
=== $filename(x) ===&lt;br /&gt;
&lt;br /&gt;
Extracts file name from full path.&lt;br /&gt;
&lt;br /&gt;
=== $fix_eol(x) ===&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;x&#039;&#039; contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by &amp;quot; (...)&amp;quot;. Otherwise &#039;&#039;x&#039;&#039; is returned unaltered.&lt;br /&gt;
&lt;br /&gt;
=== $fix_eol(x,indicator) ===&lt;br /&gt;
&lt;br /&gt;
If &#039;&#039;x&#039;&#039; contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by &#039;&#039;indicator&#039;&#039;. Otherwise &#039;&#039;x&#039;&#039; is returned unaltered.&lt;br /&gt;
&lt;br /&gt;
=== $hex(n) ===&lt;br /&gt;
&lt;br /&gt;
Formats the integer number &#039;&#039;n&#039;&#039; in hexadecimal notation.&lt;br /&gt;
&lt;br /&gt;
=== $hex(n,len) ===&lt;br /&gt;
&lt;br /&gt;
Formats the integer number &#039;&#039;n&#039;&#039; in hexadecimal notation with &#039;&#039;len&#039;&#039; digits. Pads with zeros from the left if necessary.&lt;br /&gt;
&lt;br /&gt;
=== $insert(a,b,n) ===&lt;br /&gt;
&lt;br /&gt;
Inserts &#039;&#039;b&#039;&#039; into &#039;&#039;a&#039;&#039; after &#039;&#039;n&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $left(a,len) ===&lt;br /&gt;
&lt;br /&gt;
Returns the first &#039;&#039;len&#039;&#039; characters from the left of &#039;&#039;a&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $len(a) ===&lt;br /&gt;
&lt;br /&gt;
Returns length of string &#039;&#039;a&#039;&#039; in characters.&lt;br /&gt;
&lt;br /&gt;
=== $len2(a) ===&lt;br /&gt;
&lt;br /&gt;
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).&lt;br /&gt;
&lt;br /&gt;
=== $longer(a,b) ===&lt;br /&gt;
&lt;br /&gt;
Returns &#039;&#039;true&#039;&#039;, if string &#039;&#039;a&#039;&#039; is longer than string &#039;&#039;b&#039;&#039;, false otherwise.&lt;br /&gt;
&lt;br /&gt;
=== $lower(a) ===&lt;br /&gt;
&lt;br /&gt;
Converts &#039;&#039;a&#039;&#039; to lowercase.&lt;br /&gt;
&lt;br /&gt;
=== $longest(a,...) ===&lt;br /&gt;
&lt;br /&gt;
Returns the longest of its arguments. Can be used with an arbitrary number of strings.&lt;br /&gt;
&lt;br /&gt;
=== $num(n,len) ===&lt;br /&gt;
&lt;br /&gt;
Formats the integer number &#039;&#039;n&#039;&#039; in decimal notation with &#039;&#039;len&#039;&#039; digits. Pads with zeros from the left if necessary.&lt;br /&gt;
&lt;br /&gt;
=== $pad(x,len) ===&lt;br /&gt;
&lt;br /&gt;
Pads &#039;&#039;x&#039;&#039; from the left with spaces to &#039;&#039;len&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $pad_right(x,y) ===&lt;br /&gt;
&lt;br /&gt;
Pads &#039;&#039;x&#039;&#039; from the right with spaces to &#039;&#039;len&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $pad(x,len,char) ===&lt;br /&gt;
&lt;br /&gt;
Pads &#039;&#039;x&#039;&#039; from the left with &#039;&#039;char&#039;&#039; to &#039;&#039;len&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $pad_right(x,len,char) ===&lt;br /&gt;
&lt;br /&gt;
Pads &#039;&#039;x&#039;&#039; from the right with &#039;&#039;char&#039;&#039; to &#039;&#039;len&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $padcut(x,len) ===&lt;br /&gt;
&lt;br /&gt;
Returns first &#039;&#039;len&#039;&#039; characters from the left of &#039;&#039;x&#039;&#039;, if &#039;&#039;x&#039;&#039; is longer than &#039;&#039;len&#039;&#039; characters. Otherwise pads &#039;&#039;x&#039;&#039; from the left with spaces to &#039;&#039;len&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $padcut_right(x,len) ===&lt;br /&gt;
&lt;br /&gt;
Returns first &#039;&#039;len&#039;&#039; characters from the left of &#039;&#039;x&#039;&#039;, if &#039;&#039;x&#039;&#039; is longer than &#039;&#039;len&#039;&#039; characters. Otherwise pads &#039;&#039;x&#039;&#039; from the right with spaces to &#039;&#039;len&#039;&#039; characters.&lt;br /&gt;
&lt;br /&gt;
=== $progress(pos,range,len,a,b) ===&lt;br /&gt;
&lt;br /&gt;
Creates a progress bar: &#039;&#039;pos&#039;&#039; contains position, &#039;&#039;range&#039;&#039; contains range, &#039;&#039;len&#039;&#039; progress bar length in characters, &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039; are characters to build progress bar with.&lt;br /&gt;
&lt;br /&gt;
Example:&#039;&#039;$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,&#039;#&#039;,&#039;=&#039;)&#039;&#039; produces &amp;quot;====#===============&amp;quot;, the # character is moving with playback position.&lt;br /&gt;
&lt;br /&gt;
=== $progress2(pos,range,len,a,b) ===&lt;br /&gt;
&lt;br /&gt;
Creates a progress bar: &#039;&#039;pos&#039;&#039; contains position, &#039;&#039;range&#039;&#039; contains range, &#039;&#039;len&#039;&#039; progress bar length in characters, &#039;&#039;a&#039;&#039; and &#039;&#039;b&#039;&#039; are characters to build progress bar with. Produces different appearance than &#039;&#039;$progress&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $repeat(a,n) ===&lt;br /&gt;
&lt;br /&gt;
Returns &#039;&#039;n&#039;&#039; copies of &#039;&#039;a&#039;&#039;. Note that &#039;&#039;a&#039;&#039; is evaluated once before its value is used, so &#039;&#039;$repeat&#039;&#039; cannot be used for loops.&lt;br /&gt;
&lt;br /&gt;
=== $replace(a,b,c) ===&lt;br /&gt;
&lt;br /&gt;
Replaces all occurrences of string &#039;&#039;b&#039;&#039; in string &#039;&#039;a&#039;&#039; with string &#039;&#039;c&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Can also be used with an arbitrary number of arguments. Note that &#039;&#039;$replace(a,b1,c1,b2,c2)&#039;&#039; is generally not the same as &#039;&#039;$replace($replace(a,b1,c1),b2,c2)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$replace(ab,a,b,b,c)&#039;&#039; -&amp;gt; &amp;quot;bc&amp;quot;, &#039;&#039;$replace($replace(ab,a,b),b,c)&#039;&#039; -&amp;gt; &amp;quot;cc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== $right(a,len) ===&lt;br /&gt;
&lt;br /&gt;
Returns the first &#039;&#039;len&#039;&#039; characters from the right of &#039;&#039;a&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $roman(n) ===&lt;br /&gt;
&lt;br /&gt;
Formats the integer number &#039;&#039;n&#039;&#039; in roman notation.&lt;br /&gt;
&lt;br /&gt;
=== $shortest ===&lt;br /&gt;
&lt;br /&gt;
Returns the shortest of its arguments. Can be used with an arbitrary number of strings.&lt;br /&gt;
&lt;br /&gt;
=== $strchr(s,c) ===&lt;br /&gt;
&lt;br /&gt;
Finds first occurence of character &#039;&#039;c&#039;&#039; in string &#039;&#039;s&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$strchr(abca,a)&#039;&#039; -&amp;gt; 1&lt;br /&gt;
&lt;br /&gt;
=== $strrchr(s,c) ===&lt;br /&gt;
&lt;br /&gt;
Finds last occurence of character &#039;&#039;c&#039;&#039; in string &#039;&#039;s&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$strrchr(abca,a)&#039;&#039; -&amp;gt; 4&lt;br /&gt;
&lt;br /&gt;
=== $strstr(s1,s2) ===&lt;br /&gt;
&lt;br /&gt;
Finds first occurence of string &#039;&#039;s2&#039;&#039; in string &#039;&#039;s1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $strcmp(s1,s2) ===&lt;br /&gt;
&lt;br /&gt;
Performs a case-sensitive comparison of the strings &#039;&#039;s1&#039;&#039; and &#039;&#039;s2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $stricmp(s1,s2) ===&lt;br /&gt;
&lt;br /&gt;
Performs a case-insensitive comparison of the strings &#039;&#039;s1&#039;&#039; and &#039;&#039;s2&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $substr(s,m,n) ===&lt;br /&gt;
&lt;br /&gt;
Returns substring of string &#039;&#039;s&#039;&#039;, starting from &#039;&#039;m&#039;&#039;-th character and ending at &#039;&#039;n&#039;&#039;-th character.&lt;br /&gt;
&lt;br /&gt;
=== $trim(s) ===&lt;br /&gt;
&lt;br /&gt;
Removes leading and trailing spaces from string &#039;&#039;s&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== $tab() ===&lt;br /&gt;
&lt;br /&gt;
Inserts one tabulator character.&lt;br /&gt;
&lt;br /&gt;
=== $tab(n) ===&lt;br /&gt;
&lt;br /&gt;
Inserts &#039;&#039;n&#039;&#039; tabulator characters.&lt;br /&gt;
&lt;br /&gt;
=== $upper(s) ===&lt;br /&gt;
&lt;br /&gt;
Converts string &#039;&#039;s&#039;&#039; to uppercase.&lt;br /&gt;
&lt;br /&gt;
= Track info =&lt;br /&gt;
&lt;br /&gt;
The functions and fields in this section can be used to access information about tracks.&lt;br /&gt;
&lt;br /&gt;
== Metadata ==&lt;br /&gt;
&lt;br /&gt;
=== $meta(name) ===&lt;br /&gt;
Returns value of tag called &#039;&#039;name&#039;&#039;. If multiple values of that tag exist, they are concatenated with &amp;quot;, &amp;quot; as separator.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$meta(artist)&#039;&#039; -&amp;gt; &amp;quot;He, She, It&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== $meta(name,n) ===&lt;br /&gt;
Returns value of &#039;&#039;n&#039;&#039;-th tag called &#039;&#039;name&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$meta(artist,2)&#039;&#039; -&amp;gt; &amp;quot;She&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== $meta_sep(name,sep) ===&lt;br /&gt;
Returns value of tag called &#039;&#039;name&#039;&#039;. If multiple values of that tag exist, they are concatenated with &#039;&#039;sep&#039;&#039; as separator.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$meta_sep(artist,&#039; + &#039;)&#039;&#039; -&amp;gt; &amp;quot;He + She + It&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== $meta_sep(name,sep,lastsep) ===&lt;br /&gt;
Returns value of tag called &#039;&#039;name&#039;&#039;. If multiple values of that tag exist, they are concatenated with &#039;&#039;sep&#039;&#039; as separator between all but the last two values which are concatenated with &#039;&#039;lastsep&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$metasep(artist,&#039;, &#039;,&#039;, and &#039;)&#039;&#039; -&amp;gt; &amp;quot;He, She, and It&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== $meta_test(...) === &lt;br /&gt;
Returns &#039;&#039;true&#039;&#039;, if all given tags exist.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$meta_test(artist,title)&#039;&#039; -&amp;gt; true&lt;br /&gt;
&lt;br /&gt;
=== $meta_num(name) ===&lt;br /&gt;
Returns the number of values for the tag called &#039;&#039;name&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$meta_num(artist)&#039;&#039; -&amp;gt; 3&lt;br /&gt;
&lt;br /&gt;
=== $tracknumber() ===&lt;br /&gt;
Returns the tracknumber padded to 2 digits with zeroes.&lt;br /&gt;
&lt;br /&gt;
=== $tracknumber(n) ===&lt;br /&gt;
Returns the tracknumber padded to &#039;&#039;n&#039;&#039; digits with zeros.&lt;br /&gt;
&lt;br /&gt;
== Technical information ==&lt;br /&gt;
&lt;br /&gt;
=== $info(name) ===&lt;br /&gt;
Returns value of technical information field called &#039;&#039;name&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$info(channels)&#039;&#039; -&amp;gt; 2&lt;br /&gt;
&lt;br /&gt;
=== $codec() ===&lt;br /&gt;
Returns codec of track. If no codec field is present, it the uses file extension.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$codec()&#039;&#039; -&amp;gt; &amp;quot;WavPack&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== $channels() === &lt;br /&gt;
Returns number of channels in text format.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;$channels()&#039;&#039; -&amp;gt; &amp;quot;stereo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== %__replaygain_album_gain% ===&lt;br /&gt;
Returns ReplayGain album gain value. //Not available through// &#039;&#039;$info(replaygain_album_gain)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== %__replaygain_album_peak% ===&lt;br /&gt;
Returns ReplayGain album peak value. //Not available through// &#039;&#039;$info(replaygain_album_peak)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== %__replaygain_track_gain% ===&lt;br /&gt;
Returns ReplayGain track gain value. //Not available through// &#039;&#039;$info(replaygain_track_gain)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== %__replaygain_track_peak% ===&lt;br /&gt;
Returns ReplayGain track peak value. //Not available through// &#039;&#039;$info(replaygain_track_peak)&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Special fields ==&lt;br /&gt;
&lt;br /&gt;
=== $extra(name) ===&lt;br /&gt;
Returns the value of the special field called &#039;&#039;name&#039;&#039;. These fields can also be accessed as &#039;&#039;%_name%&#039;&#039;; note the additional underscore. The following field names can be used:&lt;br /&gt;
==== filename ====&lt;br /&gt;
Returns the filename without directory and extension.&lt;br /&gt;
==== filename_ext ====&lt;br /&gt;
Returns the filename with extension, but without the directory.&lt;br /&gt;
==== directoryname ====&lt;br /&gt;
Returns the name of the parent directory only, not the complete path.&lt;br /&gt;
==== path ====&lt;br /&gt;
Returns the path.&lt;br /&gt;
==== path_raw ====&lt;br /&gt;
Returns the path as URL including the protocol scheme.&lt;br /&gt;
==== subsong ====&lt;br /&gt;
Returns the subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.&lt;br /&gt;
==== foobar2000_version ====&lt;br /&gt;
Returns a string representing the version of foobar2000.&lt;br /&gt;
==== length ====&lt;br /&gt;
Returns the length of the track formatted as hours, minutes, and seconds.&lt;br /&gt;
==== length_ex ====&lt;br /&gt;
Returns the length of the track formatted as hours, minutes, seconds, and milliseconds.&lt;br /&gt;
==== length_seconds ====&lt;br /&gt;
Returns the length of the track in seconds.&lt;br /&gt;
==== length_seconds_fp ====&lt;br /&gt;
Returns the length of the track in seconds as floating point number.&lt;br /&gt;
==== length_samples ====&lt;br /&gt;
Returns the length of the track in samples.&lt;br /&gt;
&lt;br /&gt;
= Variable operations =&lt;br /&gt;
&lt;br /&gt;
Variables can be used to store strings and number. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== $get(name) ===&lt;br /&gt;
&lt;br /&gt;
Returns the value that was last stored in the variable &#039;&#039;name&#039;&#039;, if the variable was not defined (yet), it returns nothing. The truth value returned by &#039;&#039;$get&#039;&#039; indicates if the variable &#039;&#039;name&#039;&#039; was defined.&lt;br /&gt;
&lt;br /&gt;
=== $put(name,value) ===&lt;br /&gt;
&lt;br /&gt;
Stores &#039;&#039;value&#039;&#039; in the variable &#039;&#039;name&#039;&#039; and returns &#039;&#039;value&#039;&#039; unaltered.&lt;br /&gt;
&lt;br /&gt;
=== $puts(name,value) ===&lt;br /&gt;
&lt;br /&gt;
Stores &#039;&#039;value&#039;&#039; in the variable &#039;&#039;name&#039;&#039; and returns only the truth value of &#039;&#039;value&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Phi</name></author>
	</entry>
</feed>