PDA

View Full Version : Naming Scheme Tutorial



LtData
08-26-2007, 12:40 PM
At the request of multiple users, I am writing a short tutorial on how to use the naming scheme in dMC r12.

The basics of the naming scheme are simple to get:
[artist] - use for the artist name
[album artist] - use for the album artist, NOT the same as artist necessarily
[album] - use for the album title
[title] - use for the track title
[track] - use for the track number
[disc] - use for the disc number
[disc_total] - use for the total number of discs
[composer] - use for the composer of the CD
[conductor] - use for the conductor of the CD, normally used for classical music CDs
[genre] - use for the genre of the CD
[year] - use for the year of recording
[track_total] - use for the total number of tracks
[tag]<element>[] - use if you want to insert a non-standard track into the filename. The ending [] is used to tell dMC that the end of the tag element has been reached, in case there are spaces
[length] - use for the track length in milliseconds
[length_mmss] - use for the track length in minutes and seconds (mm.ss)
[length_hhmmss] - use for the track length in hours, minutes, and seconds (hh.mm.ss)
[encoder] - use for the name of the encoder (LAME, Nero, etc.)
[encoder+] - use for more detailed encoder information
[extension] - audio format extension (mp3, flac, etc.)
[cddb_id] - use for the CDDB disc ID
[date] - current date
[time] - current time
[day_of_week] - current day of the week
[now_year] - current year
[unique] - adds a unique value

LtData
08-26-2007, 01:01 PM
dMC r12 also introduces a "programmable" element into the naming scheme:
Basics: the programmable elements are always within bracks "[IFCOMP]", "[IFMULTI]", etc., a "string" element, and ending braces "[]" that ends the naming string. The naming string can be a list of the above simple elements or nested (multiple levels) of programmable strings. Examples will be listed below.
[IFCOMP]string[] - Used if the CD is a compilation
[IF!COMP]string[] - Used if the CD is NOT a compilation
[IFMULTI]string[] - Used if the CD is part of a multi-disc set
[IF!MULTI]string[] - Used if the CD is NOT part of a mutli-disc set
[UPPER]string[] - changes the "string" to all uppercase
[LOWER]string[] - changes the "string" to all lowercase
[RIGHT]count,string[] - uses the last "count" number of characters from the end of the string
[GRAB]from,to,string[] - grabs the portion of the string starting at "from" and going to "to"
[TRIM]string[] - trims spaces from the beginning or the end of the string
[DEL]from,to,string[] - similar to grab, but it removes the portion of the string specified, starting at "from" and going to "to"
[SETLEN]count,pre,post,string[] - "count" specifies the length of the string that is desired. Pre and post are character ASCII codes. If the string is longer than count, the string is shortened and characters are removed from the end. If the string is shorter than count and pre is present, the string is extended by inserting the character to the front of the string. If the string is shorter than count and post is present, the string is extended by inserting the character to the end of the string
[IFEQUALS]tag,equals,string[] - tests the given tag value against "equals". If they are equal, the string is included in the naming scheme
[IF!EQUALS]tag,equals,string[] - tests the given tag value against "equals". If they are NOT equal, the string is included in the naming scheme
[IFVALUE]tag,strifvalue,strnovalue[] - If the given tag name has a value, then "strifvalue" is used in the naming scheme, otherwise, if the given tag has no value, then "strnovalue" is used in the naming scheme

Edit: A table of ASCII characters for use with SETLEN: http://www.goascii.com/

LtData
08-26-2007, 03:25 PM
To try to show how the above can be used, the following will explain my personal naming scheme and the default naming scheme:

[IFCOMP][album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title][]To try to clarify this, I will break my naming scheme into the part used for compilations and the part used for single-artist albums

[album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title]Since the CD is a compilation, this is the effective compilation with the [IFCOMP] and trailing [] removed for clarity.
If the CD is only a single-disc set, the naming scheme is effective shortened to this:

[album]\[track] - [artist] - [title]Now the naming scheme is easy to see and understand: album\track - artist - track title.
The following scheme gives the same results as my naming scheme:

[IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[][album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title]

Next, the naming scheme used if the CD is NOT a compilation:

[IFVALUE]album artist,[album artist],[artist][]\[album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title]If the CD is not part of a multi-disc CD set, the naming scheme is shrank to this:

[IFVALUE]album artist,[album artist],[artist][]\[album]\[track] - [artist] - [title]Normally, the album artist tag is the artist for the entire album, as by default AMG shows the artist with any guest artist, which can ruin a naming scheme that uses just [aritst]. Therefore, if the [album artist] tag has a value (i.e. is not empty), then the naming scheme becomes:

[album artist]\[album]\[track] - [artist] - [title]Which is simply album artist\album\track - artist - title.


Now we will examine the default naming scheme:

[IFCOMP][IFVALUE]album artist,[album artist],Various Artists[]\[album][IFMULTI] Disc [disc][]\[track] [artist] - [title][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title][]First, the compilation naming scheme

[IFVALUE]album artist,[album artist],Various Artists[]\[album][IFMULTI] Disc [disc][]\[track] [artist] - [title]Again, assume album artist has a value and it is a single-CD set, we get:

[album artist]\[album]\[track] [artist] - [title]Note, though, that if album artist does not have a value (i.e. many different artists), [album artist] is replaced with "Various Artists". Now we have a simple "album artist\album\'track title' artist - title"

Now, the CD that is NOT a compilation:

[IFVALUE]album artist,[album artist],[artist][]\[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title]Now, we will either use [album artist] or [artist] depending on if the "album artist" is present or not. Again, assuming it is and it is a single-CD set:

[album artist]\[artist] - [album] - [track] - [title]Which is simply "album artist\artist - album - track - title".

LtData
08-26-2007, 03:38 PM
Now, to explain how
[IFCOMP][album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title][]and
[IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[][album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title] are equal. If you look at them, they are a little intimidating, granted. However, if you study them some, you see that most of the naming scheme is repeated, namely the "[album][IFMULTI] - Disc [disc][]\[track] - [artist] - [title]" part. Therefore, since the only difference is the beginning of the [IF!COMP] portion, we move the ending bracket of the "IF!COMP" section to just after the slash after [artist][], thereby giving us the same results in a shorter scheme. However, this concept is really only for advanced users.


Now, examples of how some of the programable elements works. Say your naming scheme involves a folder with the first letter of the artists name. To do this with the naming scheme, you need something like

[GRAB]1,2,[IFVALUE]album artist,[album artist],[artist][][] will give you the first letter of the [album artist] or [artist], again depending on if there is an [album artist] or not. Since compilations might mess up this, you might want to put this after the "IF!COMP" portion of the naming scheme.
Next, say you want to change the naming scheme if there is composer for the CD, as you sometimes rip classical music but don't want to use multiple profiles or naming schemes. Then you could do something like

[IFVALUE]composer,[composer],[artist][] or similar for conductor.
Remember, you can nest the programmable elements, as I did above with the [GRAB] example above. Just remember to put all of the closing brackets [] at the end of the programmable string.

LtData
08-26-2007, 03:38 PM
Feedback? Questions? Comments? Please put it here: http://forum.dbpoweramp.com/showthread.php?t=13931

Spoon
08-29-2007, 08:23 AM
To pad the disc number to 2 characters:


[SETLEN]2,48,,[disc][]

Spoon
11-10-2007, 10:18 AM
To preserve the source filename and path (but convert to a different drive):

For example your files are:

C:\A Folder\A Filename.wav

And you want to convert to:

D:\A Folder\A Filename.mp3

Then use the 'Dynamic Naming' feature of dbPoweramp Reference (select dynamic for the output to) as:

D:\[origpath]\[origfilename]

LtData
11-11-2007, 09:49 AM
Some dynamic naming elements that are not in the CD ripper naming scheme:
[TRIMFIRSTFOLDER]string[] - Remove the first folder from a path, normally used with [origpath]
[TRIMLASTFOLDER]string[] - Remove the last folder from a path, normally used with [origpath]

Spoon
01-20-2008, 04:34 AM
To change an artist such as 'The Beatles' to 'Beatles, The':

[IFEQUALS]artist,The [DEL]1,4,[artist][],[TRIM][DEL]1,4,[artist][], The[][]

LtData
05-04-2008, 01:25 PM
A request we seem to be getting a lot of is how to have dMC make a folder for each album (NB is default in R13 and above). I will show you an example with the default naming scheme:
[IFCOMP][IFCOMP][IFVALUE]album artist,[album artist],Various Artists[]\[album][IFMULTI] Disc [disc][]\[track] [artist] - [title][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title][]
The compilation part of the string already makes an album folder, so we'll focus on the non-compilation part of the name:
[IFVALUE]album artist,[album artist],[artist][]\[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title]
Now, most people want artist\album\filename, so we'll insert [album] after the artist part of the string but before the filename, as shown in bold below:
[IFVALUE]album artist,[album artist],[artist][]\[album]\[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title]Do note the trailing \ after album. Therefore, the entire string becomes:
[IFCOMP][IFVALUE]album artist,[album artist],Various Artists[]\[album][IFMULTI] Disc [disc][]\[track] [artist] - [title][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[album]\[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title][]

Spoon
06-24-2008, 04:25 PM
Changing a Year (such as 1995) to a \1990's\ folder, 1981 & 1989 would appear as 1980's:


[SETLEN]3,32,32,[year][]0's

Spoon
04-10-2009, 09:09 AM
To Make CD Ripper / Batch Ripper rip to unique folders if there is no metadata, change the artist section of the naming string to:

[IFEQUALS]artist,Unknown Artist,Unknown Artist ([cddb_id)[]