FB2K's Masstagger, an unofficial Beginners Guide |
![]() ![]() |
FB2K's Masstagger, an unofficial Beginners Guide |
Aug 15 2003, 20:35
Post
#1
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
Update: This post is very old now and contains lots of inaccurate or outdated information. Please read the more up to date wiki article instead. Allrigth seems like these days the word tutorial, FAQ, whatever has been mentioned a few times once again on the forums. Seems to be kind of a dreadful issue that resurfaces every once in a while. And since I've been busy using FB's masstagger quite a lot lately and quite like this feature, I thought I'd try to make a more or less newcomer friendly guide to said function. Trying to explain the whole of FB2K probably would have been a bit much and I guess everyone knows how to hit a play button and encue a few files (well probably not everyone, but we'll put that aside for a different discussion). So basically the only thing needed is probably a few of FB's advanced functions explained in detail. So here is my first humble attempt at a small explanation, tutorial, FAQ, call it whatever, of one of FB's rather powerful features. Note that this is meant to also be understandable for people who have had no contact with these features at all yet, so it might explain the obvious a few times and is probably an entirely boring read for advanced users. So for anyone who cares to read, here is, The Unofficial Guide to FB's Masstagger FB'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. Basically there are several actions you can choose from to perform. Actions to perform: Set value Sets desired tag field (artist, album,custom,etc) to whatever you enter in the masstagger input window. Add value Adds desired tag field and sets it to whatever you enter in the masstagger input window. Remove value Removes desired tag field. Remove all values Removes all tag fields (who would have guessed) Copy value Copies one tag field to another. Guess values from filename Guesses values from filename and lets you enter a certain fromatting pattern for it. For example if your files are named artist - album_title. Enter %artist% - %album%_%title as formatting pattern. 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 . Remove all values 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.: %artist%;%title%;etc Auto track number Haven't really tried out this one in depth, guess it does kind of what it says. Split multiple artist field Same thing goes for this one. Never really used it yet. Notethat 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. Offtopic: Excellent, Pizza just arrived. This friday evening is improving. Writing format strings for the masstager: Well I guess the most powerful feature of FB"s masstager is the fact that it can use TAGZ format strings. For reference to all TAGZ commands please check the titleformatting help in your Foobar preferences. 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) 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. Allright before everyone gets bored with me blabbing on for to long I'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. 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't hold me responsible to what happens to your files. Masstagger Strings: 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's formatting readable in your browser. Returns corresponding tag field: %tag% Example: 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 %artis%X%title% returns blahXbleh. Trunctuates %tag% to a length of X characters: $cut(%tag%,X) Example: if artist field is blah $cut(%artist%,3) returns bla Truncuates %tag% by X characters and adds ... at the end of the cut. $cut(%tag%,X)... Example: if artist field is blah $cut(%artist%,3)... returns bla... Returns numerical value of %tag% and pads with 0s up to x characters $num(%tag%,X) Example: if tracknumber field is 3 $num(%tracknumber%,2) will return 03. If 13 it will return 13. Returns first two characters of a filename and displays as number (if present) padded with 0s up to X characters: $num($left(%_filename%),2) Example: if filename is 03_artist_title.mpc will return 03. Finds first occurence of character X in %tag% and returns everything in front of X: $puts(spacer,$strchr(%tag%,X)) $trim($left(%tag%,$sub($get(spacer),1))) Example: blah X bleh or blah X bleh X bluh returns blah (ie.: artist_album_title -----> title, in case X is _ ) NOTE: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). Finds first occurence of character X in %tag% and returns everything in front of X: $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char))) $trim($left($get(tag),$sub($get(spacer),1))) Example: blah X bleh or blah X bleh X bluh returns blah (ie.: artist_album_title -----> title, in case X is _ ) (Note 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) Finds last occurence of character X in %tag% and returns everything in front of X: $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char))) $trim($left($get(tag),$sub($get(spacer),1))) Example: blah X bleh returns blah and blah X bleh X bluh returns blah X bleh Finds first occurence of character X in %tag% field and returns everything after X: $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char))) $trim($right($get(tag), $sub($len($get(tag)),$get(spacer)))) Example: blah X bleh returns bleh and blah X bleh X bluh returns bleh X bluh Finds last occurence of character X in %tag% field and returns everything after X: $puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char))) $trim($right($get(tag), $sub($len($get(tag)),$get(spacer)))) Example: blah X bleh returns bleh and blah X bleh X bluh returns bluh Finds first occurence of character X and last occurence of character Y and returns everything in between: $puts(char1,X)$puts(char2,Y)$puts(tag,%tag%) $puts(spacer1,$strchr($get(tag),$get(char1))) $puts(spacer2,$strrchr($get(tag),$get(char2))) $trim($substr($get(tag),$add($get(spacer1),1),$sub($get(spacer2),1))) Example: blah X bleh Y bluh returns bleh Note that in most cases X will probably be equal to y here. Finds first occurence of string XYZ and returns everything in front of string XYZ: $puts(string,XYZ)$puts(tag,%tag%)$puts(spacer,$strstr($get(tag), $get(string))) $trim($left($get(tag),$sub($get(spacer),1))) Example: blah XYZ bleh returns blah Note that string XYZ can basically be any combination of characters or words. Finds first occurence of string XYZ in %tag% field and returns everything after XYZ: $puts(string,XYZ)$puts(tag,%tag%) $puts(spacer,$strstr($get(tag),$get(string))) $trim($right($get(tag),$sub($len($get(tag)), $add($get(spacer),$len($get(string)))))) Example: blah XYZ bleh returns bleh 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 ...\Genre\Artist\Album[Date]\01_Title.mpc sets title: %_filename% returns title as 01_Title.mpc and $puts(char,_)$puts(tag,%_filename%) $puts(spacer,$strchr($get(tag),$get(char))) $trim($right($get(tag),$sub($len($get(tag)),$get(spacer)))) returns title as Title.mpc sets album: $directory(%_path%,1) returns title as Album[Date] $puts(char,'[')$puts(tag,$directory(%_path%,1)) $puts(spacer,$strchr($get(tag),$get(char))) $trim($left($get(tag),$sub($get(spacer),1))) 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. Examples 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 CODE %tracknumber%_%title% 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 CODE /%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 CODE /%artst%/%album%/%tracknumber%_%title% In case you generally make use of "album artist" tags (or anything similar) for various albums files you can replace %artist% with CODE $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 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. EDIT: Damn this page turned out really wide, Anything I can do about that. (Well, except posting annoyingly long posts like this one EDIT2: Allright, this works better now. Thanks Jan EDIT3: Included relative file paths section EDIT4: Removed strange formatting again. Thanks to SamK for taking most of the workload off me. This post has been edited by Peter: Nov 3 2008, 18:15 |
|
|
|
Aug 15 2003, 20:44
Post
#2
|
|
![]() Group: Admin Posts: 2506 Joined: 26-September 01 From: Denmark Member No.: 21 |
QUOTE (picmixer @ Aug 15 2003, 09:35 PM) EDIT: Damn this page turned out really wide, Anything I can do about that. (Well, except posting annoyingly long posts like this one I believe you have to manually insert "new-lines" in your long one "word" strings. edit: btw. really nice! This post has been edited by Jan S.: Aug 15 2003, 20:45 |
|
|
|
Aug 15 2003, 21:03
Post
#3
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
QUOTE (Jan S. @ Aug 15 2003, 09:44 PM) I believe you have to manually insert "new-lines" in your long one "word" strings. Hmh, will have to think about this one. Sounds like quite a task. Thanks |
|
|
|
Aug 15 2003, 21:11
Post
#4
|
|
![]() Group: Admin Posts: 2506 Joined: 26-September 01 From: Denmark Member No.: 21 |
As far as I could see only 4 lines or so are too long.
|
|
|
|
Aug 16 2003, 02:02
Post
#5
|
|
|
Group: Members Posts: 395 Joined: 17-September 02 From: Hell Member No.: 3380 |
Thank you picmixer. This is much help for a dingbat like me.
-------------------- Looking for a digital idiot? Look no further.
|
|
|
|
Aug 16 2003, 08:51
Post
#6
|
|
|
Group: Members Posts: 109 Joined: 25-March 03 Member No.: 5661 |
Very nice,good work!
I suggest you should add an example to explain how to get values from the path(e.g. \Genre\Artist\Album[Date]\01_Title.mpc) by using "Format value from other fields". I think that trick is very useful. |
|
|
|
Aug 16 2003, 13:24
Post
#7
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
Thanks for the feedback everyone.
@/\/irana Included "extract info from relative file paths section, hope it is what you had in mind. |
|
|
|
Aug 16 2003, 23:43
Post
#8
|
|
|
Group: Members Posts: 305 Joined: 8-January 03 Member No.: 4465 |
It's "unoffical"
|
|
|
|
Aug 16 2003, 23:53
Post
#9
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
QUOTE (Killmaster @ Aug 17 2003, 12:43 AM) It's "unoffical" Already had a bad feeling about this. Anyway it's corrected in the post now, I don't think I can change the topic title. Not that important though. |
|
|
|
Aug 28 2003, 10:45
Post
#10
|
|
|
Group: Members Posts: 88 Joined: 20-July 03 Member No.: 7886 |
Thanks for this.
|
|
|
|
May 7 2004, 15:21
Post
#11
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
Updated this slighly today.
Basically added a small section on renaming files. |
|
|
|
Jun 18 2004, 04:40
Post
#12
|
|
|
Group: Members Posts: 4 Joined: 12-January 03 Member No.: 4540 |
Very useful guide, too bad I found it after I spent hours figuring it out myself
One thing though, some of the strings get cut off when I paste them into the formatting pattern box. I'm using the latest verson of foobar(.8.2) am I just missing something or do they get cut off for anyone else? |
|
|
|
Jun 18 2004, 05:28
Post
#13
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
Yes, I had to split a few of the scripts into two lines to make sure this page does not become unnaturally wide. You will have to rejoin them before pasting them into the Masstagger.
See the first three posts of this thread, where JanS told me the trick |
|
|
|
Jun 18 2004, 19:19
Post
#14
|
|
![]() Group: Members Posts: 233 Joined: 28-April 04 Member No.: 13771 |
Picmixer: Please don't take anything I say as a complaint or a put-down of the work you did. I really appreciate it, but I thought that perhaps you might like a few comments from the viewpoint of someone that doesn't know anything about masstagger, but does know something about training and user communications -- I used to be an editor at a computer magazine.
You say: QUOTE (Picmixer) 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 second option. When you say that it sounds to me like "the second option" means "to rename files." Is that true? QUOTE (Picmixer) Basically there are several actions you can choose from to perform. Actions to perform: Set value Sets desired tag field (artist, album,custom,etc) to whatever you enter in the masstagger input window. Ok, here's my first problem. I'm following along with you because I know nothing about Masstagger, so I want to do it step by step. You said (I think) that we were going to rename files, so I've selected some files in the playlist, right-clicked on the selection and chosen Masstagger->Rename Files. Now I want to set a value. The trouble is, I don't see any buttons or menu choices that say "Set value," nor do I see anything labeled "input window." I see "Output filename format," "Files to process," and "Preview" windows. I see "update," "Run," and "Cancel" buttons. I see an empty dropdown list. Basically, you've lost me. The rest of the items in that section ("Add Value," et al) are the same way. Thinking that maybe you meant to rename files, but then changed your mind, I canceled out and selected "Edit tags" from the Masstagger menu. Nope, no "Set value" choice there either. Also no "input window," although the "Actions to perform" window looks like a possibility. You may think at this point that I'm just busting your chops. I'm not. I'd truly like to learn how Masstagger works. I have a bachelor's degree in computer science and a masters degree in software engineering. I write software all day every day. I'm pretty good at figuring things out by myself, but I can't even get started with Masstagger. How about a little section at the beginning of your tutorial that explains, in a step-by-step manner how to do a couple of simple tasks to get the newbies started? Here's the level of detail I'm suggesting: QUOTE
If you do that for one or two examples, then even newbies like me will be able to follow the rest of your tips. -- Rick -------------------- ------- Rick -------
-------------------- |
|
|
|
Jun 18 2004, 20:59
Post
#15
|
|
|
Group: Members Posts: 4 Joined: 12-January 03 Member No.: 4540 |
QUOTE (picmixer @ Jun 17 2004, 08:28 PM) Yes, I had to split a few of the scripts into two lines to make sure this page does not become unnaturally wide. You will have to rejoin them before pasting them into the Masstagger. See the first three posts of this thread, where JanS told me the trick |
|
|
|
Jun 19 2004, 11:26
Post
#16
|
|
![]() Group: Members Posts: 125 Joined: 20-November 03 Member No.: 9941 |
QUOTE (picmixer @ Jun 18 2004, 06:28 AM) Yes, I had to split a few of the scripts into two lines to make sure this page does not become unnaturally wide. Actually, it still is unnaturally wide in firefox 0.9+ on 1024x768... Not the strings' fault, though, it seems more like linebreak has been turned off for the whole post and breaks were inserted manually. Something less offtopic: I noticed that in the latest special installer from case's site the renamer function got updated. Will you include a few words about the new version in the faq? It's really not hard to figure out (took me like 10 seconds), but it could be still worth to mention that creating strings is done in a slightly different way with the latest version. |
|
|
|
Jun 19 2004, 18:00
Post
#17
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
I saw that the formatting of the entire post got messed up somehow. In fact I don't even remember all the lines beeing double spaced. Weird.
I will get back to fixing this and adding a few things in about a day or two as I am low on time right now. |
|
|
|
Jun 24 2004, 12:10
Post
#18
|
|
|
Group: Members Posts: 4 Joined: 24-June 04 Member No.: 14878 |
I don't suppose there's some way to tweak the auto track number feature so that it will create numbers in the format of 01, 02, 03... instead of 1, 2, 3... Or is there? If you could help me out with this, it'd be greatly appreciated, as the current auto track scheme would completely screw the way I've been organizing my mp3s for a while now (it's a little more work, but I like it that way). I suppose if there isn't a way, I could continue doing it manually, but it's not all that much fun. Thanks.
|
|
|
|
Jun 24 2004, 12:37
Post
#19
|
|
![]() Group: Members Posts: 1099 Joined: 18-March 03 From: Oslo, Norway Member No.: 5569 |
@studentism: One way to do it:
Make a new masstagger "script" with the following two actions: 1) Auto track number 2) Format value from other fields.. Destination field name = TRACKNUMBER Formatting pattern = $num(%tracknumber%,2) Then save it as e.g. "Auto track number XX" or something. To use it, just pick it from the drop down list in the scrips section, and press Load or Add. Then Run as usual |
|
|
|
Jun 24 2004, 20:26
Post
#20
|
|
|
Group: Members Posts: 4 Joined: 24-June 04 Member No.: 14878 |
Works like a charm; thank you very much for your assistance.
|
|
|
|
Jun 25 2004, 12:36
Post
#21
|
|
|
Group: Members Posts: 57 Joined: 4-January 04 Member No.: 10938 |
the line width and extra blank lines was making it hard for me to read the guide, so I copied the original post and removed the extra newlines, and cut all the code lines at reasonable positions, and it's now much more browser friendly.
Picmixer, if you want you can copy the reformatted post (from quoting my post) and replace your original post with it. (then I'd remove it here, to make the thread cleaner) EDIT by picmixer : Many thanks. I removed your edited version from here now and replaced the original with it. Thanks once more for editing that for me. This post has been edited by picmixer: Jun 25 2004, 13:11 |
|
|
|
Jun 25 2004, 13:04
Post
#22
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
Wow, I am impressed. Thanks a lot, this is really appreciated.
Admittedly I was busy with a few other things lately and had forgotten (or rather procrastinated) updating this again Thanks for the effort. I'll change this immediately. |
|
|
|
Jun 25 2004, 21:16
Post
#23
|
|
|
Group: Members Posts: 57 Joined: 4-January 04 Member No.: 10938 |
QUOTE (picmixer @ Jun 25 2004, 01:04 PM) Wow, I am impressed. Thanks a lot, this is really appreciated. Admittedly I was busy with a few other things lately and had forgotten (or rather procrastinated) updating this again Thanks for the effort. I'll change this immediately. it's reallly nothing, I just copied the source of your post to a text editor, reformatted all the paragraphs with extra spaces, and inserted newlines in the lines of code that were too long. Btw, it might be worth mentionning this fact in the tutorial, so that newcomers know the code lines are meant to be used in one line. (though, I think the newlines in TAGZ code has no effect, e.g. in the title format window) Oh, and in fact I inserted newlines inside parenthesis in one case, I missed the 'reasonable position' at least once ! |
|
|
|
Jul 16 2004, 21:00
Post
#24
|
|
|
Group: Members Posts: 9 Joined: 12-July 04 Member No.: 15351 |
right now i'm using this out filename format in masstagger:
CODE %artist% - %album% %date%/$num(%tracknumber%,2) - %title% i was wondering how i go about adding bitrate info to the end of this line. thanks. |
|
|
|
Jul 16 2004, 21:54
Post
#25
|
|
|
Group: Members Posts: 167 Joined: 25-December 03 Member No.: 10688 |
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 9th September 2010 - 08:03 |