Automatic main melody extraction from midi files with a modified Lempel-Ziv algorithm
A dictionary based approach for extracting repetitive patterns in music aimed at music feature extraction and indexing for audio database management is proposed. Segmentation is achieved based on the tempo information and a music score is decomposed into bars. Each bar is indexed and a bar index table is built. Then, an adaptive dictionary based compression algorithm known as Lempel Ziv 78 (LZ-78) is applied to the bar-represented music scores to extract repetitive patterns (J. Ziv and A. Lempel, 1978). Finally, pruning is performed to this dictionary to remove non-repeating patterns and combine shorter repeating patterns into a longer repeating pattern. The LZ78 algorithm is slightly modified to achieve better results in the current context. Experiments are performed to MIDI files, and the proposed algorithm has demonstrated an excellent performance.