Author Topic: Fun with virtual tags and a wish  (Read 6470 times)

vincent kars

  • Sr. Member
  • ****
  • Posts: 445
As a header I like to have Composer - Composition - Performers
With the tags I have you get things like
Bach, Carl Philipp Emanuel (1714-1788) -  Cello concerto No.1 in A minor, H.432, Wq. 170 - Berger, Julius [Cello]; Dall'Arco Chamber Orchestra

A bit longish
Use the last name of the composer only
Hence you get Bach.
Nice but I have Carl Philipp Emanual, Wilhelm Friedemann.
You can do the same for the performers.
This is the artist tag and it contains multiple values.
Use the $Split to split them in separate values and Split again using the comma
$Split($Split(<Artist>,;,1),",",1)
Repeat this for the 2,3 etc artist.
I like a / as a separator between them.
Test if the artist exist, if so add it with a slash.
I ended with
$If(<Composer>="Bach, Carl Philipp Emanuel (1714-1788)","Bach CPE",$If(<Composer>="Bach, Johann Christian (1735-1782)","Bach JC",$If(<Composer>="Bach, Johann Christoph Friedrich(1732-1795)","Bach JCF",$If(<Composer>="Bach, Wilhelm Friedemann (1710-1784)","Bach WF",$If(<Composer>="Couperin, Louis (c1626-1661),Couperin L,$If(<Composer>=Couperin"," François (1668-1733)Couperin F",$If(<Composer>="Scarlatti, Domenico (1685-1757)","Scarlatti D",$If(<Composer>="Stamitz, Carl (1745-1801)","Stamitz C",$If(<Composer>="Stamitz, Johann (1717-1757)","Stamitz J",$If(<Composer>="Strauss, Richard (1864-1949)","Strauss R",$If(<Composer>="Tchaikovsky, Boris (1925-1996)","Tchaikovsky Boris",$If(<Composer>="Schumann, Clara (1819-1896)",Schumann-Wieck,$Split(<Composer>,",",1)))))))))))) - <Composition> - $Split($Split(<Artist>,;,1),",",1)$IsNull($Split($Split(<Artist>,;,2),",",1),,/$Split($Split(<Artist>,;,2),",",1))$IsNull($Split($Split(<Artist>,;,3),",",1),,/$Split($Split(<Artist>,;,3),",",1))

This is much easier to read
$If(<Composer>="Bach, Carl Philipp Emanuel (1714-1788)","Bach CPE",
$If(<Composer>="Bach, Johann Christian (1735-1782)","Bach JC",
$If(<Composer>="Bach, Johann Christoph Friedrich(1732-1795)","Bach JCF",
$If(<Composer>="Bach, Wilhelm Friedemann (1710-1784)","Bach WF",
$If(<Composer>="Couperin, Louis (c1626-1661),Couperin L,
$If(<Composer>=Couperin"," François (1668-1733)Couperin F",
$If(<Composer>="Scarlatti, Domenico (1685-1757)","Scarlatti D",
$If(<Composer>="Stamitz, Carl (1745-1801)","Stamitz C",
$If(<Composer>="Stamitz, Johann (1717-1757)","Stamitz J",
$If(<Composer>="Strauss, Richard (1864-1949)","Strauss R",
$If(<Composer>="Tchaikovsky, Boris (1925-1996)","Tchaikovsky Boris",
$If(<Composer>="Schumann, Clara (1819-1896)",Schumann-Wieck,
$Split(<Composer>,",",1))))))))))))
$Split(<Composer>,",",1)  - <Composition> -
$Split($Split(<Artist>,;,1),",",1)
$IsNull($Split($Split(<Artist>,;,2),",",1),,/$Split($Split(<Artist>,;,2),",",1))
$IsNull($Split($Split(<Artist>,;,3),",",1),,/$Split($Split(<Artist>,;,3),",",1))

There are 2 options:
1 Don't listen to classical
2 Don't do things like this
3 Ask Steve for a expression editing window allowing you to have multi-lines

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
3 Ask Steve for a expression editing window allowing you to have multi-lines

+1

For organizing templates, too.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

redwing

  • Guest
Are you gonna list hundreds of composer names in virtual tag like that? You're not serious. Try to improve the formula with a pattern. In those cases, non-last part of the names start after "," and end before " (". Then you could create a much shorter formula that writes only first letter of each part without listing actual names.

3 Ask Steve for a expression editing window allowing you to have multi-lines

+1

That'd be useful. Currently I'm using Notepad when editing long formula. Would be great if a click on the formula pops up an edit window.

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
You could also use a custom tag like "COMPOSERSHORTNAME" and set it for tracks where you prefer their short name to be displayed. Then just use $IsNull to display it if set and revert to Composer field if not.

Alternatively, it might make more sense to use the Composer field for what you actually want displayed (e.g. "Bach CPE") and use a custom tag or even the comment tag for their full details ("Bach, Carl Philipp Emanuel (1714-1788)").

The result will be the same but your virtual tags will be a lot more manageable.
Bee excellent to each other...


vincent kars

  • Sr. Member
  • ****
  • Posts: 445
Are you gonna list hundreds of composer names in virtual tag like that? You're not serious.
[/quote]
I'm always serious

Depends how strict one wants to be.
If one wants to have the last name except when there is a duplicate, this cannot be solved with the expressions except by hard coding them.
You can do it in SQL but this requires an interface to the DB.

But I agree, a expression is more elegant e.g.
$Split(<Composer>,",",1) $Left($Split($Split(<Composer>,"(",1)">"," ",2),1)$Left($Split($Split(<Composer>,"(",1)," ",3),1)$Left($Split($Split(<Composer>,"(",1)," ",4),1)$Left($Split($Split(<Composer>,"(",1)," ",5),1)

will do the job at the expense of adding the initials in all cases

vincent kars

  • Sr. Member
  • ****
  • Posts: 445
Alternatively, it might make more sense to use the Composer field for what you actually want displayed (e.g. "Bach CPE") and use a custom tag or even the comment tag for their full details ("Bach, Carl Philipp Emanuel (1714-1788)").

I like to have the year as it is a good indication of what to expect (baroque, classical, modern).
I use it as a kind of pseudo genre tag.

But indeed to break up in a couple of virtual tags e.g. ComposerShort, PerformerShort is a good suggestion.
Will give it a shot.

Diederik

  • Jr. Member
  • **
  • Posts: 31
+1 for the formula editing pop-up window

In your specific case, you might want to use the <display composer> tag. When editing the Composer field, you can assign both a <composer> and a <display composer> tag value, just like you can for the Artist field.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34351
i've added a popup editor for editing templates. Although it is multi-line editing, it doesnt remember any multiple lines you might insert ie. the template is always saved back as a single line. Also the word wrapping in the windows text box control isnt that fantastic but i still think overall the popup editor is an improvement
Its in the next v2.5 update


redwing

  • Guest
This is a great improvement. Thanks! Can you consider the following requests as well?

- Can you add zoom in & out (+, -) buttons to the editor, or just make the fonts a little bigger only in editor?
- If the above is implemented, can you make the text scrollable with scroll bar just like the field/function selector?
- Currently opening virtual tags editing pane is a pain, requiring at least three clicks (Preferences> Tags (1)> Define new tags). How about adding the command to the context menu of the main panel header?

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Yes, this is a great improvement!  Thanks!
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)