home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / far100.zip / F3RFORM.TXT < prev    next >
Text File  |  1994-08-05  |  7KB  |  212 lines

  1. Farandole .F3R blocked linear module format (1.0)
  2. by Daniel Potter/Digital Infinity
  3.  
  4.   *NOTE* THIS FILE IS VERY TENTATIVE. IDEAS OR COMMENTS ARE *VERY* WELCOME!
  5.   HELP US CREATE THE MOST AWESOME FORMAT EVER FOR THE MOST AWESOME TRACKER
  6.                EVER (maybe not yet, but it will be, i promise)
  7.  
  8. The methodology behind the F3R format is that every section is headed by a
  9. 4 byte header telling what section follows, and a 4 byte dword in standard
  10. Intel format telling the length of that section. This allows the program to
  11. skip over any section it does not recognize, and allows storage of external
  12. thingies in the file, for whatever purpose you see fit.
  13.  
  14. Length of the section does NOT include the length of the header magic or the
  15. length field. So if you want that, you must add 8 bytes. Here's a list of
  16. all the sections:
  17.  
  18. HEAD   - Header section - includes info about the song
  19. FARV   - Farandole variables - only here if created with Farandole, and only
  20.          if saved in full (not stripped) format. The FARV section stores
  21.          info the composer needs to completely restore the state of the
  22.          tracker. Otherwise you will be placed on patt 0, row 0, chan 0, etc.
  23. SAMP   - Sample list+sample data
  24. PATT   - Order list+Pattern data
  25. STXT   - Songtext in ASCII format
  26. SANS   - Songtext in ANSI format - no animations
  27. APIC   - Author picture.
  28.  
  29. Other sections are mostly program specific, and should be skipped over unless
  30. you know what they are, or if you created them yourself. Obviously it would
  31. be very easy to make a program to add sections to the file since it is not
  32. neccessarily in any order (except that the HEAD section is always first).
  33.  
  34. Here's a list of all the sections:
  35.  
  36. PREFIX (note this section is NOT preceeded by a description or length)
  37. ------
  38.  
  39. len             description
  40. ---             -----------
  41.  3              F3R file magic ('F3R')
  42.  3              Composer magic. Usually 'FAR' (Farandole)
  43.  32             Song name in ASCIIZ
  44.  
  45. HEAD
  46. ----
  47.  
  48. len             description
  49. ---             -----------
  50.  1              Song version. Current version is 0x10 (1.0)
  51.  1              Number of channels. Up to 256, but usually no more than 16.
  52.  1              Song TPS (ticks per sec). 50 for MOD's, 32 for FAR's and
  53.                 669's.
  54.  NChan          Default panning for each channel (0-F)
  55.  
  56. FARV (taken from FORMATS.DOC in Farandole)
  57. ----
  58.  
  59. len      description
  60. ---      -----------
  61.  16      Channel ON/OFF map
  62.  1       Current editing octave
  63.  1       Current editing voice
  64.  1       Current editing row
  65.  1       Current editing pattern
  66.  1       Current editing order
  67.  1       Current editing sample
  68.  1       Current editing volume
  69.  1       Current top of screen display (top row visible)
  70.  1       Current editing area of the screen (0=sample,1=pattern,2=order)
  71.  1       Current tempo (default tempo)
  72.  1       MarkTop (block)
  73.  1       MarkBot (block)
  74.  1       Grid granularity (default 4)
  75.  1       Edit Mode
  76.  
  77. SAMP
  78. ----
  79.  
  80. len               description
  81. ---               -----------
  82.  1                Number of samples. Obviously 0-FF.
  83.  
  84. Repeated for NOS:
  85.  
  86. len               description
  87. ---               -----------
  88.  32               Name of sample
  89.  4                Length of sample
  90.  1                FineTune value (+/- on the GUS period value*2 for 16 chnls):
  91.                   GUS_PERIOD+(FT*2)
  92.  1                Max Volume
  93.  4                Repeat start
  94.  4                Repeat end - If the sample is looping, this should be set
  95.                   to the repeat end value. Otherwise, it should be set to the
  96.                   length of the sample.
  97.  1                Sample type byte
  98.  
  99.    1<<0    8/16 bit (8=0 16=1)
  100.  
  101.  1                Looping mode byte
  102.    1<<3    Looped=1 NotLooped=0
  103.  (len)            Sample data in raw SIGNED format
  104.  
  105.  
  106. PATT
  107. ----
  108.  
  109. len             description
  110. ---             -----------
  111.  1              Number of patterns saved
  112.  
  113. Repeated for NOP:
  114.  
  115. len             description
  116. ---             -----------
  117.  2              Number of events stored in this pattern
  118.  4              Length of pattern starting with next byte
  119.  1              Break location of pattern
  120.  
  121. What remains is an event for each thing that is to happen on any channel. This
  122. eliminates the need for saving blank data like most tracker formats (such
  123. as MOD). And while crunched formats like 669 work a lot towards saving space,
  124. this format is still superior (most 669's are shrunk considerably based on
  125. F2R file stats).
  126.  
  127. len             description
  128. ---             -----------
  129.  1              Event Type. Each bit denotes a bit of information included:
  130.  
  131.       bit
  132.       ---
  133.        0        New note pitch
  134.        1        New instrument value
  135.        2        Starting of a new note is required
  136.        3        New volume
  137.        4        Effect 0 is specified - Note you can put up to 4 effects at
  138.        5        Effect 1 is specified   once on one note if your tracker
  139.        6        Effect 2 is specified   will do it. Each bit specifies
  140.        7        Effect 3 is specified   an effect that is on this event.
  141.  
  142.  1              Channel
  143.  
  144. Each of the following is included only if the appropriate bit is set:
  145.  
  146.  1              ET0-(Octave*12)+Note
  147.  1              ET1-Sample number
  148.  1              ET3-Volume (0-FF)
  149.  2              ET4-Effect #+effect data
  150.  2              ET5-Effect #+effect data
  151.  2              ET6-Effect #+effect data
  152.  2              ET7-Effect #+effect data
  153.  
  154. Rest is always here:
  155.  
  156.  1              EventTick - number of ticks to wait before processing next
  157.                 event.
  158.  
  159. The above structure repeats for NumEvents (in pattern header) and the entire
  160. pattern structure continues until all patterns are saved.
  161.  
  162. Effects are standard Farandole Composer effects. Note that effects up 0-FF
  163. are supported, but FAR is only going to support 0-Z.
  164.  
  165.  
  166. STXT
  167. ----
  168.  
  169. Songtext in ASCII format. This means each line is ended with a <CR> (no LF).
  170. File is ended with an EOF (26).
  171.  
  172.  
  173. SANS
  174. ----
  175.  
  176. Same as above, except that ANSI codes are permitted. Actually the actual ANSI
  177. codes are not stored, but binary versions of them:
  178.  
  179. 0-black
  180. 1-blue
  181. 2-green
  182. 3-cyan
  183. 4-red
  184. 5-magenta
  185. 6-brown
  186. 7-gray
  187. 8-15 - Same as 0-7 except high intensity
  188.  
  189. 16-31 - Same as 0-15 except background colors
  190.  
  191. The palette used for ANSI scrolltext mode is the same palette used in
  192. standard VGA text mode. This is so you can import regular TheDraw ANSI files
  193. into FAR.
  194.  
  195.  
  196. APIC
  197. ----
  198.  
  199. A picture of the author can be included here. It will be in DIF-RLE compressed
  200. format which i use in demos, etc. Here's a rundown on that format:
  201.  
  202. word X size
  203. word Y size
  204. 768 bytes palette
  205. Compressed data. Decompression as follows:
  206.  
  207. Read byte. If byte is not equal to 255, then store byte in output. If it is
  208. 255, read next byte. If the next byte is a 255, then store a 255 in output.
  209. If it's NOT 255, then use that number as a repeat count for the last valid
  210. input byte. (I'll include code when it's useful.. you'll see :).
  211.  
  212.