arbeat - A console tool to add BPM tags to mp3 files

Summary

Arbeat is a console tool to add BPM tags to mp3 files. If mpg321 is installed, the song can be played in the background while the user taps the keyboard to determine the tempo.

Details

The ID3v2 mp3 tag standard defined the "TBPM" tag which allows mp3 audio files to be tagged with the music's tempo (beats per minute) to allow software to filter and sort music by tempo and to allow users to more easily identify their music. However, to make use of these features, the ability to determine tempos and record tempo tags for a large collections of audio files is necessary. Currently existing tools do not completely provide this ability: programs that determine tempo often do not allow that ability to save the tempo information, or save it only in an application-specific database; programs that are able to save tempo tags commonly ignore the simple feature of allowing the user to specify or tap out the tempo instead focusing on complicated features such as beat mixing or automated tempo analysis. Also, and many of these tools are Windows-only or are integrated with a specific music manager or playlist application.

The goals of this projects are as follows:

The arbeat tool has already been implemented in a basic working form, though additional error checking and certain basic features need to be added. The current implementation depends on mpg321 and id3lib (both GPL projects). Much of the initial code is derived from PhatBeat (also GPL). The current implementation is is as follows: The user provides the arbeat program with the name of an mp3 file via the command line. An mpg321 process is forked in the background to play the audio file. The user is asked to tap the return key to determine the tempo while listening to the music. After 16 beats have been tapped, the BPM is calculated, and the id3lib API is used to record the tempo as a TBPM tag in the mp3 file. The mpg321 background process is then killed and the arbeat progam exits.

Future work will involve adding complete error handling, adding support for other audio files (specifically, ogg vorbis and flac, and possibly m4a and asf), applying statistical analysis to minimize the amount of error in determining the tempo, and adding command-line options to support processing large sets of files and to support importing and exporting external databases of tempo information. Possible further directions might include incorporating automatic bpm detection algorithms (probably via external libraries) and adding support for similar non-tempo tags (such as user ratings and "mood" or frequency analysis).

Thank you for examining this project.