PmWiki


Midi

tagging of MIDI files

Playing an MP3 in your average media player is simple. Try to play a MIDI file, however, brings all sorts of complications. Assuming that you can get your media player to recognise the format at all (hint: GStreamer applications), you then face the problem of knowing what file is what. All media players rely on tags, and yet I am having a devil of a job to get MIDI-tags recognised. This documents what is (and is not) sucessful...

Title

  • Totem
    Uses the last encountered Text: comment, with no sub-class.

Official Meta-Events

The MIDI-specifications define the following meta-events:

00 Sequence number
01 Text event
Any text you want. This is the only space we have available for tagging.
02 Copyright info
03 Sequence or Track name
04 Track instrument name
05 Lyric
06 Marker
07 Cue point
51 Set tempo
58 Time Signature
59 Key signature
7F Sequencer specific information

Extending the Text Meta-Event to support tagging.

As the MIDI specification does not define specific methods of tagging a file with information regarding the Artist, Date, etc, we must adopt some structured form of using this one meta-event to hold all our information, in some logical and machine parsable way.

  1. Adopt another convention, and apply to MIDI
    1. ID3v1
      Limited size. ISO-8859-1 only. Limited definitions.
    2. ID3v2
      Well defined & compact tagging method.
      Complex to read and write. Unintuitive to read by a human.
    3. Vorbis Tag
      Loosly defined. Easy to read by human (only if conversant in English).
  2. Define our own structured convention
    1. Use a combination of Vorbis and ID3v2 perhaps?

Potential Tag structure

Taken from a fictional MIDI file, generated by reading and converting a mythical piano-roll.

Copyright: Handled verbatim.
Text:
TALB=The Sound of Music
TCOM=Rodgers, Richard
TDAT=2009-01-01
TENC=Doe, John
TEXT=Hammerstein II, Oscar
TIT*=My Favorite Things
TLAN=EN
TORY=1959
TPE1=Brubeck,David Warren
TPUB=Josef Weinberger Ltd.
TRDA=1962

Taken from a potential MIDI file, generated by reading and converting a real piano roll which was recorded by the composer in 1916, and published and released the following year by Uni-Record under the 'Melody' label. Note that, though I use ID3v2 tagnames, I am using Vorbis formatting layout, and that there are duplicate tags...

:Text: TIT1=Rialto Ripples
TCON=Fox Trot
TCON=Ragtime
TCOM=Gershwin, George
TCOM=Donaldson, Will
TPUB=Uni-Record
TORY=1917
TPE1=Gershwin, George
TPE4=Melody (Uni-Record)
TRDA=1916
TENC=Unknown
TOWN=Kunst der Fuge
TDAT=2002-05
USER=Can *not* be used for commercial purposes without authorization!
TMED=Piano Roll
TXXX=Tagged according to the unoffical 'MIDITAG' specification.
WXXX=http://manx.biz/opensource/Media/Midi

Another Example:

TPE4=QRS
Roll Number=9726
TORY=1899 	   	 
TIT1=Maple Leaf Rag Song
TPUB=John Stark & Son
TCOM=Joplin, Scott
TEXT=Brown, Sydney
WOAR=http://en.wikipedia.org/wiki/Scott_Joplin
TPE1=Joplin, Scott 	
TDAT=2005-06-08
TMED=Piano Roll
TENC=Trachtman, Warren

Unknown (as yet)...

  • 00 Sequence Number ==
  • The precise difference between the IV3v2 TIT* tags.

Nota bene

Any meta-tag belongs to an individual TRACK, rather than the entire MIDI file. Should we define that all our TAG information should be held in the first track only?

History - Print - Recent Changes - Search - Page last modified on 2009, January 07 @ 22:56:04
guestbook