Skip to content

Instantly share code, notes, and snippets.

@beanieaxolotl
Last active December 13, 2024 20:36
Show Gist options
  • Save beanieaxolotl/b433e32c1c80550d74a1cdc7f3cc6c01 to your computer and use it in GitHub Desktop.
Save beanieaxolotl/b433e32c1c80550d74a1cdc7f3cc6c01 to your computer and use it in GitHub Desktop.
GAX .ghx2 project file documentation (WIP)

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

GHXC chunk

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

LZOD chunk

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

LZOD chunk data

Extremely heavy WIP. Since the LZOD compression type is unknown, the fields are pure guesswork.

File version

Type Name Comment
ASCII "GHX2" File identifier
ASCII "0153" / "0110" Replayer version string, minimum is 0110

SONG chunk

Header chunk

Type Name
ASCII "SONG"
uint32 Song bank data size(?)

Data chunk (incomplete)

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.

EXPP chunk

Type Name Comment
ASCII "EXPP" Referenced during export
uint32 Size of data
char[*] Data Length of data is dictated by the below dword

AUTH chunk

Type Name Comment
ASCII "AUTH"
uint32 Length of author's name
char[*] Author's name Length of name is dictated by the below word

INST chunk

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

WAVE chunk

Type Name
ASCII "WAVE"
uint32 Size of wave data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment