Or, using Foobar2000 with the Now Playing Simple extension to output well-formatted and consistently "now playing" text in an environment where you have VA, tagless and numerous album artist/track artist permutations
I use the sublime foobar2000 (fb2k) player on Windows for so many reasons. I also output the currently playing track to a text file for reasons beyond the scope of this article, but I've found it's useful to standardise the output while handling a wide variety of source file metadata scenarios:
- Total lack of metadata (untagged files)
- Track artist and title only
- More complete metadata, but no album artist
- More complete metadata, with an Album Artist of Various Artists or Various
- an Album Artist which is the artist name, with some tracks from an album with different Track Artist metadata
All in all this makes for a slightly complex setup. I also have some requirements to not just print "Various Artists" or "Various", I prefer to see "VA" but I don't want to retag all my source files.
Fortunately fb2k has a very flexible tagging system with plenty of logical operators. And Skipyrich's "Now Playing Simple" extension for fb2k does just the job, outputting to a text file in "log" mode. This is what I devised:
$if(%isplaying%, $if(%ispaused%, , ) $if($or($stricmp(%album artist%,Various),$stricmp(%album artist%,Various Artists)) ,,) $if(%artist%,%artist% - ,) %title% $if($or($stricmp(%album artist%,Various),$stricmp(%album artist%,Various Artists)) ,,) $if( $or( %album%,%discnumber%,%tracknumber%,%catalogid%),'[', ) $if($stricmp(%artist%,%album artist%),[%album%', '], $if( $or($stricmp(%album artist%,Various),$stricmp(%album artist%,Various Artists)), VA '//',%album artist% '//') %album%', ') [ Disc %discnumber%, ][Track %tracknumber%][, %catalogid%] $if( $or( %album%,%discnumber%,%tracknumber%,%catalogid%),']', ) $crlf(), )
I've found this outputs a standardised result which looks like this:
- internet radio stream which only ever presents track artist and title:
"The Boxer Rebellion - Diamonds"
- A track with full metadata:
"The Upbeats feat. Sylvee - Divide [The Upbeats // Not Forever, Track 8/13, VSN088]"
- A track with full metadata and a non-"various artists" album artist:
"Noisia & Phace - Purpose (Buunshin Remix) [Noisia // The Resonance I, Track 6/8, VSN089]"
- A track from a "Various artists" album:
"Abstract Elements - Curcuma [VA // Invisible 020 EP, Track 02, INVSB020]"
- For tracks with absolutely no metadata, it just passes fb2k's default assumption that the filename is the title:
"Fierce & Fresh - Brok"
"Commix - Be True (Synergy Bootleg)"
and so on.
There's a lot of nested ifs and ors in the above example, and it could probably be slightly neater. 3am brain has its own way of thinking. What the logic does is mostly:
- rewrite instances of "Various Artists" or "Various" to VA
- some conditional true/false checks for whether any extended metadata tags exist
- only output the 'literal' opener and closer square brackets if extended metadata exists
- Non-escaped square brackets are a foobar2000 way of saying 'only output the entire contents of these brackets if the metadata tag contained in it exists in the currently playing file'
- There's also some juggling of %artist%, %album artist% and %track artist% variables, because fb2k does some internal substitution - and I don't want to always print the album artist inside the outputted extended tag portion if the album artist matches the track artist.
Give the extension a try, tell me what you think and whether I could improve upon the formatting structure above.