Help - Search - Members - Calendar
Full Version: Foobar2000 format strings
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
Max
QUOTE(upNorth @ Jun 28 2003 - 04:55 PM)
QUOTE(Max @ Jun 29 2003 - 02:26 AM)
A new Question

Is it possible: If Artist = Album then write album: Selftitled???

If you put this where you want the album info, it should do the job.
CODE
$if($strcmp($lower(%album%),$lower(%artist%)),Selftitled,%album%)

This will put 'Selftitled' if they are the same and the name of the album if they are not.

I included the lower() in case the case is not the same for album and artist.
If it is you could get away with
CODE
$if($strcmp(%album%,%artist%),Selftitled,%album%)

Thx again wink.gif
addicted
@upNorth:

Was there a way to break the album name into two or threee lines as necessary to keep the playlist all nicely lined up? (and did I miss the posting of a font that worked with special characters like the ones I'm not getting in this screenshot?)

Screenie

TIA
upNorth
QUOTE(addicted @ Jun 30 2003 - 04:19 PM)
@upNorth:

Was there a way to break the album name into two or threee lines as necessary to keep the playlist all nicely lined up? (and did I miss the posting of a font that worked with special characters like the ones I'm not getting in this screenshot?)

Screenie

TIA

Sorry, no 'word wrap' feature, but the ability to do a simple cut. Someone (sthayashi?) asked about this some time ago, to get all the tracknumbers in a straight line.
My playlist font is 'Lucida Console'. There has been posted a link to 'Lucida Console ANSI' a few page back, but I don't use it as it doesn't support norwegian characters.

Btw: Isn't 'Lucida Console' a standard windows font?
Bushwack
QUOTE(addicted @ Jun 30 2003 - 06:19 AM)
Was there a way to break the album name into two or threee lines as necessary to keep the playlist all nicely lined up?

I haven't played with string formatting for sometime now, nor have a looked at upNorth's code, but this is possible.

It's just a matter of cutting off the albums name on the first line, and adding a second conditional to the second line code to check if the album name overflowed then display the rest of the album name or whatever goes on the second line accordingly. Of course you now have to continue this process of looking back at the album name trough all the lines and add some more track number checks, messey but straight forward.
addicted
Yeah, I'm using Lucinda Console ANSI, if I use the non-ANSI Lucinda Console, I get the weird As. I thought I remembered seeing someone post a font (Lime?) that adressed all the issues of special characters.

As far as editing the format string myself, I have to admit that I am just riding on the coattails of you format-string-editing-type-guys here as I don't have the foggiest idea where to start with them. I quit "programming" when I got rid of my Commodore64. Basic for life! Sweet sweet sprites and endless lines of "DATA 10,256,256,10......." laugh.gif

But if anyone feels they'd like to play around with the format string, I'm sure I wouldn't be the only thankful one.


Thanks for the replies.
-addicted
anza
JanS's formatting has this "word wrap" feature, and IIRC it was based on upNorth's original code. You can find it a few pages back (or you _should_ find it. Searching this thread ist DEATH).
Luxus
i think i will setup a wiki so everyone can post his code

anyone like the idea?
AndrewCottrell
Here's my playlist code. I have more albums than singles, so this is optimised for albums--but it works ok with singles.

It uses default colors and whatever font you like. Many colors are used to help me 'scan' the playlist. The colors look ok when a track is selected.

I normally keep foorbar minimised, but when open I like to see tons of details. I've used the VARIOUS tag to determine albums by various artists; and a WEBSITE tag which is self explainatory.

CODE
// initialize global variables
$puts(artist,800000$if2(%artist%,'['Unknown Artist']') - )

$puts(album,[000080$if2($abbr(%album%,100),'['%_directoryname%']')
[808080 '('$left(%__replaygain_album_gain%,$sub($strchr(%__replaygain_album_gain%,.),1)) dB')'] - ])

$puts(tracknumber,[404000$num(%tracknumber%,2) - ])

$puts(ext,$caps($ext(%_filename_ext%)))

// playlist number
808080$num(%_playlist_number%,4) 

// display artist, album and tracknumber (rearranged for various)
$if(%various%,$get(album)$get(tracknumber)$get(artist),$get(artist)$get(album)$get(tracknumber))

// now take care of the track title
008000$if2(%title%,%_filename%)

// now some meta-data: bitrate, codec, Replaygain and length
808080 '('%__bitrate%Kbps $get(ext) $if($stricmp($get(ext),%__codec%),,%__codec%)
[, $left(%__replaygain_track_gain%,$sub($strchr(%__replaygain_track_gain%,.),1)) dB]
, %_length%')'

// does this track have a website?
[ - FF6666%website%]

// any comments?
[$if($strcmp(%comment%,%website%),, - 404040%comment%)]


@upNorth

You could use the non-case-sensitive version of $strcmp(x,y)
CODE
$if($stricmp(%album%,%artist%),Selftitled,%album%)
Bizzy D.
http://www.skin-zone.net/fb2k.png <<<its upNorth's code... i was just wondering what those numbers under the OGG mean ???
nuhi
Well, probably quality.....bitrate
I'm sleepy to verify this from the code, don't have it by me.
upNorth
QUOTE(AndrewCottrell @ Jul 4 2003, 11:08 PM)
@upNorth

You could use the non-case-sensitive version of $strcmp(x,y)
CODE
$if($stricmp(%album%,%artist%),Selftitled,%album%)

Thanks, I did not see that one smile.gif


@Bizzy D.: nuhi is right, it's the bitrate (but only for track 3). The technical info had no other usable info for ogg...
amppa
Ok, didn't see anyone creating a formatting strings site so I am making one. PHP+mysql, user accounts so codes can be added and edited easily and so on.

I'll post a link when the basic features are done.

--

Ok, I think the basics are done and working well. I used the style AlfredSka created, thank you Ska. All you are welcome to try the site, create accounts and add your formatting strings. Started the project today so I would not be surprised if bugs are found smile.gif Just report them all (the feedback form might be the best way to reach me). And if some useful features are missing, report them, too. Furthermore, suggestions to page appearance improvement are also welcome.

All styles will now be shown in one list, I'll add a next/prev -functionality soon.

The current server is located in Finland, please tell if the connection is too slow. Site address isn't yet optimal, either smile.gif But, well, I guess this is much better than nothing.

--

Managed to get a bit shorter address. Now it's

http://pelit.koillismaa.fi/fb2k/
Luxus
wow great site ...
i like it a lot
i set up a perm redict
http://fb.blogout.de
its a lot shorter and i hope better to remember
Zastai
Well, I'll just add mine - very straightforward and spartan:

CODE

808080$num(%_playlist_number%,5).  $if(%title%,%title%,%_filename_ext%)[ 606060'('%date%')'] *TAB**TAB*%artist%*TAB**TAB**TAB*606060%genre%*TAB*%_length%


(*TAB* = a TAB character)

The tab characters provide me with pretty decent columns even though I use a proportional font (Lucida Sans Unicode, which seems to display everything just fine and dandy).
Colors are very basic atm, just black and greys, with black as the selected line background, and a very light pastel yellow as normal background.

Title bar is a simple '[' foobar version ']' Artist / Title; tooltip is simply Artist - Title.
Status bar is very simple as well:

CODE

$if(%artist%%title,%artist% - %title%,%_filename_ext%)[ '('[%album% - ]%date%')']*TAB*%_time_elapsed% / %_time_total%
anza
QUOTE(Zastai @ Jul 6 2003, 01:05 PM)
Well, I'll just add mine - very straightforward and spartan:

CODE

808080$num(%_playlist_number%,5).  $if(%title%,%title%,%_filename_ext%)[ 606060'('%date%')'] *TAB**TAB*%artist%*TAB**TAB**TAB*606060%genre%*TAB*%_length%


(*TAB* = a TAB character)

The tab characters provide me with pretty decent columns even though I use a proportional font (Lucida Sans Unicode, which seems to display everything just fine and dandy).
Colors are very basic atm, just black and greys, with black as the selected line background, and a very light pastel yellow as normal background.

Title bar is a simple '[' foobar version ']' Artist / Title; tooltip is simply Artist - Title.
Status bar is very simple as well:

CODE

$if(%artist%%title,%artist% - %title%,%_filename_ext%)[ '('[%album% - ]%date%')']*TAB*%_time_elapsed% / %_time_total%

You can also use $char(9) to get the tab. And so you don't have to have it typed many times, you can use $repeat($char(9),3) where number 3 is the amount how many times it's repeated. This would make your code like this:
CODE

808080$num(%_playlist_number%,5).  $if(%title%,%title%,%_filename_ext%)[ 606060'('%date%')']$repeat($char(9),2)%artist%$repeat($char(9),3)606060%genre%$char(9)%_length%


Doesn't make the code shorter, but IMHO it's nicer this way smile.gif
anza
My updated formatting string:
http://koti.mbnet.fi/antsau/foobar/pic/fb2k.png

Download (includes fonts used):
http://koti.mbnet.fi/antsau/foobar/formatt...tting_green.zip

Needs 0.7 beta to work, because it uses $if3. Of course you can change those $if3(x,y,z)'s to something like $if2(x,$if2(y,z)) etc.
If artist and album are the same it changes the album title to "Self-Titled" (even though I myself don't use it, I only included it in the code and in the screenshot tongue.gif)
Read notes_green.fb2k for all information on needed tags etc, it should be up-to-date wink.gif

fb2k files are just plain text files, the extension is just for TextPad smile.gif

I think that's all, enjoy it! smile.gif
12345
QUOTE(SafirXP @ Jun 26 2003, 04:29 PM)
http://www32.brinkster.com/safirjamil/foobar2.htm just made this one... hope u guys like it! B)

Yes I like it. Can i get the code?
Jaro
@ amppa
I have question marks in foobar2000 0.7b12
here
Why?
Next problem - ID3v2, does not display like MPC.
I put ID3v2 tag support 1.0 compiled for beta12.
amppa
QUOTE(Jaro @ Jul 6 2003, 05:16 PM)
@ amppa
I have question marks in foobar2000 0.7b12
Why?
Next problem - ID3v2, does not display like MPC.
I put ID3v2 tag support 1.0 compiled for beta12.

The first question mark is year tag (%year%), the second one is genre tag (%genre%). If tracks do not have those, they can't be shown tongue.gif You are also missing bitrate info. Use $puts(brate,%__bitrate%) to add it, as I have told in playlist code (line 28). (Now edited the code to have it as default setting.)

Didn't understand your second question huh.gif
Jaro
QUOTE(amppa @ Jul 6 2003, 05:39 PM)
Didn't understand your second question  huh.gif

I have MP3 files only with ID3v2 tags, and they don't display like MPC or APE, FLAC with CUE files.
look
amppa
QUOTE(Jaro @ Jul 6 2003, 06:05 PM)
QUOTE(amppa @ Jul 6 2003, 05:39 PM)
Didn't understand your second question  huh.gif

I have MP3 files only with ID3v2 tags, and they don't display like MPC or APE, FLAC with CUE files.

Maybe the 0.7b12 does not contain id3v2 reader? Works fine with 0.667, no matter if id3v1 tags are present or not.
Binger
Hi!

Can someone tell me how to get to that TAGZ library? I once had a link to a .txt file but it's dead since a couple of weeks an I didn't save it on my harddrive.

thnx very much!
Binger
Jaro
@ amppa
next question smile.gif
If i have soundtrack, and as we know in that type of albums we have different artists.
Is it possible to change artist in playlist formatting according from artist that we now playing?
amppa
QUOTE(Jaro @ Jul 7 2003, 12:00 PM)
@ amppa
next question smile.gif
If i have soundtrack, and as we know in that type of albums we have different artists.
Is it possible to change artist in playlist formatting according from artist that we now playing?

Modified the code to handle "various artists" albums (the album directory name has to begin with "VA" or "Various Artists", case sensitive).

http://pelit.koillismaa.fi/fb2k/strings.php?f=4
Jaro
QUOTE(amppa @ Jul 7 2003, 04:54 PM)
Modified the code to handle "various artists" albums (the album directory name has to begin with "VA" or "Various Artists", case sensitive).

http://pelit.koillismaa.fi/fb2k/strings.php?f=4

@ amppa

But how to read folder like:
8 mile - various artists
or
heat - various artists
???
when va is on second position, after -
amppa
QUOTE(Jaro @ Jul 7 2003, 10:39 PM)
But how to read folder like:
8 mile - various artists
or
heat - various artists
???
when va is on second position, after -

You know, artist should always be before album name, rename your directories tongue.gif
You may of course try to code it if renaming directories is not acceptable. It's fun, rewarding and not even too hard.
Jaro
QUOTE(amppa @ Jul 8 2003, 03:14 AM)
You may of course try to code it if renaming directories is not acceptable. It's fun, rewarding and not even too hard.

Can You help me? This is last thing i wish in Your playlist code.
I have my collection on cd's and i don't want to re-burn it all.
Case
I'd suggest tagging your VA files with "Album Artist=VA" and making scripts use that. More generic solution than searching for specific strings in directory names and same tag can be used to tell proper artist with rare cases like this.
amppa
QUOTE(Jaro @ Jul 8 2003, 06:14 PM)
Can You help me? This is last thing i wish in Your playlist code.
I have my collection on cd's and i don't want to re-burn it all.

Sorry, can't help you with this one, don't have time for such :/ I needed that basic VA recognition myself, that's actually why I coded it in the first place. Good luck with learning the basics of format strings wink.gif

QUOTE
I'd suggest tagging your VA files with "Album Artist=VA" and making scripts use that. More generic solution than searching for specific strings in directory names and same tag can be used to tell proper artist with rare cases like this.


That might be clever thing to do.. I'll try to remember this the next time I am in the mood of retagging files smile.gif
frod
CODE

$puts(foo,8 mile - various artists)

$if($strcmp($replace($substr($get(foo),$strchr($get(foo),'-'),$len($get(foo))),' ',),'-variousartists'),It''s a compilation,It''s not a compilation)
dice
This thread is cool, but it took me thirty minutes to look through the first six pages and to test out different designs. It would be cool if there could be a new thread for each version (as not all strings work with all versions) - this would also keep page numbers down and wouldn't have old strings.

Dunno just an idea.

Would also be cool if people could post a small screenshot in the post to see what it comes up as. smile.gif
dice
Some help with some schemes I am trying to modify...

CODE
$if(%_isplaying%,0080FF|0080FF$num(%_playlist_number%,3). $if(%artist%,$if(%title%,%artist%[ - '['[%album% - ][''%date% - ][$if(%tracknumber%,#$num(%tracknumber%,2),?) - ]$pad_right(%_length%,5)']'] - %title%,NO TAG - $pad_right(%_length%,5) - "%_filename_ext%"),NO TAG - $pad_right(%_length%,5) - "%_filename_ext%"),$num(%_playlist_number%,3). $if(%artist%,$if(%title%,FFFFFF%artist%[ - '['[%album% - ][''%date% - ][$if(%tracknumber%,#$num(%tracknumber%,2),?) - ]$pad_right(%_length%,5)']'] - FFFFFF%title%,NO TAG - $pad_right(%_length%,5) - FFFFFF"%_filename_ext%"),NO TAG - $pad_right(%_length%,5) - FFFFFF"%_filename_ext%"))


I want to get rid of the total number of MP3's running down the left hand side, and instead of the Album being in '['s, I would love if it was in '('s.
I wasn't sure how to delete the album date either. (I _did_ try deleting the [''%date% - ] tongue.gif)
Two more things...
I would like it if the track time was displayed at the end, after the song's name, in the same format as the album name (In black with brackets).
The only other minor thing is when you are playing a track, it is orange...

Thanks to anyone who wants to help. B)

/edit

I was having a look at this script, and wondered what the command for the diamonds was:
CODE
c47F5e|ffAA80$ifgreater($len(%artist%),20,$cut(%artist%,18)..,%artist%) • $ifgreater($len(%title%),55,$cut(%title%,53)..,%title%) c47F5e|ffAA80[$ifgreater($len(%album%),30,$cut(%album%,28)..,%album%)
]


Thanks!
upNorth
@dice: I found your code to be too messy to read (at least to me). I made a new one from scratch that does about the same, but in a way I find easier to read.

*no playlist numbers
*no date
*changed [ to (
*right aligned track time. (remove the $char(9) if you don't want that alignment and add '(' and ')' if you want it in brackets)
*changed playing color to blue (you did not say what color you wanted).
*Removed NO TAG and ?
*Added comments


CODE
// Set the color
$puts(color,$if(%_isplaying%,FFAA80|FFAA80,FFFFFF|FFFFFF))

// Get color
$get(color)

// Artist (show filename if no tag)
$if(%artist%,%artist%,%_filename%)

// Album
$if(%album%,' - ('%album%)

// Tracknumber
$if(%tracknumber%,' - #'$num(%tracknumber%,2)')',$if(%album%,')'))

// Title
$if(%title%,' - '%title%)

// Right align
$char(9)

// Get color
$get(color)

// Track time
$pad_right(%_length%,5)
dice
Thanks for trying - I know it is messy but it's not mine. smile.gif
greenirft
QUOTE(dice @ Jul 10 2003, 11:35 AM)
This thread is cool, but it took me thirty minutes to look through the first six pages and to test out different designs. It would be cool if there could be a new thread for each version (as not all strings work with all versions) - this would also keep page numbers down and wouldn't have old strings.

I think a better idea would be to have some kind of website in which one can create an account and upload their code and a screenshot for everyone to see. Then maybe a nifty voting system or something fun.

Someone had a similiar idea and did something about it, but it was never adapted. It sounds like a fun summer project to start on, maybe I will once I get my glasses back (and thus, using a computer doesn't give me a headache).

Edit: people posted the site which was the similiar idea I was thinking, I didn't know that it even still existed: http://pelit.koillismaa.fi/fb2k/
upNorth
foobar2000 formatting strings
amppa
QUOTE(greenirft @ Jul 10 2003, 11:47 PM)
I think a better idea would be to have some kind of website in which one can create an account and upload their code and a screenshot for everyone to see. Then maybe a nifty voting system or something fun.

Someone had a similiar idea and did something about it, but it was never adapted. It sounds like a fun summer project to start on, maybe I will once I get my glasses back (and thus, using a computer doesn't give me a headache).

Well, there is one. With uploading, screenshots and voting system. Still under one week old, though, and does not have too many strings (11 when writing this). People seem to be unwilling to post their string to the page, don't know why. I'm eager to hear if it has some major flaws or something.

http://pelit.koillismaa.fi/fb2k/

edit: heh, upNorth was faster
Mike Giacomelli
Wow thats nice! Do you have to be the owner to upload? if not I'll parse this thread and upload strings.
Geezer
Perhaps there isn't that many real variants after all, I just modified Up Norths code abit to suit me. Great page anyway, it will grow in time! And foobar2000 isn't that widespread.. yet. smile.gif
amppa
QUOTE(Mike Giacomelli @ Jul 11 2003, 12:56 AM)
Wow thats nice!  Do you have to be the owner to upload?  if not I'll parse this thread and upload strings.

You'll have to create an account there to upload strings. And I think it's better to enter only your own strings - this way the credit goes to whom it belongs.
Mike Giacomelli
I could credit the HA people when I upload then. I have no interest in taking credit, I do in establishing a way to browse these files that doesn't take all afternoon.
amppa
Sorry, didn't mean it to sound that charging unsure.gif But if the users enter the strings themselves, they have the ability to edit and delete the strings as they want and so on. IMHO, it just is better to let the creators decide themselves what to do with their own strings, even if it means greater inconvenience for the rest of us.
GodFinger
huh.gif
Anyone of you guys know a good playlist formatting-code, which is suitable for both albums and for single files also?
I mean, when you have tons and tons of miscellaneous files in the playlist, and you use album playlist formatting, you end up with a total mess.
Anyway, I would appreciate it...
upNorth
Your problem has been discussed before, but AFAIK there is no real solution to it. You can't have the best of both worlds, and the biggest problem is if you want one file to look good alone, as well as as a part of an album.

For the time being, I'm pretty satisfied with how my own formatting works for my use. How good it works for you and everyone else, depends on how much your tagging, naming and general usage resembles mine.


These are some of the things I use in my code to make it more dynamic:
  • All single files gets the singletrack tag. This forces the display of artist and title even if a tracknumber tag is present.
  • Do one of the following to make Various artist albums display correctly.
    -Add a various tag (I give it the value 'yes')
    -Add a performer tag (don't use this anymore, but it is present in the code)
    -Add a album artist tag for DJ compilations
    -Start the name of the directory with 'VA - ' (the easy solution)
  • Option to switch between album- and single mode by setting a variable at the top of the code.
A strict naming- and tagging scheme makes it alot easier to make it look good.


Btw: My latest code can be found at http://pelit.koillismaa.fi/fb2k/
Nitty
I'm having trouble with upNorth's format. It was fine before I updated it with whatever is on http://pelit.koillismaa.fi/fb2k/
I'm using the appropriate fonts...
screenshot
Jan S.
ehehe..I had the same problem when I uploaded my string... the website can't show/save? the unicode chars...


you need to replace etc.:
CODE
"& #9500" with "$char(9500)"


space after "&" is not there but otherwise it is converted to it's unicode char here.


edit: heh....THIS website convert the the string to unicode biggrin.gif
edit2: heh... shit..it does it even when I use [CODE ]
Luxus
hm very strange.. when i replace it display still dont display it right

now it show the $char(9500)
Jan S.
You need to remove the ' around them too.
amppa
Fixed the unicode bug, copy&paste from the site should work fine now. No need to post the codes again.
upNorth
***FIXED***
Concerning the Unicode character problem when using http://pelit.koillismaa.fi/fb2k/

I don't like the way my code looks when I change all the unicode characters to $char(xxxx). I think it makes the code less readable, both for myself and more important to people that wants to customize it to suit their taste/needs.
I hope there is something amppa can do to remedy this problem, but untill then it will be available here.

[edit]
faster than the speed of light smile.gif
[/edit][COLOR=red]
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.