8bitbubsy / ft2-clone

Fasttracker 2 clone for Windows/macOS/Linux
https://16-bits.org
BSD 3-Clause "New" or "Revised" License
746 stars 49 forks source link

A question about the XM pattern volumn column byte #29

Closed evenbrenden closed 2 years ago

evenbrenden commented 2 years ago

I'm using an XM converter and noticed that it gets the note volumes (volume column byte) wrong. The converter assumes that the values are in the 00-64 range, but they are actually offset by 16, i.e. in the 16-80 range. The same is true for XMs produced by MilkyTracker. I cannot find any information that suggests using this range in the XM specs that I have looked at.

The first spec doesn't really specify any range. The second one suggest a volume column byte in the 00-64 range:

+2 1 byte Volume column byte 00 (0..64, 255)

I'm assuming that the converter is the one that gets it wrong, but I'm curious about why. So I'm wondering if I'm missing something in the spec.

8bitbubsy commented 2 years ago

You could start by reading the official XM documentation, written by the developer himself: http://modland.com/pub/documents/format_documentation/FastTracker%202%20v2.04%20(.xm).txt

$10-$50 Set volume Value-$10

evenbrenden commented 2 years ago

I thought that referred to how the user specifies the volume in the effects column, and not the representation in the XM file. And it does say -$10.

sagamusix commented 2 years ago

+2 1 byte Volume column byte 00 (0..64, 255)

This is incomplete and incorrect. Later on in the same PDF (page 18) it mentions the correct ranges of possible volume column effects. The Wikipedia link just seems to be a copy of the original file specs so it gets it right too. The original documentation may not be the best written docs but I think it's pretty clear (albeit very concise) in this case: The values $10 through $50 set the volume to value - $10. So if the value is $30, it sets the volume to $30-$10=$20.

evenbrenden commented 2 years ago

Ah, it's "Effects in volume column", not the other way around. Thank you both for clarifying.