home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 September / Chip_2000-09_cd1.bin / sharewar / Slunec / app / 16 / MOD.SWG / 0024_SADT.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  3KB  |  81 lines

  1.      SADT FILE FORMAT
  2.  
  3. Have  you  ever wondered how the files  are  built up? Well. here is the
  4. file formats I use:
  5.  
  6.       Offset    Length (Bytes)         Description
  7.      ----------------------------------------------------------------------
  8.         0            4                 'SAdT' These for bytes mark a Song.
  9.         4            1                 Version number (currently 9)
  10.         5           465                The 31 Instruments
  11.        470          496                The 31 Instrument names
  12.        966          128                Patternorder
  13.       1094           2                 Number of Patterns (NoP)
  14.       1096           1                 Length of Song
  15.       1097           1                 Restart Position
  16.       1098           2                 BPM
  17.       1100          256                Arpeggiolist
  18.       1356          256                Arpeggiocommands
  19.       1612          576                Trackorder
  20.       2188           2                 Aktive Channels Bits: 123456789xxxxxxx
  21.       2190        ???*192              Trackdata
  22.  
  23.    Trackorder is an 64*9 array that points to the tracks.
  24.    Track 0 is a empty track (not saved).
  25.  
  26.    each track is saved as follows:
  27.  
  28.    64 lines of:
  29.       nnnnnnni iiiieeee ppppPPPP  = 3 Bytes
  30.       (where n indicates a bit for the note,
  31.              i indicates a bit for the instruments,
  32.              e indicates a bit for the effect and
  33.              p/P indicates the effect-parameter bits.)
  34.       therefore 64*3 = 192 Bytes.
  35.  
  36.  
  37.      The Instrument Format:                                           Page 17
  38.  
  39.        Offset    Length (Bytes)         Description
  40.       -----------------------------------------------------------------------
  41.          0          11                  Instrumentdata
  42.         11           4                  Arpeggiodata
  43.  
  44.      O.K. here's how the instrument data is built up:
  45.  
  46.         Byte 1:
  47.            Bit    0: Frequenzy modulation / additiv synthesis
  48.            Bits 1-3: Feedback
  49.         Byte 2:
  50.            Bits 0-3: Freq. Multiplier     ─┐
  51.            Bit    4: Scaling               │
  52.            Bit    5: Sustaining Sound      ├ Connector
  53.            Bit    6: Vibrato               │
  54.            Bit    7: Amp. Vibrato         ─┘
  55.         Byte 3:
  56.            just like Byte 2, just for the Carrier
  57.         Byte 4:
  58.            Bits 0-3: Decay Rate
  59.            Bits 4-7: Attack Rate        Connector
  60.         Byte 5
  61.            Decy, Attack Carrier
  62.         Byte 6
  63.            Bits 0-3: Release Rate
  64.            Bits 4-7: Sustain Level       Connector
  65.         Byte 7
  66.            Release, Sustain level Carrier
  67.         Byte 8
  68.            Waveform Connector
  69.         Byte 9
  70.            Waveform Carrier
  71.         Byte 10
  72.           Bits 0-5: Volume
  73.           Bits 6-7: Level Scaling Connector
  74.         Byte 11
  75.           Volume, Level Scaling Carrier
  76.  
  77.      The Arpeggiodata consists of:
  78.  
  79.        ArpeggioStart, ArpeggioSpeed, CurrentPos, SpeedCount, each value is a
  80.        byte long.
  81.