bunnytrack/umx-converter

Add XM format option

Closed this issue · 2 comments

As suggested in #1, using XM format may lead to better compression due to the format's use of delta-encoding for samples.

TL;DR: it's probably not worth implementing a .xm file option. See the tables below for some file size comparisons I've done.

File Sizes

MP3 File Duration Size (.wav)* Size (.it) Size (.xm) Size (.it.uz) Size (.xm.uz)
Trance music 06:27 16,764 KB 16,667 KB 16,668 KB 8,331 KB 7,962 KB
Pop music 03:36 9,646 KB 9,305 KB 9,306 KB 4,845 KB 4,739 KB
Rock music 03:56 10,522 KB 10,167 KB 10,167 KB 7,829 KB 7,650 KB
Classical music 02:10 2,837 KB 2,811 KB 2,811 KB 653 KB 651 KB

*8-bit/22 kHz.

Compression Difference

MP3 File Size (.it.uz) Size (.xm.uz) Difference (KB)
Trance music 8,331 KB 7,962 KB -369 KB -4.43%
Pop music 4,845 KB 4,739 KB -106 KB -2.19%
Rock music 7,829 KB 7,650 KB -179 KB -2.28%
Classical music 653 KB 651 KB -2 KB -0.32%

Clearly .xm does compress slightly better than .it, but in my opinion it's not worth the effort of implementing another format just to save a few kilobytes, so I am closing this issue for now.

If anyone feels like adding .xm then pull requests are welcome.

Thanks for the suggestion @peterekepeter.

Wow, thanks for investigating this! Very cool! Some bytes do get shaved off, but yeah the amount of effort might not be worth it.