Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: File Operations Script and Masstagger Help (Read 3406 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

File Operations Script and Masstagger Help

First the masstagger question:
I want to remove all %album artist% tags when they are equal to the %artist% tag.

What i have so far is this:
Code: [Select]
$ifequal(%album artist%,%artist%,$replace(%album artist%,%artist%,),)

how do i run it with masstagger and is it right?

Is there a better solution?

Second,
here's my file operations script:

Code: [Select]
$if($meta_test(album artist),%album artist%\%album% '('[%date%]')'\'('[%discnumber%.]%tracknumber%')' %artist% - %title%,%artist%\%album% '('[%date%]')'\%artist% - '('[%discnumber%.]%tracknumber%')' %title%)


It should run fine when all files are tagged properly but I want apply it
to my hole library and you know, better save than sorry. 

Any suggestions for making it better?

File Operations Script and Masstagger Help

Reply #1
Well, for the first example you should use $meta() both for artist nad album artist. For the second example probably you snippet is OK, as IMO it can't be reduced because of your special scheme

File Operations Script and Masstagger Help

Reply #2
Thx for the tip with meta() but it seems that I am too dumb to figure out
how to apply my script... 

Masstagger doesn't has an option for running a custom script...
Am I missing something?

File Operations Script and Masstagger Help

Reply #3
format value:
destination: album artist
pattern: $if($strcmp($meta(album artist),$meta(artist)),,%album artist%)

File Operations Script and Masstagger Help

Reply #4
Well thanks,

and I'm happy that my attempt seems to work too. 

$ifequal($meta(album artist),$meta(artist),$replace(%album artist%,%artist%,),)

File Operations Script and Masstagger Help

Reply #5
Another question,

I want to remove discnumber if %discnumber% is 1.
That should not apply if %totaldiscs% or %discnumber% is 2 or above. 

My attempt for the first part:
Code: [Select]
$if($greater(%discnumber%,1),,$replace(%discnumber%,%discnumber%,))

What's wrong? How can the second part be accomplished?

edit:
one more

Code: [Select]
$if(%DISCOGS_LABEL%,$replace(%Publisher%,%Publisher%,%DISCOGS_LABEL%),)


Why is Publisher removed if Discogs Label is not present?

File Operations Script and Masstagger Help

Reply #6
It's very difficult for me to figure out how to write strings which fit my needs.
I think it's quite a task if you want to learn the whole thing through trial and error.
Especially if you have no experience in coding at all.

I would really like to have a more detailed guide on what the functions
explained in the titleformatting help can do and what not.
Especially how they can be combined to do things.

Are there any more detailed references except these:

http://www.tinkafoo.com/log/masstagger.html (good but not complete)

http://www.hydrogenaudio.org/forums/index....opic=12302& (old)

http://wiki.hydrogenaudio.org/index.php?ti...8foo_masstag%29 (basic knowledge)

http://eolindel.free.fr/foobar0.9/masstagger.php#tagging (not detailed enough)

I would even buy a book if all functions with a lot of examples were in there. 

BTW Please someone help me with my problem above.

File Operations Script and Masstagger Help

Reply #7
I think the main point you have to learn here (and in general in the context of coding) is how functions and replacements work. Basically everything with of the form $asdf is a function, this is a black box you can give values ("arguments") and it returns another value. Of course this value can then be again used as input for other functions; example: $function1(some argument,another argument,$function2(something))
At first "something" will be evaluated, then $function2(something) (with "something" replaced by what it has been evaluated to) is processed [i.e. some operation called function2 is applied to that input], then function1 is applied to the three arguments (at the same time) some argument, another argument and what has just been evaluated.

In mathematics you find examples like f(x,y,z) = x*y - y*z for numbers, in foobar we are working with strings (chains of characters), numbers and boolean (truth) values [true/false].

When working with title formatting scripts mostly the script is evaluated for each entry in the track list; the current entry has values (tags) which can be accessed by e.g. %title%, %album% etc., they can be used just like usual numbers/strings, they will be replaced by the current value before being processed further.

Knowing these elements, it's now your task to build/express what you want (it's like a kid playing with different bricks, knowing each of its features it can build other larger things).

Better ask specific (reduced to the essence) questions.

File Operations Script and Masstagger Help

Reply #8
WOW,

exactly the info i needed.

One last thing, would you please be so kind to give me
an example?

It would make things so much clearer for me
if I had a script which already works to learn from it.
The discnumber script would help me a lot.

After that I will ask more specific questions if needed.

I just need a push into the right direction...

Thx

File Operations Script and Masstagger Help

Reply #9
dude...

just search for %discnumber% PRESENT AND %totaldiscs% LESS 2
Ctrl+a the results, open Properties and empty the discnumber tag. apply. ready. 5 seconds most.

File Operations Script and Masstagger Help

Reply #10
Well,

I thought about that too, since the query syntax is a bit more clearly to me
but... I want to automate things and in the end, run a big
Masstagger preset and I'm done.

Also I want to give the config I'm working on to many people
so it should be most easy for them.

Lastly, I want to learn these things.

Thx anyway!


File Operations Script and Masstagger Help

Reply #12
uh man,

there are so many things to think about before a script works perfectly and for all
possible cases.

Yes, it works but:

Totaldiscs must be set.
And if totaldiscs is "2" discnumber will be "?"

It would be better if it would only work with discnumber...


File Operations Script and Masstagger Help

Reply #13
It only erases the discnumber when totaldisc is 1 or smaller, it also deletes totaldiscs when it is one.

when totaldisc is 2 discnumber should be 1 or 2.

You are making foobar overcomplicated with these things that can be done one 100K files in 5 seconds with a query and properties.

File Operations Script and Masstagger Help

Reply #14
Cases it won't work:

-if totaldiscs is 2 and discnumber 1: discnumber removed
But I only want the discnumber removed if discnumber is 1
and totaldiscs not present or 1.

-if totaldiscs is 1 and discnumber is not set: discnumber=?
This will write a ? in my tags...

Just for clarification:
I want to apply my naming scheme to all my files and
it includes 1.02 and 2.02 for discnumber.tracknumber.
So I don't want 1.02 for a single disc.

Sorry for making it complicated, but I already stated my
reasons for that.

File Operations Script and Masstagger Help

Reply #15
dude...

just search for %discnumber% PRESENT AND %totaldiscs% LESS 2
Ctrl+a the results, open Properties and empty the discnumber tag. apply. ready. 5 seconds most.


this guy is speaking sense. listen to him.

Also I want to give the config I'm working on to many people
so it should be most easy for them.


do you really think other people tag/name their files in exactly the same way as you do? i think not. it's a very personal thing.

 

File Operations Script and Masstagger Help

Reply #16
Quote
this guy is speaking sense. listen to him.

I do listen to him.
Quote
do you really think other people tag/name their files in exactly the same way as you do? i think not. it's a very personal thing.

The people I want to give my config to aren't good at all when it comes to "audio files", "naming schemes" and "tagging"
so I want to help them out with my config. And considering that, I need a more automatic way of doing things.
The less they must do ie: tag with discogs, run script and apply scheme, the better.

I don't want to bother you or others in here, I just want to help my friends organize their music
and find a track if they want to listen to it. This should apply on explorer level and also on the tag level.
unknown folder\unknown track by unknown artist is not a sane way to store your files...
Please don't say that this is not the case these days. I've seen huge librarys with
ripped tracks without any tags or a sane file naming scheme.

And with my help and only a bit of information left on their files they should be able to do it.
Nothing more and nothing less, that's what I'm after.

Also I'm willing to help other people too in here. ( As far as my skills go    )