I began to work with it by myself. It's hard to find any documentation about .SGT file, but I made it to split the file content into five tracks. I'm working with 0004s-run.sgt (Run from FFVIII):
Looks like every track have header like this:
TRACK HEADER:const char[8] DMTKrekh
uint size
byte[size] UNKNOWN
UNKNOWN:
byte[24] UNKNOWN
char[4] modeIndicator1
char[4] modeIndicator2
Some tracks have modeIndicator1 filled and modeIndicator2 nulled, and some have modeIndicator1 nulled and modeIndicator2 filled.
Track#1:
TRACKHEADER 44 bytes
LIST->cord (in my example 156 bytes + 8 ('cord' and size uint))
Chords data?
Track#2:
TRACKHEADER 44 bytes
tetr (in my example 20 bytes + 8 ('tetr' and size uint))
No idea, looks quite empty
Track#3:
TRACKHEADER 44 bytes
seqt (in my example 14460 bytes + 8 ('seqt' and size uint))
---evtl (in my example 60664 bytes + 8)
---curl (in my example 83780 bytes + 8)
This needs to be the main sequence, what evtl and curl are?
FOUND IT!
https://msdn.microsoft.com/en-us/library/ms900331.aspxTrack#4:
TRACKHEADER 44 bytes
tims (in my example 20 bytes + 8 ('tims' and size uint))
No idea, looks quite empty
Track#5:
TRACKHEADER 44 bytes
RIFF CONTAINER -> DMBT -> LIST; LIST; LIST; UNFO ("Band1"); (...) Inname ("FF8 Instruments File * FF8.dls")
Probably set-up of DLS/ bands/ instruments, lot of sub-cointainers with 'LIST' indicator.
@UPDATE:
Yeah, like I found the SGT chunks documentation:
https://msdn.microsoft.com/en-us/library/ms900553.aspx-but some pages are in JP only
https://msdn.microsoft.com/ja-jp/cc354074(ja-jp)
Python, track 2/ tetr, last 8 bytes:
>struct.unpack('d', '0000000000405f40'.decode('hex'))[0]
125.0
dmusicf.h found at:
https://github.com/tycho/arc/blob/master/contrib/DirectX/include/dmusicf.hSequence:
typedef struct _DMUS_IO_SEQ_ITEM
{
MUSIC_TIME mtTime;
MUSIC_TIME mtDuration;
DWORD dwPChannel;
short nOffset;
BYTE bStatus;
BYTE bByte1;
BYTE bByte2;
} DMUS_IO_SEQ_ITEM;
typedef struct _DMUS_IO_CURVE_ITEM
{
MUSIC_TIME mtStart;
MUSIC_TIME mtDuration;
MUSIC_TIME mtResetDuration;
DWORD dwPChannel;
short nOffset;
short nStartValue;
short nEndValue;
short nResetValue;
BYTE bType;
BYTE bCurveShape;
BYTE bCCData;
BYTE bFlags;
} DMUS_IO_CURVE_ITEM;