home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / OKT-FORM.TXT < prev    next >
Internet Message Format  |  1996-01-04  |  13KB

  1. From zappe@sietec.sietec.de Wed Apr  6 13:51:35 1994
  2. Received: from geech.gnu.ai.mit.edu by albert.gnu.ai.mit.edu (5.65/4.0) with SMTP
  3.     id <AA11165@albert.gnu.ai.mit.edu>; Wed, 6 Apr 94 13:51:29 -0400
  4. Received: from [141.73.252.1] by geech.gnu.ai.mit.edu (5.65/4.0) with SMTP
  5.     id <AA04158@geech.gnu.ai.mit.edu>; Wed, 6 Apr 94 13:51:19 -0400
  6. Received: from gaea.sietec.de by sietec.sietec.de with SMTP id AA19492
  7.   (5.67b/IDA-1.5 for <jamal@gnu.ai.mit.edu>); Wed, 6 Apr 1994 19:55:09 +0200
  8. From: Harald Zappe <zappe@gaea.sietec.de>
  9. Date: Wed, 6 Apr 94 19:48:56 +0200
  10. Message-Id: <9404061748.AA01255@gaea.sietec.de>
  11. To: jamal@gnu.ai.mit.edu
  12. Subject: oktafmt.txt (? final)
  13. Status: OR
  14.  
  15.  
  16. Thanks to all of those mentioned below for the additional infos
  17. and sources. It looks pretty complete now.
  18.  
  19. The effects seem to be complete. All, VT, Multiplayer and the
  20. Amiga Oktalyzer 1.1 Player use the same values. But I didn't see
  21. the effect 12 anywhere (Arp 5), as mentioned by Peter Kunath.
  22.  
  23. -----------------------------------------------------------------
  24.  
  25. [C.3.3]     Oktalyzer
  26.             ---------
  27.  
  28. Thanks to Frank Seide (seide@pfa.philips.de) for the first hints,
  29. Bryan Ford (baford@schirf.cs.utah.edu) for most of the detailed comments
  30. below, the effects, and the (GPL) free source code of his Multiplayer,
  31. the Vangelis Team, which is Juan Carlos Arevalo (jarevalo@moises.ls.fi.upm.es),
  32. Felix Sanz, and Luis Crespo for the Freeware sources of the Vangelis Tracker,
  33. Armin Sander for the (?)first Oktalyzer Player on an Amiga,
  34. Peter Kunath (kunath@informatik.tu-muenchen.de) for several hints,
  35. and Jamal Hannah (jamal@gnu.ai.mit.edu) for coordinating us all.
  36.  
  37. There are two different "Oktalyzer" formats. The following description
  38. only refers to the IFF-like style. The other one (a memory dump model)
  39. seems to have no popularity.
  40.  
  41. (All numbers below are given in hex unless specified as 't'ecimal.)
  42.  
  43. MSB first
  44.  
  45. offset |bytes| contents   | meaning
  46. -------+-----+------------+-------------------------------------------------
  47. 000000 |   8 | "OKTASONG" | char Magic[8]
  48.        |     |            |   /* If you support different music file types
  49.        |     |            |      check these letters. */
  50. -------+-----+------------+-------------------------------------------------
  51.        |     |            | Channel_Modes {
  52. 000008 |   4 | "CMOD"     |   char chunk_name[4]
  53. 00000C |   4 | 8          |   long chunk_len
  54. 000010 |   8 |            |   short chan_flags[4]
  55.        |     |            |   /* 0: normal (Amiga) sound channel         */
  56.        |     |            |   /* 1: 'tied' or 'splitted' channel: two
  57.        |     |            |         sounds are played through this channel
  58.        |     |            |         at the same time (mixed at run time) */
  59.        |     |            |   /* eg. 0 1 0 1 => 6 channel: 1: normal,
  60.        |     |            |      2/3: tied, 4: normal, 5/6: tied         */
  61.        |     |            | }
  62. -------+-----+------------+-------------------------------------------------
  63.        |     |            | Sample_directory {
  64. 000018 |   4 | "SAMP"     |   char chunk_name[4]
  65. 00001C |   4 | (00000480) |   long Sample_dir_len /*==chunk_len*/
  66.        |     |            |        /* Nr_of_samples = Sample_dir_len / 32 */
  67.        |     |            |
  68. 000020 |  20t|            |   char Sample_Name[20]             \
  69. 000034 |   4 |            |     unsigned long  Sample_Len       )
  70. 000038 |   2 |            |     unsigned short Repeat_Start    (   up to 36x
  71. 00003A |   2 |            |     unsigned short Repeat_Len       > (or more?)
  72. 00003C |   1 | (00)       |     char           pad1            (
  73. 00003D |   1 | (40)       |     unsigned char  Volume           )
  74. 00003E |   2 | (0001)     |     short          pad2            /
  75. ...    |     |            | /*
  76.        |     |            | If 'Repeat_Len' is zero, it is a simple one-shot
  77.        |     |            | sample: ignore 'Repeat_Start', just play the whole
  78.        |     |            | 'Sample_Len' bytes and stop the sound.
  79.        |     |            | If 'Repeat_Len' is nonzero, it is a repeating sample
  80.        |     |            | consisting of three parts: attack, sustain, and re-
  81.        |     |            | lease. (Most other tracker formats don't support re-
  82.        |     |            | lease.) The attack part starts at 0 and ends at
  83.        |     |            | Repeat_Start-1, the sustain part starts at 'Repeat_
  84.        |     |            | Start' and ends at Repeat_Start+Repeat_Len-1, and
  85.        |     |            | the release part starts at Repeat_Start+Repeat_Len
  86.        |     |            | and ends at Sample_Length-1.
  87.        |     |            | The attack part should be played once, followed by
  88.        |     |            | the repeat part an arbitrary number of times until
  89.        |     |            | another note is played or a "release" command is
  90.        |     |            | seen. If the "release" command is seen, then switch
  91.        |     |            | to the release part of the sample when the current
  92.        |     |            | repeat run is finished, and only play it once, fol-
  93.        |     |            | lowed by silence.
  94.        |     |            | 'Volume' is the default volume for notes played with
  95.        |     |            | this sample: 0 to 64 (0x40) inclusive. */
  96.        |     |            | }
  97. -------+-----+------------+-------------------------------------------------
  98.        |     |            | Speed {
  99. 0004A0 |   4 | "SPEE"     |   char  chunk_name[4]
  100. 0004A4 |   4 | 2          |   long  chunk_len
  101. 0004A8 |   2 | (3)        |   short AmigaVBLDivisor /* InitialTempo */
  102.        |     |            | }
  103. -------+-----+------------+-------------------------------------------------
  104.        |     |            | Song_Length {
  105. 0004AA |   4 | "SLEN"     |   char  chunk_name[4]
  106. 0004B2 |   4 | 2          |   long  chunk_len
  107. 0004B6 |   2 | (60t)      |   short value
  108.        |     |            |         /* it specifies the number of different
  109.        |     |            |            patterns this module has.
  110.        |     |            |            (can be used as counter for the "PBOD"
  111.        |     |            |            chunks) */
  112.        |     |            | }
  113. -------+-----+------------+-------------------------------------------------
  114.        |     |            | Num_Pattern_Positions { /* "PatternLength" */
  115. 0004B8 |   4 | "PLEN"     |   char  chunk_name[4]
  116. 0004BC |   4 | 2          |   long  chunk_len
  117. 0004BE |   2 | (15t)      |   short num_positions
  118.        |     |            |         /* it specifies the number of entries in
  119.        |     |            |            the pattern table (see "PATT" below) */
  120.        |     |            | }
  121. -------+-----+------------+- - - - - - - - - - - - - - - - - - - - - - - - -
  122.        |     |            | Pattern_Positions {
  123. 0004C0 |   4 | "PATT"     |   char  chunk_name[4]
  124. 0004C4 |   4 | (128t ?)   |   long  chunk_len
  125.        |     |            |         /* (it seems that the length of this chunk
  126.        |     |            |             is always set to 128) */
  127. 0004C8 | 128t|            |   byte  position[*]
  128.        |     |            |         /* zero *is* a valid value in this field.
  129.        |     |            |            it means that pattern number 0 should
  130.        |     |            |            be played. the number of valid positions
  131.        |     |            |            is specified by the "PLEN" chunk. */
  132.        |     |            | }
  133. =======+=====+============+=================================================
  134.        |     |            | Pattern1 {
  135. 000548 |   4 | "PBOD"     |   char  chunk_name[4]            )
  136. 00054C |   4 | (0702      |   long  chunk_len               (  up to 64
  137.        |     |  or 0602)  |                                  > patterns are
  138. 00054E |   2 | (64t)      |   short num_pattern_lines       (  supported
  139. 000550 |  ...|            |   byte  Pattern1_Line[*]         )
  140.        |     |            |         /* see below */
  141.        |     |            | }
  142. ...    |     |            |
  143. =======+=====+============+=================================================
  144.        |     |            | Sample1 {
  145. 0..... |   4 | "SBOD"     |   char  chunk_name[4]            ) up to 255* is
  146. 0..... |   4 |            |   long  chunk_len               (_ possible but
  147. 0..... |  ...|            |   byte  sample_data[*]          (  mostly limited
  148. ...    |     |            |         /* 8 bit signed data */  ) to 36*
  149.        |     |            | }
  150. ...    |     |            |
  151. =======+=====+============+=================================================
  152. Values in parentheses are examples and may vary.
  153. (If you choose the faster methode to check the chunk types using a 'long'-
  154. value, don't forget to exchange the byte order on LSB-systems.)
  155.  
  156. There are 36 effects, instruments and notes. In the original Oktalyzer
  157. editor they are entered using the 10 digits and the 26 letters, that's
  158. why 36.
  159. ____
  160.  
  161. A pattern line (PBOD chunks) looks like follows:
  162.  
  163. After the 16-bit num_pattern_lines are that many lines of pattern data,
  164. each line containing four bytes for each active channel.
  165. For example, in a 6-channel module, each line is 24 bytes.
  166.  
  167. The four bytes of one channel are:
  168.  
  169.     unsigned char newnote,
  170.     unsigned char instrument, /* sample */
  171.     unsigned char effect,
  172.     unsigned char data        /* effect parameter */
  173.  
  174. If newnote is nonzero, start playing a different note. There are 36 pitches,
  175. 1-36 (see pertab below).
  176.  
  177. Set the current channel's volume to the sample's volume.
  178. 'instrument' indicates which sample to use.
  179.  
  180. Whether or not newnote is nonzero, process 'effect' and 'data' (see effects
  181. below).
  182. ___
  183.  
  184. Oktalyzer uses the following period table, which is the same as for ST/NT/PT-
  185. Mod-Files. (converted to C actually, but the same numbers)
  186.  
  187. static short pertab[] =
  188. {
  189. /*  C    C#     D    D#      E     F    F#     G    G#      A    A#     B */
  190.  0x358,0x328,0x2FA,0x2D0, 0x2A6,0x280,0x25C,0x23A, 0x21A,0x1FC,0x1E0,0x1C5,
  191.  0x1AC,0x194,0x17D,0x168, 0x153,0x140,0x12E,0x11D, 0x10D, 0xFE, 0xF0, 0xE2,
  192.   0xD6, 0xCA, 0xBE, 0xB4,  0xAA, 0xA0, 0x97, 0x8F,  0x87, 0x7F, 0x78, 0x71
  193. };
  194.  
  195. The extended octaves 0 and 4 which might be found in other formats are not
  196. used here.
  197. ____
  198.  
  199. The Oktalyzer format defines the following effects (decimal):
  200.  
  201.  1  Portamento down: decrease period of current sample by 'data',
  202.                      once every 50Hz clock tick.
  203.  2  Portamento up:   increase period of current sample by 'data',
  204.                      once every 50Hz clock tick.
  205.  
  206. 10  Arpeggio 3: Change note every 50Hz tick between L,N,H
  207. 11  Arpeggio 4: Change note every 50Hz tick between N,H,N,L
  208. 12  Arpeggio 5: Change note every 50Hz tick between H,H,N
  209.                 N = normal note being played in this channel (1-36)
  210.                 L = normal note number minus upper four bits of 'data'.
  211.                 H = normal note number plus  lower four bits of 'data'.
  212.  
  213. 13  Decrease note number by 'data' once per tick.
  214. 17  Increase note number by 'data' once per tick.
  215. 21  Decrease note number by 'data' once per line.
  216. 30  Increase note number by 'data' once per line.
  217.  
  218. 15  Amiga low-pass filter control: 'data' indicates the new setting.
  219.  
  220. 25  Position jump: Instead of going to the next line after this one,
  221.           instead jump to the beginning of pattern number 'data'.
  222.  
  223. 27  Release: start playing the release phase of the currently playing
  224.              sample.
  225.  
  226. 28  Set speed (number of 50Hz ticks between advancing lines) to 'data'.
  227.  
  228. 31  Volume control:
  229.       If 'data' <= 0x40, set the volume of this channel to 'data'.
  230.       If 0x41 <= 'data' <= 0x50, decrease volume by 'data' - 0x40
  231.                                  every 50Hz clock tick (fast fade out).
  232.       If 0x51 <= 'data' <= 0x60, increase volume by 'data' - 0x50
  233.                                  every 50Hz clock tick (fast fade in).
  234.       If 0x61 <= 'data' <= 0x70, decrease volume by 'data' - 0x60
  235.                                  at the beginning of every line (slow fade out).
  236.       If 0x71 <= 'data' <= 0x80, increase volume by 'data' - 0x70
  237.                                  at the beginning of every line (slow fade in).
  238.  
  239. --
  240. There seems to be much room for future extentions, eg. panning.
  241.  
  242. ... now it's complete? (HZ)
  243.  
  244. -----------------------------------------------------------------
  245.  
  246. Harald
  247.  
  248. --
  249. >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<
  250.  zappe@gaea.sietec.de              |  |
  251.                                    |--+-              everything is relative
  252.  Harald Zappe                      |  |/              nothing is for infinity
  253.  work: +49-30-386-28328/29            /               quantity is not quality
  254.  home: +49-30-ASK-ME                 /___              
  255.  
  256.  
  257.