Skip to content

How to convert a "Set Global Volume" mod function to ULT function? #94

@akarnokd

Description

@akarnokd

I'm reverse engineering an old DOS game's custom music file format which highly resembles the ULT format, including its functions.

However, the game file also uses the 0x10 function, Set Global Volume. (Essentially, the game's instruction format is note,instrument,func1,func2,func2_param,func1_param bytes.) However, this function code can't fit into an ULT instruction because func1 & func2 are nibbles in the byte. I know Fast Tracker ][ introduced this 0x10 command.

I managed to write a converter in C# that outputs an ULT file (playable by VLC player), however, it doesn't sound right as some tracks are louder or quieter than when the game plays it. Probably because I converted the 0x10 function into 0x0C (Set Volume) incorrectly. (Remembering the 0x10 parameter value and adding it to each subsequent 0x0C parameter use. I tried using the global volume as a maximum and rescaling 0x0C volume amounts relative to it, which resulted in very quiet music.)

My question is, how do I correctly interpret such 0x10 functions and turn them into 0x0C functions? In other terms, if I have 0x10(0x07) and 0x0C(0x20), what would be the equivalent argument y if there was just 0x0C(y).

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions