Music collection/playing notes

From Helpful
Jump to: navigation, search



This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

ID3, ID3v2

MP3s originally had ID3 (now called ID3v1)

Used on: MP3
a fixed-length 128-byte
mostly spent on artist, album, title, and comment, each 30 bytes some obvious problems for long names
stored at end of file

ID3v2 was designed to overcome ID3's initial limitations

Used on: MP3
There are two major revisions of it.
2.4 has a few more features
2.3 is more widely supported
Some players are happy with both. Others (e.g. windows media player, windows phone) doesn't understand some tags, that's probably because for the longest time they didn't support or didn't handle it correctly (e.g old iTunes versions).
In general these issues are with 2.4 [1] and you'll have less trouble after converting everything to 2.3
Stored at front of file (meaning sometimes slower to alter. Adding some padding up front tends to )

Arbitrary tags will typically go to TXXX (basically a 'use defined' miscellaneous text field)

Vorbis comments

Used on: Ogg, FLAC
Arbitrary key-value.
Value is always a list, just usually a length-1 list.

APE tags

Used on: APE, Musepack, wavpack, MP3
APEv1 is mainly used on APE files and rarely elsewhere
the APEv2 iteration is used on MP3, Musepack, wavpack, OptimFROG
arbitrary key-value
Not everything understands it. Things that understand it may still be confused if you add both ID3v2 and APEv2
Supported by:
Players: foobar, winamp, a few others
libraries: mutagen (v2 only)(verify)
Stored at end of file

On unified tag access

mutagen notes




Because songs don't have the same volume out of the box. It's often not hugely different, but sometimes it is and you need to run too your volume dial.

Replay-gaining of digital music tags/adjust files so that all your music plays at roughly the same volume level.

Even if there were a standard that everyone kept to (there isn't really), there are other reasons for variation. For example, classical music may well have long subtle bits and occasional loudness, and acoustic playing tends to have a lot more loudness variation.

Additionally, there is dynamic compression (see loudness wars), which amounts to different music types from different eras sounding a little louder even on the same medium.

Approximately the same volume, because songs and styles that have a lot of difference over time beg the question what you really want to happen, (If going by averages, that will still sound quieter than a relatively constant-volume rock song played after it) and the mentioned dynamic range compression messes with the perception of loudness.

There are programs to do this for you. They adjust towards a given level , and depending on the file type in question may either

  • tag the file to note the adjustment necessary
your player will have to support this too
  • or alter the file to play at that level (this is fairly simply in MP3 without re-encoding: a frame's gain is a field you can easily pick out and alter without any other decoding).

There is also a difference between:

  • per-album replay-gaining calculates the average volume of an album and applies the same adjustment for all tracks
useful to have it be seamless between songs on that album
  • per-track replay-gaining calculates and alters gain for each individually
better consistency of volume between arbitrary songs. Slight jump within the same album.

In a lot of cases the jumps within an album aren't very noticeable (because most albums are mastered similarly, and have silence inbetween) though you may care when songs flow directly into each other.

More technically

For a longer list, see [2]



On linux

The following does track gain (and forgets album consistency).

I have

  • mp3
    • install mp3gain
    • run
      nice -n 19 ionice -c3 find /data/Music -iname '*.mp3' -exec mp3gain -r -k \{\} \;
      (probably via cron)
-r means track gain,
-k means lowering the target volume if the default means it will clip somewhere. (no distortion is more important to me than exactly the same volume)
  • ogg
    • install vorbisgain.
    • run
      nice -n 19 ionice -c3 find /data/Music -iname '*.ogg' -exec vorbisgain -f -s \{\} \;
-f means it will only calculate for files when a tag isn't present. (should be default behaviour, really)
-s makes it more robust when you accidentally hand a bad file to vorbis

The basic niceness is for non-aggressive CPU use, the ionice for non-aggressive disk use (if you don't have ionice, omit the ionice -c3). Both are optional.

Foobar2000 notes


I'm currently fond of Columns UI with the Genre/Artist/Album lists on top (fairly iTunes-style).


Grouping applies after sorting, and combines things with the same value into a section - by default, each artist+album combination becomes a section, which means you'll see albums as chunks (when sorting by album or artist)


  • When sorted as intended, this is visually understandable (and relatively minimal)
Note that depending on UI you also get the artwork column


  • Odd results when sorting by anything else.
  • When you sort via clicking on column headers, you basically need to do tracknumber, then album, then artist to get decent sorting (because stable sort)
I work around this by having one column displaying
%artist% - %album%
and sorting and grouping by something a little more complicated, to deal with Various Artists-style albums, see below
  • can lead to a lot of one-item pseudo-albums (in the case of selective live songs, cover, etc)
you may prefer grouping per artist. And/or the sorting mentioned in the previous point
(note that if you've auto-tagged things and have a lot of single-per-'nineties hits' or such, consider removing that album

Dealing with Various Artists albums

Albums by two or more artists make sorting by any one column do the not-so-intuitive thing.

Right now I have an "Artist - Album" column that

  • sorts by something like
$ifgreater($len(%album artist%),0,%album artist%,%artist%) %album% $ifgreater($len(%disc number%),0,%disc number%-%tracknumber%,1-%tracknumber%)
  • groups by:
$ifgreater($len(%album artist%),0,%album artist% - %album%,%artist% - %album%)
  • and displays:
%artist%  - %album% 

You still have to tag albums to have a value in "Album Artist" tag when it (often Various Artists on collection albums, sometimes something more specific).

Side note: foobar seems to treat "Album Artist" as a fallback of a few fields - when displaying only, not when testing??(verify))

Disc number

I wanted to show disc number cleanly, specifically

omitting it unless it's present and >1
zero-padding track numbers
...while not showing missing track numbers as ? or 00

I ended up with

$ifgreater(%totaldiscs%,1,%disc number% - $ifgreater(%track number%,0,$num(%track number%,2),),$ifgreater(%track number%,0,$num(%track number%,2),))


Autoplaylists are queries, that show their results live.

Previously mostly created configured via its own manager (or album list).

Since 0.9.5 they are instead created via the Library search window:
button → Create Autoplaylist. Once they exist you can still edit their search query further.

See the query syntax.


  • All music (exclude known non-music), according to your own genre/path organization, e.g.
NOT %genre% HAS spoken AND NOT %path% HAS MusicVideo

  • recently modified
%last_modified% DURING LAST 2 WEEKS

  • Stored locally (not on network), e.g.
%path% HAS "C:\" OR %path% HAS "D:\" 

  • useful stuff missing (note: no %, this is about the field, not the value from it)
title MISSING OR artist MISSING OR genre MISSING AND NOT %path% HAS MusicVideo

  • title, album, or artist missing (also the difficult way)
("$if($meta_test(title,album,artist),1,0)" IS 0)

  • artist name is all-uppercase
("$if($strstr(%artist%,$upper(%artist%)),1,0)" IS 1) 
you may want to add
AND (NOT %artist% MISSING )

See also

Multiple values, e.g. for genre split

You can use multiple values for a field, because foobar can be told to split values on specific strings.

For example, you can add multiple genres, which by default it seems to split genres on
, and newlines. You may want to add

Note that this does not mean it adds these characters to the tag literally, it means "foobar, figure out how to split it for the underlying tag".

For example

on ogg tags, multiple values are natively a thing, most fields just happen to have one for practical reasons
On ID3v2.4 a TCON tag can have multiple text entries (NUL separated)
On ID3v2.3 a TCON tag can have multiple only one text value (though multiple numeric entries in it)
so it seems in the last case, the effect of telling foobar to split only really carries to its own database(verify)

For the same reason, adding
with another tagging program will usually just tell it to add a literal
in a single text value - unless it has similar "hey this means you should actually split it" logic. When you read
from other things that have added them literally, the easiest fix is often to have foobar actually split the tags again:
  • use tag editor for these files ('Properties')
  • right-click on the Genre field, select 'Split values...', and OK the window that opens
  • OKing the tag editor will now save the split values to tags

Playlist format


Useful extensions