A utility for tagging single album FLAC files with embedded CUE sheets using data from the MusicBrainz service.

1. Downloading

The latest version of flactag can always be found here.

The current version is v1.0-RC2.

2. Requirements

3. Building and Installing

Before installing, edit the INSTALLPATH directory in the Makefile to specify the install location. Binaries and scripts will be placed in a bin directory under this path.

To build the software, simply run make in the directory you have extracted the archive into. The build process should complete with no errors. You will be left with the following executables:

To install the software and associated scripts, simply run make install. This step will need to be run as root if the install is being done outside of the user's home directory.

4. Ripping CDs to FLAC

IMPORTANT: I think I found a bug in cueconvert which means that any FLAC files generated from CDs that used INDEX marks to separate tracks that didn't have any pre-gap would generate invalid disc IDs. I would urge you to use the checkflac.sh script provided to compare any disks you may have ripped with their FLAC files to ensure that the discids match correctly. Included in this release is a SED script which will massage the TOC file of a CD to work around this problem. Unfortunately, the only way to recover from this is to re-rip the CD

To rip a CD to flac, simply enter ripflac.sh <filename> (where filename is used as the base name of the FLAC file you will be creating. The CD in the drive will be ripped, and a FLAC file created containing an embedded CUE sheet.

If the original CD contains data tracks, then the FLAC conversion will fail. Should this happen, enter ripdataflac.sh <filename> <range> (where filename is the same one specified in the first rip attempt, and range is the range of tracks to rip (e.g. if the CD has 13 tracks, where track 13 is the data track, then the range would be 1-12).

During the ripping of the data CD, you will be provided with the CUE sheet in an editor. You should delete the data track from this CUE sheet file and save it (I will try to automate this process at some point).

Both these scripts will compare the calculated discid of the FLAC file with the discid of the CD in the drive. If they do not match, a warning will be issued.

5. Using flactag

5.1. Interactive mode

flactac should be executed from a linux console prompt, giving the path to the FLAC files to tag as its arguments as follows:

flactag victory.flac absent.flac

(filenames can be quoted if they contain special characters to avoid having to 'escape' these characters).

If the flactag utility does not find information for your CD, a URL will be provided to submit information for it. Often the MusicBrainz server will have information about the tracks and artist, but cannot match this up to your CD. In these circumstances, it is simply a matter of 'associating' your CD's DiskID with the correct album data on the MusicBrainz server. In other instances, you may be required to enter the track and album information into the MusicBrainz service. Once you have entered this information, you can re-run flactag, and the data should be downloaded from the MusicBrainz server.

If the flactag utility finds information for your CD at the musicbrainz server, the application's main window will be shown.

flactag interactive mode

This contains three main areas:

The currently active window will be highlighted by the border and window title changing colour. To switch between the three windows, press the TAB key. To scroll around the active window, use the cursor UP and cursor DOWN keys (to scroll one line at a time) or the PAGE UP and PAGE DOWN keys (to scroll half a page at a time). Scrolling in the 'Albums' window will update the information in the 'Tracks' window appropriately.

Once the appropriate album has been selected, pressing c will copy the tags for that album into the Tags window. These tags can then be saved to the FLAC file by pressing the w key.

Pressing r will rename the file based on the settings in the configuration file (~/.flactag - this file is created automatically the first time you run flactag). Note that this facility uses the tags that are actually written to the file, so should generally be performed after the new tags have been written. This option will be unavailable if the filename and location are already correct.

Pressing q will move to the next file specified on the command line. If all files have been processed, the application will exit.

5.2. Batch mode

Alternatively, flactag can be used in batch mode to automatically check tags, write them and rename the file. Care should be taken when using these options.

The following command line options are understood:

Example uses of these options could be as follows (note the use of the find option '-print0' and the xargs option '-0' to handle filenames containing spaces):

5.2.1. Report on the tags of all FLAC files

find /var/spool/music -name "*.flac" -print0 | xargs -0 flactag —check

5.2.2. Tag and rename all flac files

find /var/spool/music -name "*.flac" -print0 | xargs -0 flactag —write —rename —force-multi

6. File Renaming Details

The following configuration file (~/.flactag) entries affect file renaming:

The FileName templates can accept the following parameters:

If any item is used but does not have a value, then it will be stored as (for example) NOGENRE (if the genre tag is empty).

7. Bugs / Limitations / Future Enhancements

8. Problems / Suggestions

If you have any problems with the software, or suggestions for improvements or new features, then please use the Bug Tracking System to report them.

There are two mailing lists for discussion and announcements, which would be a good place to start for any questions. These lists are gated via GMane as gmane.comp.audio.flactag.announce and gmane.comp.audio.flactag.discuss respectively.

9. Version History

9.1. v1.0RC2 - 10th January 2007

9.2. v1.0-RC1 - 12th October 2006

9.3. v0.04 - 23rd September 2006

9.4. v0.03 - 18th September 2006

9.5. v0.02 - 18th September 2006

9.6. v0.01 - 16th September 2006