The id3adder Euphoria program

Overview

The id3adder program adds ID3v2 tags to MP3 files. It is a command line utility written in Euphoria.

When the program is run one or more directories are specified as command line arguments. The id3adder program then searches the directories and recurses down the directory structure. When the program finds a MP3 file it writes ID3v2 tags into it. The ID3v2 tags written are artist name, song title and, optionally, track number.

The artist name, song title and track number are derived from the name of the MP3 file. For this reason the names of the MP3 files need to follow the "id3adder MP3 naming standard" to ensure that sensible ID3v2 tags are added.

The id3adder program runs on the DOS, Windows and Linux versions of Euphoria. However, the value of running on a DOS platform is limited. For this reason DOS support for id3adder may be dropped in future versions.

Credits

The id3adder program contains two functions called:

  unlink_dos
  rename_dos

The code for these functions was taken directly (but without the long file name support features) from the DOS File Commands user contribution by Daniel Berstein on the Euphoria website:

  http://www.rapideuphoria.com/

Click on the link for "The Archive". Enter "rename" for the search criteria. This should list "DOS File Commands, Daniel Berstein".

Many thanks Daniel.

References

The id3adder program could not have been written without technical information obtained from this website:

  http://www.id3.org/

Martin Nilsson has done a nice job here.

The id3adder MP3 file name "standard"

Here are some example MP3 file names which will produce acceptable results with id3adder:

  Jefferson Airplane - Somebody to love.mp3

  01 Oasis - Rock and Roll Star.mp3

  02 Farm, The - Stepping Stone.MP3

  #Cult - Fire Woman.mp3"

  07 #Blur - The Debt Collector.MP3

The extension must be either ".mp3" or ".MP3" for id3adder to find it.

The main part of the file name must have a space, hyphen, space separating the artist name from the song title. The artist name comes before the song title.

If the first two characters of the file name are digits and the third character is a space then the first two digits combine to form the track number. The track number is optional.

If the first character of the artist name is the hash (#) character (for example #Blur) then the hash (#) character will be ignored. Why is this? Well I have another program that interprets the presence (or absence) of this hash (#) character in another (but unrelated to ID3 tags) way.

Something to be aware of

When id3adder processes a MP3 file it throws away all previous (and I mean all - every last one of them) ID3 tags. The new tag written to the file will only contain the artist name, song title and an optional track number. Any information in previous fields supported by the ID3 standard will be lost.

For this reason I suggest the following:

(1) Before running id3adder take a backup of the MP3 files it will act upon.

(2) Copy a few MP3 files into a temporary directory and do a trial run of id3adder on just that temporary directory to get a feel for what id3adder does and does not do.

Running id3adder

From a command prompt type one of:

  exw id3adder.ex directory_name

  exu id3adder.ex directory_name

  ex id3adder.ex directory_name

where directory_name is the name of the directory that contains MP3 files. For example on a system running Windows which has MP3 files in the c:\mp3 directory type:

  exw id3adder.ex c:\mp3

For each MP3 file found appropriate ID3v2 tags are added to it.

NOTE: when using a system running Windows the id3adder program will display the following prompt when it has completed:

  Press any key to exit ...

Just press a key to have the window close.

It is possible to specify more that one directory - for example:

  exw id3adder.ex c:\mp3_singles c:\mp3_albums

If a directory name contains spaces then use the quote (") character. For example:

  exw id3adder.ex "c:\my mp3 files"

will work as expected.

Removing ID3 tags

The id3adder program can be used to remove ID3 tags by using the "/none" command line switch. Type one of:

  exw id3adder.ex /none directory_name

  exu id3adder.ex /none directory_name

  ex id3adder.ex /none directory_name

This will have the effect of removing all ID3 tag information. Use with caution!!!

Bugs?

Although the id3adder program can be run under DOS it will be of limited use because file names are limited to 8 characters. Little or no useful information can be squeezed into such a short file name.

Please report bugs via the Rapid Euphoria website.

Other Stuff

As with any "free" software it comes "as is". Use at your own risk.

Other than that I hope you find it useful!


Last updated 31 October 2007