home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / far100.zip / F2RSPEC.TXT < prev    next >
Text File  |  1994-04-13  |  5KB  |  154 lines

  1. ------------------------------------------------------------------------------
  2. F2R (Farandole Form2.0) linear-layout digital music specifications.
  3. By Daniel Potter/Digital Infinity.
  4.  
  5. This is the internal format we use for writing demos. Currently there are
  6. these versions of the F2R playing code:
  7.  
  8. A) A full C++ version that is rather slow, but plays all effects correctly.
  9. B) A full ASM version that is fast, although in real mode, and plays almost
  10.    no effects
  11. C) A full ASM version in protected mode that has been extremely optimized and
  12.    plays almost no effects (working on it).
  13.  
  14. These will all be available when I see that they are fit for the public eye..
  15.  
  16. You will see in a moment why I call it a linear-layout format. Everything can
  17. be read easily in one pass without mixing up too many variables. (Ex: sample
  18. data is stored with sample headers..)
  19.  
  20.  
  21. Header A
  22. --------
  23.  
  24. len           description
  25. ---           -----------
  26.  3            'F2R' - file magic
  27.  3            Composer magic. Only existing one right now is 'FAR' (farandole)
  28.  40           Song name in ASCIIZ
  29.  2            Songtext length (in bytes)
  30.  STLen        Songtext (length in previous field)
  31.  1            Song version. Current version is 0x20 (2.0)
  32.  1            Number of channels. Probly not more than 16, but up 256.
  33.  1            Default tempo, in ticks per second.
  34.  NChan        Default panning for each channel (length in NOC field above)
  35.  1            Number of samples saved in file.
  36.  
  37.  
  38. Sample Structures
  39. -----------------
  40.  
  41. len           description
  42. ---           -----------
  43. 32            Sample name in ASCIIZ
  44. 4             Sample length (PC dword)
  45. 1             FineTune. Not currently supported.
  46. 1             Volume. Also has no purpose currently.
  47. 4             Repeat START (PC dword)
  48. 4             Repeat END (PC dword) (note that this is NOT repeat LENGTH)
  49. 1             Sample type. bit 0=1->16 bit data
  50. Len           Sample data in signed format (length=SLen field above)
  51.  
  52. This structure repeats for the number of samples stored in the file.
  53.  
  54.  
  55. Header B
  56. --------
  57.  
  58. len           description
  59. ---           -----------
  60.  3            SectionID - 'JDC' - (see below comment)
  61.  1            Order length
  62.  1            Number of patterns stored in file
  63.  1            Loop To value (order index)
  64.  128          Order table. Blank entries padded with 0xFF
  65.  
  66.  
  67. Pattern Structure
  68. -----------------
  69.  
  70.  
  71. len           description
  72. ---           -----------
  73.  3            SectionID - 'JDC'
  74.  2            Number of events stored in this pattern
  75.  4            Length of pattern in bytes (starting with next byte)
  76.  
  77. What remains is an event for each thing that is to happen on any channel. This
  78. eliminates the need for saving blank data, and thus this is currently the
  79. most efficient digital format out. Here's the format of each event:
  80.  
  81. len           description
  82. ---           -----------
  83.  1            Event type. Each bit denotes a bit of information included:
  84.  
  85.       bit     description
  86.       ---     -----------
  87.        0      New note pitch
  88.        1      New instrument value
  89.        2      Start a new note
  90.        3      New volume
  91.        4      Effect (normal effect)
  92.        5      Extended effect
  93.  
  94.  1            Channel
  95.  
  96. Each of the follow is included only if the appropriate bit is set:
  97.  
  98.  1            ET0-(Octave*12)+Note
  99.  1            ET1-Sample number
  100.  1            ET3-Volume (0-FF)
  101.  2            ET4-effect #+effect data 1
  102.  1            ET5-effect data 2
  103.  
  104.  1            Eventtick - number of ticks to wait before processing next event
  105.  
  106. The above structure repeats for NumEvents (in pattern header) and the entire
  107. pattern structure continues until all patterns are saved.
  108.  
  109. Effects are standard Farandole Composer effects. Here is a list in case you
  110. do not know them:
  111.  
  112. 0- No effect
  113. 1- Slide pitch up
  114. 2- Slide pitch down
  115. 3- Slide to pitch *
  116. 4- Retrigger
  117. 5- Set vibrato amplitude
  118. 6- Vibrato current note with given wavelength
  119. 7- Volume slide up
  120. 8- Volume slide down
  121. 9- Sustained vibrato
  122. A- Slide to volume *
  123. B- Set panning
  124. C- Note offset
  125. D- Fine tempo down
  126. E- Fine tempo up
  127. F- Set tempo
  128.  
  129. *-extended effect (ET5)
  130.  
  131. For more info on how these work and how they are implemented, please see the
  132. Farandole documentation, FORMATS.DOC.
  133.  
  134. In the case of the extended effects, the second parameter is what is being
  135. slid to. ie pitch slide, parameter two is the pitch to slide to, and vol
  136. slide, is the volume to slide to.
  137.  
  138. Note about SectionID: I had a tremendous trouble debugging originally because
  139. since all the data in the file practically looked like garbage, there was no
  140. way to tell what was going on. What this does is provide the program a way to
  141. gauge if the file is valid. If you ever read a section ID and it is not 'JDC'
  142. verbatim you should stop reading the file and declare it invalid.
  143.  
  144. This format was provided as a service to the general demo/music/game community.
  145. It may be used for any purpose, however if you use my format I would like to
  146. at least be greeted or credited or something.. whatever you feel is appropriate.
  147.  
  148.  
  149.                                                            Good luck!
  150.                                                            Daniel Potter/DI
  151.                                                            Apr 13, 1994
  152. ----------------------------------------------------------------------------
  153.  
  154.