home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / amiga / players / modplyrs / dstrckr2.lha / DTL / docs / Structures.DOC < prev   
Text File  |  1993-12-17  |  42KB  |  1,067 lines

  1.        destracker.library Release 2.00 (library ver 3.0) Documentation
  2.  
  3.                               as of Dec 18, 1993
  4.  
  5.                           Written by Darren Schebek
  6.  
  7.           destracker.library, LScope, DTC, mJuke,and MODInfo are all
  8.                     Designed and written by Darren Schebek
  9.                     Copyright ⌐1992,1993 by Darren Schebek
  10.                              All rights reserved
  11.  
  12.  
  13.  
  14.                        Library Structures Documentation
  15.                        --------------------------------
  16.  
  17.  
  18.     This file contains documentation regarding the custom structures used by
  19. destracker.library.  All instances of these structures created by the library
  20. can be accessed via the library base structure.  Like any other amiga library,
  21. you get a pointer to the library base structure when you open the library.
  22. The library base structure itself is also documented here.
  23.  
  24.     All of these structures are defined in the file DTLib.I (as well as its C
  25. counterpart, dtlib.h).  C users can disregard any references to "LABEL"
  26. fields, as these are only required for assembly language (they are equates for
  27. the size of a structure, e.g. "LABEL pe_SIZE" = "sizeof(struct PATHENTRY);" in
  28. C).
  29.  
  30.     Please note that new fields have been added to some of these structures
  31. for version 3.0 of the library.  They are noted as such.
  32.  
  33.  
  34.                -----------------------------------------------
  35.  
  36.                           The MODULESTATUS Structure
  37.  
  38.  
  39.     The MODULESTATUS structure contains information which is specific to a
  40. given song module.  The fields of this structure are valid only while a song
  41. module is currently loaded.  If no module is loaded, their contents are
  42. unpredictable and consequently useless.  You can look at the DTLibs.I file to
  43. see the definition of the MODULESTATUS structure (or DTLib.h), so I'll just
  44. describe each field here in the order that they appear in the structure
  45. definition.
  46.  
  47.     Note that, as of release 1.5 of DES-Tracker, two new fields have been
  48. appended to this structure (ms_Pathname and ms_Filename).  As a result, those
  49. of you who'd like to update to release 1.5 (and future releases) of
  50. DES-Tracker will have to recompile any programs that use older versions of
  51. DES-Tracker using the new DTLib.I file included in this package.  Sorry for
  52. the inconvenience.
  53.  
  54.     Also, three new fields have been added to this structure for release 2.00
  55. of DES-Tracker (library version 3.0).  They are appended to the end and are
  56. indicated as being new in the descriptions below.
  57.  
  58.  
  59. APTR    ms_Name
  60.  
  61.     The ms_Name field is a pointer to a NULL-terminated string of text. The
  62. text in this case is the title of the song, extracted from the module file
  63. when it was loaded.  Because of the rather deranged concepts used in the
  64. design of the Noisetracker/Soundtracker file formats, this name will only ever
  65. be a maximum of 20 characters long (for now. With the advent of support for
  66. newer formats, this limitation may be eradicated, so don't assume that the
  67. name string will always be 20 chars long).  This length does not include the
  68. terminating NULL at the end of the string.
  69.  
  70.  
  71. ULONG   ms_Length           (Contents altered slightly as of lib v3.0)
  72.  
  73.     This longword field contains the length of the module in memory.  Note
  74. that the song as it sits in memory has been converted from whatever file
  75. format it was in when it was loaded to DES-Tracker v1.0 format.  Therefore,
  76. the length indicated here is the length of the song module if you were to save
  77. it out in DES-Tracker v1.0 file format.  You may notice that this length is
  78. almost always shorter than the length of the file in Noisetracker, Protracker,
  79. or Soundtracker format.  It's quite efficient.
  80.  
  81.  
  82. APTR    ms_PlaySeqArray     (New field for release 2.00, lib v3.0)
  83.  
  84.     This field holds a pointer to the currently loaded song module's play
  85. sequence array.  The array is composed of double-longword elements.  Each
  86. element consists of four words.  Each word is a pattern number to play; one
  87. for each audio channel.  The array is indexed with the current song position
  88. and so there are "numpositions" elements in the array.
  89.  
  90.  
  91. APTR    ms_PatternData      (New field for release 2.00, lib v3.0)
  92.  
  93.     This field holds a pointer to the currently loaded song module's pattern
  94. data.  A pattern is an array of 64 longwords.  Each longword is a note event
  95. that is to be processed for a single, arbitrary audio channel.  All patterns
  96. reside in memory contiguously.  The "ms_PatternData" field points to the first
  97. element of pattern #0.  256 bytes beyond this point lies the first element of
  98. pattern #1, then pattern #2, etc.
  99.  
  100.  
  101. APTR    ms_InstInfoBlocks   (New field for release 2.00, lib v3.0)
  102.  
  103.     This points to 31 instrument info blocks as extracted (verbatim) from the
  104. song module file itself.  Each instrument info block is 30 bytes in size and
  105. looks like this:
  106.  
  107.         char[22]  Name of the instrument.
  108.         UWORD     Length of instrument's sample data in words.
  109.         BYTE      Fine tune value for this instrument (-8..+7).
  110.         UBYTE     Default volume for this instrument (0..64).
  111.         UWORD     Offset to repeat start position for inst sample in words.
  112.         UWORD     Length of the instrument sample's repeat loop in words.
  113.  
  114.     This pointer is useful if you require access to all instrument info blocks
  115. in the song module, rather than just those that actually have instrument
  116. samples associated with them (which is what ms_Instruments gives you).
  117.  
  118.  
  119. UBYTE   ms_Format
  120.  
  121.     This byte field contains a value reflecting what file format a module on
  122. disk was when it was loaded, regardless of the fact that it is converted to
  123. DES-Tracker v1.0 format once it's loaded into memory.  If the module was in
  124. Soundtracker v2.6 format, then this field will contain MF_SOUNDTRACKER.  If
  125. the module was in either Noisetracker v2.0 or Protracker v1.1a and up, then
  126. this field will contain MF_NOISETRACKER (Noisetracker and Protracker file
  127. formats are identical).  If the file loaded was in DES-Tracker v1.0 ("DTL0")
  128. format, then this field will contain MF_DESTRACKER.  These labels are defined
  129. in DTLib.I and DTLib.H.
  130.  
  131.  
  132. UBYTE   ms_Version
  133.  
  134.     This field contains the version number of the format of the module that
  135. was loaded.  For example, if the module was in Noisetracker v2.0 format, then
  136. this field will contain the value 2 (the number to the left of the decimal
  137. point).
  138.  
  139.  
  140. UBYTE   ms_Revision
  141.  
  142.     This field contains the revision number of the format of the module that
  143. was loaded.  For Noisetracker v2.0, this field contains 0.  For Soundtracker
  144. v2.6 format, this field will contain 6.
  145.  
  146.  
  147. UBYTE   ms_Reserved
  148.  
  149.     This field is reserved and should always contain 0.
  150.  
  151.  
  152. APTR    ms_Instruments
  153.  
  154.     This is a pointer to the first INSTSTATUS structure in a linked list.
  155. This list contains one INSTSTATUS structure for each instrument used in a
  156. module.  It does NOT contain 31 INSTSTATUS structures.  If a module only uses
  157. three of the 31 possible instrument slots, then there will only be three
  158. INSTSTATUS structures in this list.  See the explanation a bit further down
  159. from here for the INSTSTATUS structure fields.
  160.  
  161.  
  162. UWORD   ms_NumPatterns
  163.  
  164.     This field contains the number of unique patterns comprising the module.
  165. In this context, a "pattern" is made up of 256 bytes that describe 64 notes to
  166. be played in a single arbitrary audio channel.  This value can be greater than
  167. 256.  If it is, then the song module in memory cannot be saved out in
  168. Soundtracker v2.6 format, since that format can only handle up to 256 unique
  169. patterns.  However, DES-Tracker v1.0 supports 65,535 patterns, so the module
  170. can be saved in that format.  Song modules can always be saved in
  171. Noisetracker/Protracker format.
  172.  
  173.  
  174. UWORD   ms_NumPositions
  175.  
  176.     This contains the number of positions in the song, which would be
  177. analogous to the number of measures in real musical notation.  When playing a
  178. module, play normally begins at position 0 and ends at this position, whereby
  179. the module either stops or repeats (although with this library you can start
  180. and stop play at any point in a module).
  181.  
  182.  
  183. APTR    ms_Pathname         (New field as of release 1.5)
  184.  
  185.     This is a pointer to the path specification from which the currently
  186. loaded module was loaded from.  It is a NULL-terminated string.  If you call
  187. the SaveModule() function with no parameters, then the path specified here
  188. will be used to save the module in memory.  Also, if you call SaveModule()
  189. with a different path/filename, then this field will then point to the new
  190. path afterwards.  This is a new field in the MODULESTATUS structure as of
  191. release 1.5 of DES-Tracker.
  192.  
  193.  
  194. APTR    ms_Filename         (New field as of release 1.5)
  195.  
  196.     This is a pointer to the filename of the currently loaded module.  If you
  197. call SaveModule() with no parameters, then the filename used will be the one
  198. pointed to by this field.  Calling SaveModule() with a new filename will cause
  199. this field to point to the new filename after the save operation is completed.
  200. This is a new field in the MODULESTATUS structure as of release 1.5 of
  201. DES-Tracker.
  202.  
  203.  
  204. LABEL   ms_SIZE
  205.  
  206.     This is merely an equate. ms_SIZE is equated to the size of the
  207. MODULESTATUS structure.
  208.  
  209.  
  210.                -----------------------------------------------
  211.  
  212.                            The INSTSTATUS Structure
  213.  
  214.  
  215.     The INSTSTATUS structure contains information for a single instrument used
  216. by a module.  When a module is loaded, a linked list of these INSTSTATUS
  217. structures is created, with one INSTSTATUS structure for each instrument slot
  218. that is actually used by the module (see MODULESTATUS structure docs above).
  219. Like the MODULESTATUS structure, the contents of an INSTSTATUS structure are
  220. only valid while a module is loaded.  Here is an explanation of each field in
  221. the INSTSTATUS structure.
  222.  
  223.  
  224. APTR    is_Next
  225.  
  226.     This is a pointer to the next INSTSTATUS structure in the linked list.  If
  227. this is the last structure in the list, then this field will contain NULL.
  228.  
  229.  
  230. APTR    is_Name
  231.  
  232.     This field contains a pointer to the name of the instrument as a
  233. NULL-terminated text string.  It bothers me to no end when people write
  234. messages over top of the instrument names (Grrrr!).  At least they could use
  235. empty instrument slots for this, but NOoooooo. :)  Oh well.
  236.  
  237.  
  238. APTR    is_Address
  239.  
  240.     This field contains a pointer to the actual instrument raw sample data.
  241.  
  242.  
  243. ULONG   is_Length
  244.  
  245.     The length of the raw instrument sample data is stored here.  The length
  246. stored here is the length of the sample data in BYTES, NOT words.  Keep this
  247. in mind.
  248.  
  249.  
  250. ULONG   is_Repeat
  251.  
  252.     This field contains the offset in BYTES from the beginning of the
  253. instrument sample data to the start of the repeat portion of the instrument.
  254.  
  255.  
  256. ULONG   is_RepeatLen
  257.  
  258.     This field contains the length of the repeat portion of the instrument
  259. sample data in BYTES.
  260.  
  261.  
  262. UBYTE   is_Number
  263.  
  264.     This field contains the number of the slot used by this instrument.  There
  265. are 31 possible slots available for use in a module file.  Slots are numbered
  266. starting at 1 and going up to and including 31.  Although unused slots are
  267. ignored when building the INSTSTATUS structure list, each instruments slot
  268. number remains pristine.
  269.  
  270.  
  271. BYTE   is_FineTune
  272.  
  273.     This field holds the fine tune amount for the instrument.  It is almost
  274. always 0, partly because most people who sample instruments do things right,
  275. but mostly because this field is only supported by the Protracker editor.  The
  276. range of the fine tune value is -8..7 inclusive.  Fine tune can also be used
  277. for precision synching of special looping samples that are to be timed with
  278. the music (e.g. a single sample of a complete drum beat that must be timed
  279. perfectly with the rest of the music.  Since percussion instruments have no
  280. discernable pitch per se, altering their pitch with the fine tune value does
  281. not typically affect the sound of the drums in a bad way).
  282.  
  283.  
  284. UBYTE   is_Volume
  285.  
  286.     This byte field contains the default volume of the instrument.  This is a
  287. value from 0..64 inclusive.  0 is silent, and 64 is maximum volume.
  288.  
  289.  
  290. UBYTE   is_Reserved
  291.  
  292.     This is a reserved field and should always be set to 0.
  293.  
  294.  
  295. LABEL   is_SIZE
  296.  
  297.     This is an equate.  It is defined as the size of the INSTSTATUS structure.
  298.  
  299.  
  300.                -----------------------------------------------
  301.  
  302.                          The CHANNELSTATUS Structure
  303.  
  304.  
  305.     The CHANNELSTATUS structure contains real-time information about a single
  306. audio channel.  The information in a CHANNELSTATUS structure is only valid
  307. when a loaded module is playing.  If the module is not playing (or if no
  308. module is loaded) then the information in this structure is invalid.   Here is
  309. a rundown of the fields in the CHANNELSTATUS structure.
  310.  
  311.  
  312. UBYTE   cs_Note
  313.  
  314.     This field contains the last note played in the audio channel in the form
  315. of a value from 0..35 inclusive. 0 is the lowest pitch and 35 is the highest
  316. pitch.
  317.  
  318.  
  319. UBYTE   cs_Octave
  320.  
  321.     This holds the octave number of the last note played, which is a value
  322. from 0..2 inclusive.  0 is the lowest octave.  This value is derived from the
  323. cs_Note field by dividing its contents by 12.  This value is provided for your
  324. convenience.
  325.  
  326.  
  327. UBYTE   cs_NoteNum
  328.  
  329.     This holds the number of the last note played relative to the octave in
  330. which it is played.  It is a value from 0..11 inclusive.  This value is
  331. derived from the contents of cs_Note by taking the remainder of (cs_Note/12).
  332. This field, like cs_Octave above, is provided for your convenience.
  333.  
  334.  
  335. UBYTE   cs_Volume
  336.  
  337.     This field contains the current volume of the audio channel, which is a
  338. value from 0..64 inclusive.  Note that any adjustment of the global volume
  339. (see SetGlobalVolume function in LibFuncs.DOC) will not be reflected here,
  340. even though reducing global volume causes you to *hear* a reduction in global
  341. volume.  This value is always updated whenever the volume of the channel is
  342. altered (not just when a note is first played, like the fields above).
  343.  
  344.  
  345. UBYTE   cs_RealVolume       (New field for release 2.00, lib v3.0)
  346.  
  347.     This field contains the current volume of the audio channel with global
  348. volume applied to it.  It is updated whenever the channel volume changes and
  349. also whenever the global volume is changed.  Its range is 0..64 inclusive.
  350.  
  351.  
  352. UBYTE   cs_Pad              (New field for release 2.00, lib v3.0)
  353.  
  354.     This is a reserved field and always contains zero.  Not terribly useful or
  355. even interesting, really. :)
  356.  
  357.  
  358. UWORD   cs_Period
  359.  
  360.     The period of the note in the current channel is stored here, and is
  361. updated whenever the period of the channel is changed (not just when a note is
  362. first played).  This means that you can get accurate period status on an audio
  363. channel through pitch bends and slides.
  364.  
  365.  
  366. APTR    cs_Instrument
  367.  
  368.     This field contains a pointer to the INSTSTATUS structure of the
  369. instrument last used in this audio channel.  Using this field you can get all
  370. sorts of info on an instrument as soon as it is used, whenever it is used.
  371.  
  372.  
  373. ULONG   cs_SampleOffset     (New field for release 2.00, lib v3.0)
  374.  
  375.     Whenever a new note hit occurs in an audio channel, it may use the "Sample
  376. Offset" command.  This causes the instrument's sample to start playing from a
  377. position other than the beginning of the sample.  If this happens then the
  378. "cs_SampleOffset" field here will contain the offset from the beginning of the
  379. instrument's sample data that was used.
  380.  
  381.  
  382. LABEL   cs_SIZE
  383.  
  384.     This is an equate.  It is defined as the size of the CHANNELSTATUS
  385. structure.
  386.  
  387.                -----------------------------------------------
  388.  
  389.                            The PATHENTRY Structure
  390.  
  391.  
  392.     As of release 1.5, DES-Tracker can now remember multiple search paths to
  393. be used by the LoadModule() function when it is looking for a specified module
  394. to load.  These search paths are kept in a linked list (see the
  395. 'dtl_ModPathList' field of the library base structure).
  396.  
  397.     Each search path in the linked list is stored as a PATHENTRY structure,
  398. since PATHENTRY structures can be linked together (whereas text strings
  399. can't).  The structure contains only two fields.  The actual text string that
  400. is the search path begins immediately after the pe_Length field.  The string
  401. itself is always NULL-terminated.
  402.  
  403.  
  404. APTR    pe_Next
  405.  
  406.     This is the field that allows PATHENTRY structures to be linked together.
  407. the contents of this field is a pointer to the next PATHENTRY structure in the
  408. linked list, or else it contains NULL (0) meaning that this is the last
  409. PATHENTRY in the list.
  410.  
  411.  
  412. UWORD   pe_Length
  413.  
  414.     This field contains the length of the text string immediately following
  415. this field.  The length includes the string's terminating NULL character.
  416. This length value does NOT include the size of the PATHENTRY structure - only
  417. the text string appended to it.
  418.  
  419.  
  420. LABEL   pe_SIZE
  421.  
  422.         This is an equate defined as the size of the PATHENTRY structure (NOT
  423. including the pathname string appended to it).
  424.  
  425.  
  426.                -----------------------------------------------
  427.  
  428.                           The TIMESCANINFO Structure
  429.                   (New structure for release 2.00, lib v3.0)
  430.  
  431.  
  432.     This structure is used in conjunction with the CalcElapsedTime() function.
  433. You fill out a TIMESCANINFO structure and pass a pointer to it to the
  434. CalcElapsedTime() function.  The function, in turn, will fill out a couple of
  435. fields in the structure for you (i.e., the calculated elapsed time for playing
  436. the song).
  437.  
  438.     Note that the Start Position/Note must always be "less" than the End
  439. Position/Note (by "less" I mean that the start point must be earlier in the
  440. song than the end point, even if it's only by a single note).  Anyway, here's
  441. a description of the individual fields.
  442.  
  443.  
  444.  
  445. UBYTE   tsi_StartPos
  446.  
  447.     CalcElapsedTime() requires a start point and an end point for its
  448. calculations.  You store the position number of the start point here.  This
  449. value ranges from 0..ms_NumPositions-1 (see MODULESTATUS structure above).
  450.  
  451.  
  452. UBYTE   tsi_StartNote
  453.  
  454.     Here you store the note number within the start position.  This is a value
  455. from 0..63 inclusive.  A value of 0 means the first note of the start
  456. position, 1 means the second note, etc.
  457.  
  458.  
  459. UBYTE   tsi_EndPos
  460.  
  461.     You store the position number of the end point here.  This field follows
  462. the same rules as tsi_StartPos above.
  463.  
  464.  
  465. UBYTE   tsi_EndNote
  466.  
  467.     You store the note number within the end position here.  Like
  468. tsi_StartNote, this is a value from 0..64.
  469.  
  470.  
  471. UBYTE   tsi_Flags
  472.  
  473.     This field contains three flags.  They are as follows:
  474.  
  475.     Bit 0   TSIB_MULTIPLEITERS
  476.  
  477.         It takes time to calculate the time it will take to play a song for
  478.         one iteration.  It then goes without saying that it will take even
  479.         longer to calculate the time for two iterations.  But in many songs,
  480.         iterations after the first one can take less time (because the song
  481.         may loop back to a position other than the beginning of the song).
  482.         This flag tells CalcElapsedTime() whether to calculate elapsed time
  483.         for just one iteration, or to calculate the time for an extra
  484.         iteration as well (all iterations after the first one take the same
  485.         time).  By setting this bit, CalcElapsedTime() will calculate an extra
  486.         iteration for you.
  487.  
  488.     Bit 1   TSIB_TEMPOINTERP
  489.  
  490.         This flag tells CalcElapsedTime how to interpret tempo commands it may
  491.         come across while scanning the music.  If this bit is clear (0), then
  492.         the operand for a tempo command will be interpreted as such:
  493.  
  494.             Operand     Interpretation
  495.              0..31      Normal tempo command
  496.             32..255     Set BPM tempo command
  497.  
  498.         If the bit is set to 1, then all tempo command operands are treated as
  499.         normal tempos (i.e., BPM tempos no longer occur - all values for the
  500.         tempo command operand are treated as normal tempo values).
  501.  
  502.     Bit 2   TSIB_TIMINGMODE
  503.  
  504.         This flag indicates the initial base timing for the scan.  If this bit
  505.         is clear, then the initial base timing will be 60Hz.  If it is set,
  506.         then the initial base timing will be 50Hz.
  507.  
  508.  
  509. UBYTE   tsi_DefaultTempo
  510.  
  511.     Here you store the default (initial) tempo of the song for the music scan.
  512. This is the same type of value as contained in the dtl_DefaultTempo field in
  513. the library base structure (described below).
  514.  
  515.  
  516. UBYTE   tsi_FineTempo
  517.  
  518.     You store the desired fine tempo setting for the music scan here.  This is
  519. a signed value in the range -128..+127.  Each fine tempo unit represents a
  520. change in the overall tempo of the song by 0.078125Hz.  So, a value of +30
  521. would increase the overall tempo of the song by (30 * 0.078125Hz) = +2.34Hz.
  522. In the extremes, a value of +127 increases the tempo by +10Hz, and -128
  523. Slows down the tempo by 10Hz.
  524.  
  525.  
  526. UBYTE   tsi_Pad
  527.  
  528.     This is a reserved field and should always contain 0.
  529.  
  530.  
  531. ULONG   tsi_FirstIterTime
  532.  
  533.     This field is filled out for you by the CalcElapsedTime() function.  It
  534. holds the calculated play time for the first iteration of the play sequence
  535. described by the TIMESCANINFO structure parameters.  This play time value is
  536. in units of 60ths of a second.
  537.  
  538.  
  539. ULONG   tsi_ConsecIterTime
  540.  
  541.     If you set the TSIB_MULTIPLEITERS flag in the tsi_Flags field, then this
  542. field will contain the play time for consecutive iterations of the song (i.e.,
  543. iterations of the song after the song plays through once).  This value is also
  544. in 60ths of a second.  If you want to know the total play time of a song for n
  545. iterations, then the formula is as follows:
  546.  
  547.     TotalTime = tsi_FirstIterTime + (tsi_ConsecIterTime * (n-1))
  548.  
  549.     The result (TotalTime) is of course in units of 60ths of a second.
  550.  
  551.  
  552.                -----------------------------------------------
  553.  
  554.                           The LIBRARY BASE Structure
  555.  
  556.  
  557.     DES-Tracker's library base structure contains a plethora of information
  558. about not only a loaded module, but also real-time play status info, as
  559. well as current settings of all library parameters.  You do not need to own
  560. the library to read the info in the library base structure, and you can
  561. read this structure even if someone else has owned the library.
  562.  
  563.     It is important to note that ALL fields in the library base structure are
  564. READ ONLY.  Do not write values to any fields in this structure.  Use the
  565. library routines.
  566.  
  567.     It is also advisable that you own the library as soon as you open it
  568. (provided someone else has not already done so) using the OwnPlayer()
  569. function.  This will prevent others from mucking about with the library while
  570. you're using it, since most library functions will be locked out to everyone
  571. but you.  Of course, anyone can *see* what you're doing with the library by
  572. simply examining the library base structure, and this is exactly what the
  573. LScope program does.  Also, certain functions like CalcElapsedTime(), as well
  574. as the status signal functions are always available to everyone regardless of
  575. who might own the library.
  576.  
  577.     Anyway, here is an explanation of each field in the library base structure
  578. (excluding the standard library structure fields, that is).
  579.  
  580.  
  581. APTR    dtl_SysLib
  582.  
  583.     This field contains a pointer to Exec Base that you can use.
  584.  
  585.  
  586. APTR    dtl_DosLib
  587.  
  588.     This field contains a pointer to the dos library base structure for you to
  589. use.  If you open destracker.library, then you won't need to open
  590. dos.library, as this is already done for you. :)
  591.  
  592.  
  593. APTR    dtl_RexxSysLib
  594.  
  595.     This is a pointer to the Rexx Syslib base structure.  You shouldn't need
  596. to use this.  It's mostly just for me.
  597.  
  598.  
  599. APTR    dtl_SegList
  600.  
  601.     This is a sacred field for internal library use only.  Oooo.  Don't muck
  602. about with it.
  603.  
  604.  
  605. APTR    dtl_System
  606.  
  607.     Another sacred field.
  608.  
  609.  
  610. UBYTE   dtl_SysFlags
  611.  
  612.     Yet another sacred field.
  613.  
  614.  
  615. UBYTE   dtl_WhichTimer      (New field for release 2.00, lib v3.0)
  616.  
  617.     This field tells you which CIA timer is being used by DES-Tracker.  It
  618. holds one of the following values:
  619.  
  620.       Value   Timer being used:
  621.  
  622.         0     CIA A, Timer A
  623.         1     CIA A, Timer B
  624.         2     CIA B, Timer A
  625.         3     CIA B, Timer B
  626.  
  627.     Another way of looking at it is this: Bit 1 of the dtl_WhichTimer field
  628. tells you which CIA is being used (0=CIA A, 1=CIA B) and bit 0 tells you which
  629. timer on that CIA is being used (0=Timer A, 1=Timer B).
  630.  
  631.  
  632. APTR    dtl_ModPathList
  633.  
  634.     This field contains a pointer to the first entry in a linked list of
  635. PATHENTRY structures.  A PATHENTRY structure defines a single search path for
  636. use by the LoadModule() routine.  If the list is empty, then this field
  637. contains NULL.  See the description of the PATHENTRY structure above for more
  638. information regarding this.  See also the LoadModule() function description in
  639. the LibFuncs.DOC file.
  640.  
  641.  
  642. UWORD   dtl_Flags
  643.  
  644.     This is a very useful field.  This field contains 16 flags that you can
  645. use for various means.  They are as follows (accompanied by their bit position
  646. within the word. They are listed in bit order from left to right).
  647.  
  648.     Bit 15  DF_LIBLOCKED
  649.  
  650.         This bit is set to 1 whenever someone has owned the library (see the
  651.         OwnPlayer function in LibFuncs.DOC).  If it is 0, then everyone has
  652.         access to all library functions.
  653.  
  654.     Bit 14  DF_MODULECHANGED
  655.  
  656.         This bit toggles between 0 and 1 whenever a physical change is made to
  657.         a currently loaded module (i.e. if it is retitled or has its tempo
  658.         altered real permanent-like).  To accurately monitor changes to a
  659.         module, you should monitor this bit from an interrupt (a vblank may
  660.         do, but a timer interrupt works better, although timer interrupt
  661.         sources are at a premium).  This bit is only valid if a module is
  662.         loaded into memory.
  663.  
  664.     Bit 13  DF_LOOPINTENT
  665.  
  666.         Although the description of this bit (the next paragraph) still
  667.         stands, it should be noted that this field is pretty much useless now.
  668.         This is because of the addition of the Iterations field in the PSC0
  669.         construct appended to the end of all song modules saved from
  670.         DES-Tracker (except DES-Tracker v1.0 format ("DTL0") which doesn't
  671.         need a PSC) construct appended to it).
  672.  
  673.         This bit is essentially ignored by the library itself, although the
  674.         library has a function that allows you to set/clear it.  It purpose is
  675.         for users that need to know whether a song is meant to loop (as
  676.         opposed to playing once and finishing).  When you load save a song
  677.         back to disk (using SaveModule), the status of this bit is saved along
  678.         with the song.  That way, when you load the song some other time, you
  679.         can check this bit to see if the song is supposed to loop or not and
  680.         act accordingly (e.g. you could play the song for 2 iterations instead
  681.         of 1 and fade the song out on the second iteration.  The Jukebox.rexx
  682.         program included with this package does exactly this).
  683.  
  684.     Bit 12  DF_AUTOTIMING
  685.  
  686.         This is the auto-timing detection flag (see SetAutoTiming function in
  687.         LibFuncs.DOC).  If this bit is set, then auto timing is enabled and
  688.         the library will automatically switch to the timing mode (50 or 60Hz)
  689.         whenever a song is loaded that contains a PSC0 construct (see
  690.         DTLib.DOC about the PSC0 construct).  If the bit is 0, then auto
  691.         timing is disabled and must be set manually (using the SetAutoTiming
  692.         function).
  693.  
  694.     Bit 11  DF_CH3NOTEHIT
  695.  
  696.         This bit toggles between 0 and 1 whenever a new note is played in
  697.         audio channel #3.  This bit is unaffected by effects such as pitch
  698.         bends, etc.  It only reflects new note hits (not modifications to a
  699.         playing note).  Of course, this bit is only valid if a module is
  700.         actually playing.
  701.  
  702.     Bit 10  DF_CH2NOTEHIT
  703.  
  704.         Same as bit 11 above, but reflects new note hits in audio channel #2
  705.         instead.
  706.  
  707.     Bit 9   DF_CH1NOTEHIT
  708.  
  709.         Same as bit 11 above, but applies to audio channel #1.
  710.  
  711.     Bit 8   DF_CH0NOTEHIT
  712.  
  713.         Same as bit 11 above, but applies to audio channel #0.
  714.  
  715.     Bit 7   DF_PLAYING
  716.  
  717.         If this bit is set to 1, then it means a module is currently playing.
  718.         This, of course also means that a module is loaded.  If this bit is 0,
  719.         then no module is playing (but this does not necessarily tell you
  720.         whether a module is loaded or not).
  721.  
  722.     Bit 6   DF_PLAYSEQDONE
  723.  
  724.         When a play sequence is started, this bit is automatically cleared.
  725.         It will be automatically set to 1 when the play sequence is finished.
  726.         This bit is unaffected by pausing the play sequence.  It's set to 1
  727.         only when the end of the play sequence has been reached.
  728.  
  729.     Bit 5   DF_MODULELOADED
  730.  
  731.         This bit is set to 1 whenever a module is currently loaded, and it is
  732.         cleared whenever a module is unloaded from memory.
  733.  
  734.     Bit 4   DF_FILTERSTATUS
  735.  
  736.         This bit tells you if the Amiga lo-pass filter is enabled or not.  If
  737.         this bit is set to 1, then the filter is currently on.  If it's 0,
  738.         then its off.
  739.  
  740.     Bit 3   DF_CH3STATUS
  741.  
  742.         This bit holds the channel enabled status for audio channel #3.  If
  743.         this bit is set to 1, then audio channel #3 is enabled.  If it is 0,
  744.         then audio channel #3 is disabled and can be used by other
  745.         applications without library player interference.
  746.  
  747.     Bit 2   DF_CH2STATUS
  748.  
  749.         Same as bit 3 above, but applies to audio channel #2 instead.
  750.  
  751.     Bit 1   DF_CH1STATUS
  752.  
  753.         Same as bit 3 above, but applies to audio channel #1.
  754.  
  755.     Bit 0   DF_CH0STATUS
  756.  
  757.         Same as bit 3 above, but applies to audio channel #0.
  758.  
  759.  
  760.     Note that the above bit field names are defined in DTLib.I as bit numbers.
  761. The bit mask values for these bit fields use the same name with a prefix of
  762. "DFM_" instead of "DF_".
  763.  
  764.  
  765. UWORD   dtl_Flags2
  766.  
  767.     This field is new for release 1.2 of DES-Tracker.  As of release 1.62,
  768. another flag has been added to this field.  See the History.TXT file.
  769.  
  770.     Bit 15  DF_TEMPOINT
  771.  
  772.         This flag contains the current tempo interpretation setting.  If this
  773.         bit is clear (default), then "BPM" ("Beats" Per Minute) tempos are
  774.         enabled.  If this bit is set, then BPM tempos are disabled, and all
  775.         tempo values are treated normally.  See the "SetTempoInt" function in
  776.         the "LibFuncs.DOC" file for more information about this setting.
  777.  
  778.     Bit 14  DF_HASPSC0
  779.  
  780.         This flag is new for version 2.3 of destracker.library.  Modules saved
  781.         from DES-Tracker automatically get a special data construct appended
  782.         at the end of them.  This data construct is called a "PSC0 construct".
  783.         "PSC" means "Play Status Construct", and it contains the kind of
  784.         information that should have been made a part of the tracker module
  785.         file format in the first place.  Things like the default timing (50/60
  786.         hertz), # of iterations, etc.  This flag is either set or cleared by
  787.         the LoadModule() function when it loads a new module from disk.  If
  788.         this flag is set when LoadModule() returns, then the module had a PSC0
  789.         construct appended to it.  If it's 0, then no construct was found.  A
  790.         PSC0 construct can be removed from a file by loading it into an
  791.         appropriate tracker editor and saving it back.
  792.  
  793.  
  794. UBYTE   dtl_GlobalVolume
  795.  
  796.     This field contains the current global volume setting, and is a value in
  797. the range 0..64 inclusive, with 0 being silent and 64 being maximum volume.
  798.  
  799.  
  800. BYTE    dtl_GlobalTempo
  801.  
  802.     The current global tempo can be obtained from this field. It contains a
  803. relative offset to the normal tempo of the song (i.e. 0 means normal tempo, -1
  804. means play slightly faster and +1 means play slightly slower).  The tempo is
  805. actually a delay value, which is why higher values make the song play slower,
  806. not faster.
  807.  
  808.  
  809. BYTE    dtl_FineTempo       (Contents redefined for release 2.00, lib v3.0)
  810.  
  811.     The fine tempo is a value in the range -128..127 inclusive, and is a fine
  812. global tempo adjustment.  You can use the fine tempo to adjust the playback
  813. tempo of a song by plus or minus 10Hz from the base timing frequency.
  814.  
  815.     The fine tempo value is specified in units of 0.078125Hz.  So, if you
  816. specify a fine tempo of 53 (for example), you will increase the overall tempo
  817. of the song by (53 * 0.078125) = +4.14Hz.  In the extremes, a fine tempo of
  818. -128 will slow down the tempo by -10Hz and a fine tempo of +127 will speed up
  819. the tempo by +10Hz.
  820.  
  821.     Setting the fine tempo is most useful when you have a song that uses long
  822. samples (of, for example, complete drum beats or people singing) that are not
  823. synchronized properly to the rest of the music at the base timing mode
  824. frequency.  By using fine tempo you can tweak the song's overall tempo to make
  825. these long samples synchronize properly.
  826.  
  827.     When you save a song module from DES-Tracker, it will include the fine
  828. tempo setting in the file, and will automatically set it when you load the
  829. song from then on.
  830.  
  831.  
  832. UBYTE   dtl_DefaultTempo
  833.  
  834.     Amazingly enough, some people compose tunes and use no tempo comands in
  835. them, assuming that everybody will always play the song using only the editor
  836. that they wrote it on (which has a default tempo).  Songs of this type cannot
  837. have their tempo permanently altered (using the ApplyGlobalTempo function.
  838. See LibFuncs.DOC).  Since the library therefore supports it's own adjustable
  839. default tempo, this field contains its current setting.  This field is set to
  840. 6 by default when the library is first opened.
  841.  
  842.  
  843. UBYTE   dtl_VolFadeRate
  844.  
  845.     This field contains the current rate at which volume fades occur (see
  846. FadeGlobalVolume and SetVolFadeRate functions in LibFuncs.DOC).  The higher
  847. the number, the slower the fade.
  848.  
  849.  
  850. UBYTE   dtl_Iterations
  851.  
  852.     The current number of times that a play sequence will be played (from
  853. start to end) is stored here. A value of 0 means that the play sequence, once
  854. started, will iterate forever.
  855.  
  856.  
  857. UBYTE   dtl_TimingMode
  858.  
  859.     This field contains either 0 if the current timing mode is NTSC, or 1 if
  860. the current timing mode is PAL.  DES-Tracker will default to NTSC if run on an
  861. NTSC Amiga, and PAL if run on a PAL Amiga.  Unlike some other CIA-timer
  862. players, DES-Tracker compensates for the difference between PAL and NTSC CIA
  863. base frequencies.  Betcha didn't know that. ;)
  864.  
  865.  
  866. UBYTE   dtl_SaveFormat      (Contents changed as of release 2.00, lib v3.0)
  867.  
  868.     This field contains the currently selected module save format.  Currently,
  869. it will be one of the following values:
  870.  
  871.         0   =   SoundTracker v2.6 format
  872.         1   =   NoiseTracker/ProTracker format
  873.         2   =   DES-Tracker v1.0 format ("DTL0")
  874.  
  875.     You set the module save format by using the SetSaveFormat() function.
  876. The default value is 0.
  877.  
  878.  
  879. UBYTE   dtl_PlayStatus      (New field as of release 1.6)
  880.  
  881.     This field is new for DES-Tracker release 1.6.  It contains the current
  882. play state of the library and is an added convenience to the already existing
  883. flags fields in this structure (see dtl_Flags and dtl_Flags2 above).  This
  884. field will always contain one of the following values (defined in DTLib.I and
  885. DTLib.H):
  886.  
  887.     PS_NOMODULE     = 0     No module is loaded.
  888.     PS_IDLE         = 1     Module loaded but hasn't started playing yet.
  889.     PS_PLAYING      = 2     Module is currently playing.
  890.     PS_PAUSED       = 3     Module is paused.
  891.     PS_STOPPED      = 4     Module was playing but has been stopped.
  892.     PS_PLAYSEQDONE  = 5     Module has finished playing.
  893.  
  894.  
  895. UBYTE   dtl_DefIterations   (New field as of release 2.00, lib v3.0)
  896.  
  897.     This field holds the default number of iterations for the currently loaded
  898. song module.  If the song file contained a PSC0 construct at the end of it,
  899. then this field will hold the number of iterations specified in the PSC0
  900. construct.  Once a song module is loaded, this field will NOT change if you
  901. change the number of iterations for the play sequence.
  902.  
  903.     This purpose of this field is to allow the user to know what the original
  904. number of iterations are for the song, even if the current number of
  905. iterations has been changed since the song was loaded.
  906.  
  907.     As an example of this field's use, the MODInfo program tells the user how
  908. long a given song will take to play if it is played by the mJuke program.  To
  909. do this it needs to know how many iterations the song is meant to play for.
  910. mJuke changes the number of iterations for a song (it usually adds an extra
  911. iteration which it uses for the final volume fade).  If MODInfo is run for a
  912. song that is currently playing, then MODInfo can't look at the
  913. "dtl_Iterations" field, because if mJuke is playing the song, then it has
  914. changed the number of iterations.  So, MODInfo looks instead to this field so
  915. it can then determine how many iterations mJuke will play.
  916.  
  917.     Note however, that if you save the song using the SaveModule() function,
  918. the contents of "dtl_Iterations" will be copied here.  This will reflect the
  919. new default number of iterations for the song file.
  920.  
  921.  
  922. UBYTE   dtl_IterationsToGo
  923.  
  924.     This field is only valid while a song is playing.  It holds the number of
  925. iterations remaining in the play sequence (including the iteration currently
  926. playing).  If the number of iterations (dtl_Iterations, above) is set to 0,
  927. then this field will also contain 0 (which means the play sequence will loop
  928. forever).
  929.  
  930.  
  931. UBYTE   dtl_CurPosition
  932.  
  933.     Also valid only while a song is playing, this field contains the current
  934. position in the play sequence.  A value of 0 represents the first position in
  935. the song.
  936.  
  937.  
  938. UBYTE   dtl_CurNoteIndex
  939.  
  940.     This field contains the current note index (0..63 inclusive) within the
  941. current position.  This field only valid while a song is playing.
  942.  
  943.  
  944. UBYTE   dtl_StartPosition
  945.  
  946.     This field contains the currently defined start position for the play
  947. sequence.  A value of 0 refers to the first position in the song.  This field
  948. is valid only while a module is loaded.
  949.  
  950.  
  951. UBYTE   dtl_StartNoteIndex
  952.  
  953.     Contains the start note index within the start position at which the play
  954. sequence will begin.  Range is 0..63 inclusive. Valid only while a module is
  955. loaded.
  956.  
  957.  
  958. UBYTE   dtl_EndPosition
  959.  
  960.     This contains the currently defined end position for the play sequence.
  961. This field is valid only while a module is loaded.
  962.  
  963.  
  964. UBYTE   dtl_EndNoteIndex
  965.  
  966.     Contains the end note index within the end position for the play sequence.
  967. Note that any notes/commands at this position will NOT get processed.  This
  968. field is valid only while a module is loaded.
  969.  
  970.  
  971. UBYTE   dtl_CurrentTempo
  972.  
  973.     Contains the current tempo of the song, including any adjustment caused by
  974. the global tempo setting.  This is a value from 0..255 inclusive.  0 is very
  975. fast, and 255 is treacherously slow.  A value of 6 is the default tempo for
  976. most tracker editors.  This value may change throughout the course of a song.
  977. This field is only valid while a song is playing.
  978.  
  979.  
  980. STRUCT  dtl_Channel0,cs_SIZE
  981.  
  982.     This is the CHANNELSTATUS structure for audio channel #0.  Note that this
  983. is an instance of the structure and not a pointer to one.  The contents of
  984. this structure are only valid while a song is playing.
  985.  
  986.  
  987. STRUCT  dtl_Channel1,cs_SIZE
  988.  
  989.     This is the CHANNELSTATUS structure for audio channel #1.  See the
  990. description of the CHANNELSTATUS structure earlier in this document for more
  991. information regarding this.
  992.  
  993.  
  994. STRUCT  dtl_Channel2,cs_SIZE
  995.  
  996.     The CHANNELSTATUS structure for audio channel #2.
  997.  
  998.  
  999. STRUCT  dtl_Channel3,cs_SIZE
  1000.  
  1001.     The CHANNELSTATUS structure for audio channel #3.
  1002.  
  1003.  
  1004. STRUCT  dtl_ModuleStatus,ms_SIZE
  1005.  
  1006.     This is an instance of a MODULESTATUS structure used for a module when it
  1007. is loaded.  It's contents are only valid when a module is loaded.  See the
  1008. description of the MODULESTATUS structure earlier in this document for more
  1009. information.
  1010.  
  1011.  
  1012. UBYTE   dtl_ElapsedHours
  1013.  
  1014.     This field contains the number of hours that have elapsed since a play
  1015. sequence was started.  The elapsed time is reset to 00:00:00:00 whenever a
  1016. play sequence is started.  The elapsed time is suspended whenever a play
  1017. sequence is paused, and continued when the play sequence proceeds from its
  1018. paused state.  This field contains a value from 0..255 inclusive.
  1019.  
  1020.  
  1021. UBYTE   dtl_ElapsedMinutes
  1022.  
  1023.     This field contains the elapsed minutes of a play sequence.  It ranges
  1024. from 0..59 inclusive.
  1025.  
  1026.  
  1027. UBYTE   dtl_ElapsedSeconds
  1028.  
  1029.     Contains the elapsed seconds portion of a play sequence. It's contents
  1030. range from 0..59 inclusive.
  1031.  
  1032.  
  1033. UBYTE   dtl_ElapsedJiffies
  1034.  
  1035.     Contains the elapsed jiffies (i.e. 60ths of a second) portion of a play
  1036. sequence.  It's contents range from 0..59 inclusive.
  1037.  
  1038.  
  1039. ULONG   dtl_ElapsedTime     (New field for release 2.00, lib v3.0)
  1040.  
  1041.     Contains the total elapsed time of the currently playing song module in
  1042. 60ths of a second.  Useful if you need this value and you don't want to have
  1043. to get it by doing multiplications with the previous four fields.
  1044.  
  1045.  
  1046. ULONG   dtl_CurrentHertz    (New field for release 2.00, lib v3.0)
  1047.  
  1048.     This holds the current frequency of the player interrupt in hertz.  This
  1049. value is a fixed-point integer.  That is, the upper word holds the integer
  1050. portion of the frequency and the lower word holds the fractional portion of
  1051. the frequency.  If you want this value as a float (for C programmers), you
  1052. would do the following:
  1053.  
  1054.         float freq;
  1055.         freq = ((float)(DTLBase -> dtl_CurrentHertz)) / 65536;
  1056.  
  1057.  
  1058. LABEL   dtl_SIZE
  1059.  
  1060.     This is an equate.  It is defined as the size of the library base
  1061. structure.  It only appears in the "dtlib.i" (not in "dtlib.h") since it is
  1062. only needed for assembly language programmers.
  1063.  
  1064.                -----------------------------------------------
  1065.  
  1066.                            End of Structures.DOC
  1067.