Shin'en GAX Sound Engine - .ghx2 file format
The .ghx2 file format is typically the original project file, created with the GHX2 editor program. The GAXPlay program is the only program available that can read these files. The documentation is incomplete since there are a ton of unknowns, but I'll post what I have here.
Additional documentation by barncastle, Special thanks to them!
https://reshax.com/topic/1020-help-issues-decompressing-unknown-lzo-compressed-data-ghx2/
Markdown formatting taken from https://gist.github.com/loveemu/9b3063ffd9a76cb18e379324e43f3251
File header
Type
Name
Comment
ASCII
"GHXC"
Might stand for "GHX Compressed"
uint32
Uncompressed data size
Size of the "LZOD" chunk when uncompressed
uint32
Uncompressed data checksum
Calculated using a custom version of Fletcher-32 that uses 0x15B0 sized blocks
Uses a currently unknown (likely proprietary) version of Lempel-Ziv-Oberhumer compression.
Type
Name
Comment
ASCII
"LZOD"
"Lempel-Ziv-Oberhumer Data"
uint32
Compressed data size
Size of the LZOD chunk itself
Extremely heavy WIP. Since the LZOD compression type is unknown, the fields are pure guesswork.
Type
Name
Comment
ASCII
"GHX2"
File identifier
ASCII
"0153" / "0110"
Replayer version string, minimum is 0110
Header chunk
Type
Name
ASCII
"SONG"
uint32
Song bank data size(?)
Type
Name
Comment
Pascal-string
Song title
uint32
Number of channels
uint32
Number of steps per pattern
unknown
unknown
uint16
Unknown pointer
Pointer to somewhere in song data
uint16
Unknown pointer #2
Pointer to somewhere in song data
uint16
Unknown pointer #3
uint32
Master volume (amplification)
uint16
Music mix rate
uint16
FX mix rate
uint8
FX channel count
The rest could very well be pattern data + order list data.
Type
Name
Comment
ASCII
"EXPP"
Referenced during export
uint32
Size of data
char[*]
Data
Length of data is dictated by the below dword
Type
Name
Comment
ASCII
"AUTH"
uint32
Length of author's name
char[*]
Author's name
Length of name is dictated by the below word
Type
Name
ASCII
"INST"
uint32
Size of instrument data
Instrument data (incomplete)
Type
Name
Comment
uint32
Pointer to wave data
unknown
unknown
Pascal-string
Instrument name
Example -> "frenchhorn1 copy (6)"
unknown
unknown
Type
Name
ASCII
"WAVE"
uint32
Size of wave data