name | syntax |
Contains (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_conta) | $Contains(<field>,search-value) |
CutLeft (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_cutl) | $CutLeft(string,count) |
CutRight (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_cutr) | $CutRight(string,count) |
IsMatch (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_ismat) | $IsMatch(<field>,regex-pattern) |
IsNull (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_isnul) | $IsNull(<field>,text,<field>) |
Left (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_left) | $Left(<field>,n) |
Len (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_len) | $Len(<field>) |
Lower (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_low) | $Lower(<field>) |
Pad (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_pad) | $Pad(<field>,n) |
RemoveSortWords (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rems) | $RemoveSortWords(<field>) |
Replace (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_repl) | $Replace(<field>,search-text,replace-text) |
RxReplace (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rxrep) | $RxReplace(<field>,regex-pattern,replace-text) |
Right (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_right) | $Right(<field>,n) |
RomanNumerals (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_roman) | $RomanNumerals(<field>) |
RSplit (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rsplit) | $RSplit(<field>,search-text,index) |
RxSplit (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rxspl) | $RxSplit(<field>,regex-pattern,index) |
RxMatch (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rxmat) | $RxMatch(<field>,regex-pattern) |
SentenceCase (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_sent) * | $SentenceCase(string) |
TitleCase (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_titl) * | $TitleCase(string) |
Split (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_split) | $Split(<field>,search-text,index) |
TagContainsAnyString (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_tagcan) * | $TagContainsAnyString(<URL>,tag_name,string1|string2|etc.) |
TagContainsAllStrings (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_tagcal) * | $TagContainsAllStrings(<URL>,tag_name,string1|string2|etc.) |
Trim (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_trim) | $Trim(<field>) |
Upper (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_upper) | $Upper(<field>) |
name | syntax |
If (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_if) | $If(<field1>=<field2>,true-value,false-value) |
And (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_andor) / Or | $If($And($Contains(<field>,search-text)=T,$Contains(<field>,search-text)=T),value1,value2) |
And / Or (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_andor) | $If($Or($Contains(<field>,search-text)=T,$Contains(<field>,search-text)=T),value1,value2) |
Not (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_not) | $Not(<field1>=<field2>,true-value,false-value) |
name | syntax |
Add (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_add) | $Add(number1,number2) |
Sub (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_sub) | $Sub(number1,number2) |
Mul (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_mul) | $Mul(number1,number2) |
Div (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_div) | $Div(number1,number2) |
name | syntax |
Eq (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_eqnegt) * (equal to) Ne (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_eqnegt) * (not equal to) Gt (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_eqnegt) * (greater than) Lt (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_eqnegt) * (less than) Ge (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_eqnegt) * (greater than or equal to) Le (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_eqnegt) * (less than or equal to) | $eq(number1,number2) $ne(number1,number2) $gt(number1,number2) $lt(number1,number2) $ge(number1,number2) $le(number1,number2) |
Abs (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_abs) (absolute) | $Abs(number) |
Log (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_log) * (logarithm ) | $Log(number) |
Mod (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_mod) (modulus) | $Mod(number1,number2) |
Random (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rand) * | $Random(max_number) |
Round (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_round) * | $Round(number,number_of_digits_after_decimal_point) |
RoundDown (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rddwn) * | $RoundDown(number,number_of_digits_after_decimal_point) |
RoundUp (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_rdup) * | $RoundUp(number,number_of_digits_after_decimal_point) |
Sqrt (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_sqrt) * (square root) | $Sqrt(number) |
name | syntax |
Date (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_date) | $Date(<field>,format) |
DateCreated (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_datcr) * | $DateCreated(<URL>) |
Now (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_now) * | $Now() |
NumberOfDays (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_nmbrd) * | $NumberOfDays(datetime1,datetime2) |
AddDuration (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_adddr) * | $AddDuration(duration1,duration2) |
AddDurationToDateTime (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_adddt) * | $AddDurationToDateTime(datetime,duration) |
SubDuration (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_subdr) * | $SubDuration(duration1,duration2) |
SubDurationFromDateTime (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_subdt) * | $SubDurationFromDateTime(datetime,duration) |
MulDuration (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_muldr) * | $MulDuration(duration, number) |
SubDateTime (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_subda) * | $SubDateTime(datetime1,datetime2) |
name | syntax |
ASR (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_asr) * | $ASR(<URL>,preset_id) |
Char (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_char) * | $Char(hexadecimal code) |
CharN (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_charn) * | $CharN(hexadecimal code,decimal number of times) |
Count (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_count) | $Count(<grouping-field>) or $Count(<field>,<grouping-field>) |
First (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_first) | $First(<field>) |
Group (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_group) | $Group(<field>,n) |
LR (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_lr) * | $LR(<URL>,function_id) |
Min (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_min) | $Min(<field>,<grouping-field>) |
Max (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_max) | $Max(<field>,<grouping-field>) |
Name (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_name) | $Name(filename) |
Sort (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_sort) | $Sort(<field>) |
Sum (https://getmusicbee.com/forum/index.php?topic=35868.msg196258#post_func_sum) | $Sum(<field>,<grouping-field>) |
{color: r, g, b} {color: default} {font: name; style; size} {font: default} {contrast: n} {contrast: default} |
{font: Segoe UI Symbol;Regular;11}{color: 10,160,35} 🎵{font: Comic Sans MS;Italic;10}{color: default}<Title>{font: Segoe UI Symbol;Regular;10}{color: 237,122,7}{contrast: 60} 👤 {font: default}{color: default}{contrast: 80}<Artist>
$DateCreated(<URL>)
returns the file creation date.
$DateCreated("<URL>")
returns the file creation date/time.
$TagContainsAnyString("<URL>",tag_name,string1|string2|etc.): returns "T" if tag
contains any of the strings separated by |, otherwise returns "F".
tag_name must be written without angle brackets,
e.g. $TagContainsAnyString("<URL>",Title,a|an|the)
$TagContainsAllStrings("<URL>",tag_name,string1|string2|etc.): returns "T" if tag
contains all strings separated by |, otherwise returns "F".
A request to anyone using formulas that make use of more advanced date/time functions such as: AddDuration, SubDateTime, SubDurationFromDateTime etc.
It would be appreciated if you could share such a formula, and explain what its practical use is.
I could then add it as an example for these functions.
(it would be good if the formula is as brief as possible)
I could share my use case, but... uh... it's... uh... not brief. 😅Could you perhaps isolate only the date/time part(s) of it, and explain what it does?
@hiccup, please change…I will do that this weekend.
Code$DateCreated("<URL>")
$TagContainsAnyString("<URL>",tag_name,string1|string2|etc.)
$TagContainsAllStrings("<URL>",tag_name,string1|string2|etc.)
quotes allow to take into account parenthesis in URL
$TagContainsAnyString(<URL>,tag_name,string1|string2|etc.)I don't think I understand the construction of that function.
… no matter what characters URL contains.
you are quite right, of course it's better. unfortunately…O.k.
you are quite right, of course it's better. unfortunately some tags cannot be used that way, e.g. <Lyrics>. tag tools plugin supports for more number of tags (you can see the full list of tags in any plugin command, e.g. 'copy tag') than mb through the usage of <Tag name> construction.Just another thought:
mb native function $Contains can be used not only for tags, these are still correct usage: $Contains(the door open,<Artist>) or $Contains(my sample text,sample), though the latter usage (with only static text) is useless.Hmm, I'm starting to regret asking about this ;-)
again, i'm not 100% sure, but i think that…I'll have to chew a bit on that to try to fully understand. (not being a coder, and not being well-versed in the lingo)
again, i'm not 100% sure, but i think that using quotes allow place commas, angle brackets and parenthesis inside literal values. without quotes commas are treated as function parameter separator, angle brackets are treated as tag names boundaries and parenthesis are treated as function parameter boundaries.no, it's not very difficult to understand, i mean that: $Contains(String1,String2,<Title>) probably can't be correctly parsed because it's treated as function with 3 parameters, but $Contains("String1,String2",<Title>) probably will be parsed correctly as function with 2 parameters: 1st parameter - literal "String1,String2" and 2nd parameter - tag <Title>. and so on.
no, it's not very difficult to understand, i mean that: $Contains(String1,String2,<Title>) probably can't be correctly parsed because it's treated as function with 3 parameters, but $Contains("String1,String2",<Title>) probably will be parsed correctly as function with 2 parameters: 1st parameter - literal "String1,String2" and 2nd parameter - tag <Title>. and so on.Haha, you are hurting my brain on this Saturday night.
You mention: "String1,String2"YES! that's what i mean. and quotes probably will be omitted, when passing to the function. it seems that it's safe to use something like $Contains("<Title>,text1)",<Title>), where:
Isn't that factually one string?
I mean, the comma there triggers no special treatment?
it seems that it's safe to use something like $Contains("<Title>,text1)",<Title>), where:Huh, no matching brackets there? Is that intentional for your example?
<Title>,text1) is 1st literal parameter
second <Title> is 2nd paremeter, tag name.
Nice work.The appreciation is appreciated HickyPop. And welcome to the forum!
About the wiki part of your comment; the wiki is free for anyone to edit, update or contribute to.
And I have no reservations or problems whatsoever with anyone copying/pasting my work in this thread.
So you or anybody else is free to use it to update the wiki if desired.
hiccup, i've removed all 3 "log" functions from tag tools plugin. please correct the cheatsheet.Done
$AddDurationToDateTime(<Last Played>,<HH:MM:SS>)
$SubDurationFromDateTime($AddDurationToDateTime(<Last Played>,<HH:MM:SS>),00:<Time>)
do you mean 'album duration' tag?Code$AddDurationToDateTime(<Last Played>,<HH:MM:SS>)
Returns track's last played datetime + the album the track belongs to's duration in HH:MM:SS format
* 9/28/2022 2:16PM + 10:45:35 = 9/29/2022 01:01:35 AM
do you mean 'album duration' tag?
These maybe aren't the most friendly of examples, so I'm not sure if you want to use them, @hiccup, but here's parts of how I use these two tags.Code$AddDurationToDateTime(<Last Played>,<HH:MM:SS>)
Returns track's last played datetime + the album the track belongs to's duration in HH:MM:SS format
* 9/28/2022 2:16PM + 10:45:35 = 9/29/2022 01:01:35 AMCode$SubDurationFromDateTime($AddDurationToDateTime(<Last Played>,<HH:MM:SS>),00:<Time>)
Returns above formula - track duration
* (9/28/2022 2:16PM + 10:45:35) - 4:06 = 9/29/2022 12:57:29 AM
@hiccup, it seems that $DateCreated(<URL>) function is implemented in tag tools plugin only (it's definitely implemented at least in plugin), but it's not marked by asterisk.You are right.
updated
$ALR, $ASR and $Char were added
but $eq ,$le, $gt, etc?Will do, as promised.
$eq(number1,number2): compares 2 integer or fractional numbers, determines if number1 is [i][b]eq[/b][/i]ual to number2, e.g. $eq(1.0,1) returns "T"
$ne(number1,number2): determines if number1 is [i][b]n[/b][/i]ot [i][b]e[/b][/i]qual to number2
$gt(number1,number2): determines if number1 is [i][b]g[/b][/i]reater [i][b]t[/b][/i]han number2
$lt(number1,number2): determines if number1 is [i][b]l[/b][/i]ess [i][b]t[/b][/i]han to number2
$ge(number1,number2): determines if number1 is [i][b]g[/b][/i]reater than or [i][b]e[/b][/i]qual to to number2
$le(number1,number2): determines if number1 is [i][b]l[/b][/i]ess than or [i][b]e[/b][/i]qual to number2
i've done it for you:Thanks a lot. I will update and integrate it later today.
Thanks for the [anchor] codes!Well observed karbock ;-)
Patient work at its best!
Yo, this deserves to be wiki'd or sticki'd.Thnx HickyPop.
In a world where user manuals still exist, this would be eppendix'd.
I'm coming from Media Monkey where I managed to come up with my own sort-of-compicated auto-organizing mask. MusicBee's is a bit more of a head-scratcher for me and this is really helping. I think this has some good explanatory power for the common end user and should be more easily referenced and found.
Nice work.
@boroda, not important, but perhaps change $Lg to $Log?
i named it Lg because "log" is arbitrary logarithm (any base), "lg" is decimal logarithm (base 10), and "ln" is natural logarithm (base is Euler number, ~2.71...) in mathematics. .NET decimal logarithm function is named "Log10", not simply "Log".I'm sure your explanation is correct.
i'm doubtful that any logarithm base other than 10 can be useful for audio/music ;)Indeed.