metamidi: a tool for automatic metadata extraction from MIDI files Tomás Pérez-García, Jose M. Iñesta, and David Rizo Computer Music Laboratory University of Alicante
Introduction Metadata permit organization, indexing, and retrieval of music information. Metadata are an important subject of research. metamidi is introduced as a tool for metadata extraction from MIDI files: – Global technical – Track content description and metaevents
MIDI Metadata File global metadata: – filename, text metaevents, size, format, number of tracks, resolution, tempo, meter, key, timbral, … Track metatada: – Text metaevents: track name, instrument name, lyrics, markers, … – Content description: duration, occupation, polyphony, pitch range, …
The metamidi tool Downloadable from our group web site – Source code, DTD, XSD Developed in ANSI C version Open source Tested under Linux.
The metamidi tool metamidi –{r|x|l} file [-o fileoutput] Metadata output formats: -r: register -l: line -x: XML -r Midi features name: /Users/inesta/metamidi/straussmyrthenbluten.mid text metaevent: $ size: format: 1 num tracks: 5 resolution: 1024 tempo: tempo changes: 70 meter: 6/8(0),1/4(15360),6/8(24576),1/4(113664),3/4(114688) meter changes: 5 key: FM(0),CM(225280),FM(335872),BbM(385024),FM(495616),BbM(606208) key changes: 6 instruments: 1 percussion: -1 duration: has sysex: Features of track text metaevent: $ channel: -1 duration: duration rate: 1.00 occupation: 0 occupation rate: 0.00 polyphony duration rate: 0.00 max polyphony: 0 avg polyphony: 0.00 low pitch: -1 high pitch: -1 modulations: 0 aftertouches: 0 pitch bends: 0 program changes: $
The metamidi tool metamidi –{r|x|l} file [-o fileoutput] Metadata output formats: -r: register -l: line -x: XML -l '/Users/inesta/metamidi/straussmyrthenbluten.mid';'$';48323;1;5;1024;176.00;70;6/8(0), 1/4(15360),6/8(24576),1/4(113664),3/4(114688);5;FM(0),CM(225280),FM(335872),BbM( ),FM(495616),BbM(606208);6;1;-1; ;0;|0;'$';-1; ;1.00;0;0.00;0.00;0;0.00;- 1;-1;0;0;0;$;|1;'Acoustic Grand Piano';1; ;1.00;606315;0.40;0.47;4;1.69;33;69;0;0;0;1(0);|2;'ACP 4';4; ;1.00; ;0.83;0.71;4;1.85;43;93;0;0;0;1(0);|3;'ACP 3';3; ;1.00;127284;0.08;0.27;9;1.71;48;84;0;0;0;1(0);|4;'B.S. Lengton';2; ;1.00;760688;0.50;0.96;4;2.87;29;70;0;0;0;1(0);
The metamidi tool metamidi –{r|x|l} file [-o fileoutput] Metadata output formats: -r: register -l: line -x: XML -x
Applications Metadata can help in MIDI file indexing, organizing or classifying tasks. In this paper we have presented two examples of the use of the metamidi output in MIR problems: – Melody track selection using track content features – Genre classification using timbral metadata
Melody track selection Metadata are used to compute the probability of a track to contain the melody of a MIDI file. What metadata should be used? – Amount of music information: occupation rate – Melody are usually monophonic: polyphony duration rate, max polyphony, average polypohony – Pitch ranges: lowest pitch, highest pitch
Melody track selection Training phase: assuming a Gaussian distribution for the values of a descriptor d, P(d|M) and P(d| M) are obtained from the tracks labeled as melodies and not melodies. Test phase: Bayes theorem is used to compute the probability of a track to be a melody:
Melody track selection The decision is taken using a maximum likelihood criterion for all the tracks ( i ) in the file with probability over a threshold, : CorpusDescr. S%PRF Clas200High pitch ClasAvg.Poly Jazz200Max.Poly & Low p JazzMax.Poly & Low p Kar200Avg.Poly KarAvg. Poly
Timbre-based genre classification Use timbral information provided by metamidi to classify MIDI files into musical genres also under a probabilistic approach. File representation: x = (1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0 … 0,0,1,0,0) (128 GM + 3 percussions) Grand pianoElectric bassElectric guitarDrum kit
Timbre-based genre classification The probability for instrument t i in class c j is computed from the training set A MIDI file is assigned to the class c j that maximizes the a posteriori probability # files of c j with t i # files of c j
Timbre-based genre classification Data set: – Hierarchical classes: 3 9 (235) Classical (338) Jazz (283) Popular Baroque (56) Classic (50) Romantic (129) Pre-bop (178) Bop (94) Bossanova (66) Celtic (99) Blues (84) Pop (100)
Timbre-based genre classification AcademicJazzPopular Academic22861 Jazz Popular class experiment – (10 fold crossvalidation) – 93 2 % (39.5 % baseline) (+53.5 %)
Timbre-based genre classification barclasRomPreBopBosCelBlupop Baroque Classic Romantic Prebop Bop bossa Celtic Blues pop class experiment – (10 fold crossvalidation) – 68 5 % (20.8 % baseline) (+47.2 %)
Conclusions metamidi has been designed as a tool for metadata extraction from standard MIDI files. The good performances of the presented examples show the power of metadata automatc extraction tools for helping in the solution of MIR problems.
metamidi: a tool for automatic metadata extraction from MIDI files Tomás Pérez-García, Jose M. Iñesta, and David Rizo Computer Music Laboratory University of Alicante