Adding MusicBrainz Support to jMusicMetaManager

18
Adding MusicBrainz Support to jMusicMetaManager Bruno Angeles McGill University – Schulich School of Music MUMT-621 Fall 2009 1/18

description

Bruno Angeles McGill University – Schulich School of Music MUMT-621 Fall 2009. Adding MusicBrainz Support to jMusicMetaManager. Outline. Introduction jMusicMetaManager and MusicBrainz Some Programming Definitions ID3v1 vs ID3v2 Changes From java_mp3 to jid3lib - PowerPoint PPT Presentation

Transcript of Adding MusicBrainz Support to jMusicMetaManager

Page 1: Adding MusicBrainz Support to jMusicMetaManager

Adding MusicBrainz Support to

jMusicMetaManager

Bruno Angeles

McGill University – Schulich School of Music

MUMT-621

Fall 2009

1/18

Page 2: Adding MusicBrainz Support to jMusicMetaManager

Outline

Introduction jMusicMetaManager and MusicBrainz Some Programming Definitions ID3v1 vs ID3v2

Changes From java_mp3 to jid3lib Code Sections of Interest

Finishing the Project Improvements //TODO: Current Issues

2/18

Page 3: Adding MusicBrainz Support to jMusicMetaManager

What is jMusicMetaManager?

[…] a tool for improving metadata associated with recordings by automatically detecting inconsistencies and redundancies.

(McKay et al. 2006)

3/18

Page 4: Adding MusicBrainz Support to jMusicMetaManager

What is MusicBrainz?

MusicBrainz is a user-maintained community music metadatabase.

http://musicbrainz.org/doc/AboutMusicBrainz

4/18

Page 5: Adding MusicBrainz Support to jMusicMetaManager

Some Programming Definitions

Object-Oriented ProgrammingProgramming paradigmObjects & Classes: Shapes example

GUIGraphical User Interface

StringSequence of characters

Hash tableArray of values accessed with a key

5/18

Page 6: Adding MusicBrainz Support to jMusicMetaManager

ID3v1 vs ID3v2

ID3v1 30 bytes max per field Metadata is at the end of the file ID3v1.1: add 60 bytes to title, artist, album (ID3v1.2: comment 3043 bytes)

ID3v2 Use Frames (hash table) of max total size 256MB! Internationalization: different character sets Metadata is at the start of the file streaming ID3v2.1, ID3v2.2, ID3v2.3 ID3v2.4: not widely supported

6/18

Page 7: Adding MusicBrainz Support to jMusicMetaManager

From java_mp3 to jid3lib

java_mp3 (even the latest release 0.4 December 2008) supports ID3v1 but only ID3v2.0 (i.e., revision 0)

jid3lib supports: ID3v1.0 and ID3v1.1 ID3v2.0 to 4

Other JAVA libraries for ID3 tags: jaudiotagger, Entagged , AudioTT, Axone , ID3v2 Audio Text Tools, ID3v2 Chapter Tool, Jaikoz, etc.

7/18

Page 8: Adding MusicBrainz Support to jMusicMetaManager

Code Sections of Interest

ID3 library change Metadata abstraction Class RecordingMetaData:

public RecordingMetaData(File mp3_file)

Reporting choices Class AnalysisPreferences

handle GUI selections

Report generation Class AnalysisProcessor

new method reportMusicBrainz()

MusicBrainz querying Class MusicBrainzProcessor

GUI8/18

Page 9: Adding MusicBrainz Support to jMusicMetaManager

MusicBrainzProcessor Class

9/18

jMusicMetaManager

+MusicBrainzProcessor()() : void+GetArtists()() : string+GetReleases()() : string+GetTracks()() : <unspecified>

+MIN_WAITING_TIME_BETWEEN_QUERIES : int-timeOfLastQuery : long-maxNumberOfHits : long-musicbrainzQuery

MusicBrainzProcessor

1

1

Uses libmusicbrainz-java library (revision 12315) for querying

Page 10: Adding MusicBrainz Support to jMusicMetaManager

reportMusicBrainz()

Iterate through all parsed files:

1. Fetch artist name

2. Fetch album name (using artist name)

3. Fetch title (using artist and album names)

10/18

Page 11: Adding MusicBrainz Support to jMusicMetaManager

GUI Changes

11/18

Page 12: Adding MusicBrainz Support to jMusicMetaManager

GUI Changes

12/18

Page 13: Adding MusicBrainz Support to jMusicMetaManager

Sample Report

13/18

In browser

Page 14: Adding MusicBrainz Support to jMusicMetaManager

Improvements

More files can now be read by the software! Simplest report, full personal library (all MP3, no

iTunes XML): Previously: read only 6 985/10 377 = 67% of ID3 tags

(mostly because of ID3v2 revision > 0) Now: reads 9 892 / 10 377 = 95% of ID3 tags

Character set when reading year can be fixed

ID3 tag exception to investigate

Basic MusicBrainz support so far

14/18

Page 15: Adding MusicBrainz Support to jMusicMetaManager

//TODO:

Improve MusicBrainz hit rate Handle weird character sets Create an ID3 randomizer for testing purposes? Add more options to the MusicBrainz report Add MusicBrainz links to the report Maintain all the metadata fields from the previous

implementation Try other available libraries that support ID3v2.4 Use other MusicBrainz servers to avoid low query rate? Figure out if the credentials are necessary

15/18

Page 16: Adding MusicBrainz Support to jMusicMetaManager

Current Issues

jid3lib: simplifies a lot of data fetching, but not everything!

Hash tables with different keys across revisions Managed fields so far in my project: artist, album, title, composer, year

(first 4 chars MUST be numbers), compilation, comments (only ID3v1), genres, bit_rate

Data integrity: String fields that are converted to numerical values Files with both ID3v1 and ID3v2 metadata

Read v2, else read v1? Read v1, then overwrite with v2? Handling different character sets

ÿþ 0xFF 0xFE signature of UTF-16 encoding

16/18

Page 17: Adding MusicBrainz Support to jMusicMetaManager

Current Issues (continued)

Random IOExceptions Tags that exist in 2 places:

Comments / SongComments Year / YearReleased

Compilation tag: only if folder contains “Compilation” Limit of 1 query per second can slow down reporting

10 377 queries take a minimum of 2 h 53 min

17/18

Page 18: Adding MusicBrainz Support to jMusicMetaManager

ReferencesMcKay, C., D. McEnnis, and I. Fujinaga. 2006. A large publicly accessible prototype audio

database for music research. In Proceedings of the International Conference on Music Information Retrieval. Victoria, Canada. 160–3.

LinksDan O’Neill. 2009. Home – ID3.org. http://www.id3.org/ (accessed 26 November 2009)

Cory McKay. 2006. jMusicMetaManager. http://jmir.sourceforge.net/manuals/jMusicMetaManager_manual/Manual.html (accessed 26 November 2009)

Eric Farng. 2005. Java ID3 Tag Library. http://javamusictag.sourceforge.net/ (accessed 26 November 2009)

18/18