New release - 20111206 - track number padding and acoustic fingerprinting

Padding

There are two main new features in this release. The first offers control over how zero padding is used in track filenames. The second uses acoustic fingerprinting technology to identify music when finding cover art, genre or year information.

Zero padding in file names

Zero padding is the addition of leading zeros to track numbers, in this case applied to file names. Why is this needed? Consider the following three files:

1-Devils Haircut.flac
2-Hotwax.flac
10-Sissyneck.flac

Now, in any sane human's head the ordering of files would be as above: 1, 2, then 10. This is called natural ordering. The trouble is, computers aren't sane, and instead they often impose an ordering based on the character codes for the strings. In this case:

1-Devils Haircut.flac
10-Sissyneck.flac
2-Hotwax.flac

This is because the first character of 10-Sissyneck.flac is considered before the first character of 2-Hotwax.flac.

The workaround is to pad our string with zeros, as follows:

01-Devils Haircut.flac
02-Hotwax.flac
10-Sissyneck.flac

By forcing the number of digits for each track number, we can assure that each order of magnitude in the number is compared like with like. Therefore, 0s are ordered before 1s.

So how does this apply to bliss, and this release? Well, before, bliss would pad track numbers according to the highest numbered track in the album. For instance, if the highest numbered track was track 15, bliss would pad tracks 1-9 with one zero. In this new release, and as requested, you can now control the track number padding. Here's how the <tracknumber> token is now used in file organisation patterns:

Token Use
<tracknumber> The track number as-is in tags
<tracknumber:nn> The track number, minimum two digits
<tracknumber:nn> The track number, minimum three digits (and so on for any number of ns)
<tracknumber:auto> The track number, leading zeros dependent on size of album

Note that the default behaviour of <tracknumber> changes from automatic padding to raw, as-is representation. When you run bliss for the first time with the new code your <tracknumber> will be automatically converted to <tracknumber:auto>

Acoustic fingerprinting

This release also contains the first batch of code surrounding bliss's mooted support for untagged music files. The enabling technology for this is acoustic fingerprinting, a way of representing a piece of music in a short summary. This fingerprint can then be looked up online and the discovered data used for tagging your music library.

There are two broad uses for this. The first, as introduced above, is with untagged music files. The second is in providing corrections for already tagged files. For now, I have introduced the technology into bliss's existing MusicBrainz queries for cover art, year and genre data. They are generally super-accurate and should, with time, provide higher match rates for missing information.

Other stuff:

  • I fixed some error messages displayed when cover art is corrupt
  • Any errors when parsing file organisation patterns are now caught and displayed
  • When albums are deferred from assessment the icon in the activity page changes to a completed one

Get the new release from the downloads page. Existing fixes apply, of course!

Thanks to mpcevat for the image above.
tags: release

The Music Library Management blog

Dan Gravell

I'm Dan, the founder and programmer of bliss. I write bliss to solve my own problems with my digital music collection.