
      0      4  (dword) ID Text: "_XM_" (0x5F584D5F)
      4      4  (dword) File length

                        Header:
                        -------

      0      4  (dword) Song length (in patten order table)
      4      4  (dword) Restart position
      8      4  (dword) Number of channels (2,4,6,8,10,...,32)
     12      4  (dword) Number of patterns (max 256)
     16      4  (dword) Number of instruments (max 128)
     20      4  (dword) Default tempo
     24      4  (dword) Default BPM
     28      1  (dword) Flags
     29      ?   (byte) Pattern order table

                        Patterns:
                        ---------

      0      4  (dword) Pattern size
      4      4  (dword) Number of rows in pattern (1..256)
      8      ?  (dword) Packed pattern data

                        Instruments:
                        ------------

      0      1   (byte) Number of samples in instrument
      1      1   (byte) Structures following:

                        BIT 0:
      0     96   (byte) Sample number for all notes

                        BIT 1: (volume envelope)
      0      1   (byte) Last Point
      1      1   (byte) Sustain point       (-1 if none)
      2      1   (byte) Loop start point
      3      1   (byte) Loop end point      (-1 if none)
      4      ? (tpoint) Points for envelope
      ?      2   (word) Volume fadeout

                        BIT 2: (panning envelope)
      0      1   (byte) Last Point
      1      1   (byte) Sustain point       (-1 if none)
      2      1   (byte) Loop start point
      3      1   (byte) Loop end point      (-1 if none)
      4      ? (tpoint) Points for envelope

                        BIT 3:
      0      1   (byte) Vibrato type
      1      1   (byte) Vibrato sweep
      2      1   (byte) Vibrato depth
      3      1   (byte) Vibrato rate

                        Sample headers:
                        ---------------

      0      4  (dword) Sample data pointer
      4      4  (dword) Sample loop start
      8      4  (dword) Sample loop end (!!!)
     12      1   (byte) Type: Bit 0-1: 0 = No loop, 1 = Forward loop,
                                       2 = Ping-pong loop;
                                    4: 16-bit sampledata
     13      1   (byte) Volume
     14      1   (byte) Finetune (signed byte -16..+15)
     15      1   (byte) Relative note number (signed byte)
     16      1   (byte) Panning (0-255)
     17      1   (byte) Resample (GUS, AWE)
     18      4  (dword) Sample offset (GUS, AWE)

