home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / utils / sound / convrtr / amiga / dstrck14 / dtl / dtlib.rdm next >
Encoding:
Text File  |  1992-10-01  |  22.1 KB  |  482 lines

  1.  
  2.          Documentation for the DES-Tracker Library system version 1.4
  3.          ============================================================
  4.  
  5.                                October 2, 1992
  6.  
  7.                           Written by Darren Schebek
  8.  
  9.                  destracker.library, LScope, and DTC are all
  10.                     designed and written by Darren Schebek
  11.                      copyright (c)1992 by Darren Schebek
  12.                              All rights reserved
  13.  
  14.  
  15.                                  INTRODUCTION
  16.                                  ============
  17.  
  18.     Programmers!  Now you can have the great sound of Tracker music in your
  19. programs with a minimum of fuss and your program can still be user friendly
  20. and elegant in nature!  Now you can have more control over syncing program
  21. events to music and have much more control over the music you play!  Even
  22. ARexx programmers can make full use of the library's powerful features and
  23. ample status information!
  24.  
  25.     This is the DES-Tracker library system.  The library does all the work for
  26. you and provides lots of helpful information about the song that's playing as
  27. well.  This library system is NOT public domain.  However, it is freely
  28. distributable as long as it is distrubuted unmodified and in it's entirety,
  29. which includes the following files:
  30.  
  31. DTL/DTLib.ReadMe                    This file that you're reading now.
  32. DTL/ReadMe.Install                  How to install the library system.
  33. DTL/History.TXT                     A revision history of DES-Tracker.
  34. DTL/FAQ.TXT                         Frequently asked questions about DES-Tracker.
  35. DTL/libs/destracker.library         The actual DES-Tracker library itself.
  36. DTL/libs/req.library                Brand new (!) req.library v2.7! WB2.04-compat.
  37. DTL/c/DTC                           Lets you command the library from the CLI.
  38. DTL/c/LScope                        A visual scope example that runs in the B/G.
  39. DTL/c/LScope.info                   The .info file for the LScope program.
  40. DTL/docs/LibFuncs.DOC               Docs for the library functions.
  41. DTL/docs/RexxFuncs.DOC              Docs for the library's ARexx commands.
  42. DTL/docs/Structures.DOC             Docs for the custom library structures.
  43. DTL/rexx/Jukebox.rexx               A simple jukebox script example.
  44. DTL/rexx/Play.rexx                  A simple load and go script example.
  45. DTL/include/clib/dtlib_protos.h     C prototype file
  46. DTL/include/pragmas/dtlib_pragmas.h C pragmas file for SAS/C.
  47. DTL/include/fd/dtlib.fd             C function definition file.
  48. DTL/include/libraries/dtlib.i       The include file for assembly language.
  49. DTL/include/libraries/dtlib.h       The include file for C.
  50. DTL/include/proto/dtlib.h           The main include file for C.
  51.  
  52.     You can use this library to your heart's desire, but if you use it for a
  53. commercial application, there is a fee.  The fee is a complimentary copy of
  54. the final program. :)  Of course, I'm also interested in non-commercial
  55. uses as well.
  56.  
  57.     If you pass this library system on to others, you must distribute the
  58. library package in its entirety (as previously mentioned) and each file must
  59. remain pristine (do not modify any of the files.  Make copies for yourself and
  60. modify those instead).
  61.  
  62.     Lastly, you use the DES-Tracker library and included programs at your own
  63. risk.  I assume no responsibility for any damage, data-loss, etc. that may be
  64. caused by DES-Tracker.  Also note, however, that this version contains no
  65. known bugs.
  66.  
  67.     Here is a run-down of each file in this package:
  68.  
  69.  
  70.                              DTL/DTLib.ReadMe
  71.                              ----------------
  72.  
  73.     This is the text file that you are now reading.
  74.  
  75.  
  76.                             DTL/ReadMe.Install
  77.                             ------------------
  78.  
  79.     This text file simply mentions how to install the library system so that
  80. you can proceed to use it.  It also mentions how you can order the source code
  81. to both the DTC program and the LScope visual library scope program.
  82.  
  83.  
  84.                                DTL/History.TXT
  85.                                ---------------
  86.  
  87.     This is a text file containing a revision history of the DES-Tracker
  88. library package, listing enhancements made for this version.
  89.  
  90.  
  91.                                  DTL/FAQ.TXT
  92.                                  -----------
  93.  
  94.     This is a text file containing frequently asked questions about
  95. DES-Tracker.  Answers are also included as a bonus. :)
  96.  
  97.                         DTL/libs/destracker.library
  98.                         ---------------------------
  99.  
  100.     This is the actual library itself.  The features of this library will be
  101. discussed later on, and is the main focus of the "LibFuncs.DOC" file.  The
  102. library currently understands Noisetracker v2.0 format, Protracker v1.1a and
  103. up, and Soundtracker v2.6 format, and can read and write in both formats (the
  104. S/T v2.6 format is much more efficient than Noisetracker, BTW).  I should also
  105. mention that the library also supports the Protracker extended "E" commands.
  106.  
  107.                              DTL/libs/req.library
  108.                              --------------------
  109.  
  110.     This is Colin Fox's requester library.  Note that this is a BRAND NEW
  111. version of req.library (version 2.7).  It includes bug fixes for WB2.04.  It's
  112. totally cool.  Spread this version of req.library far and wide.  Give it to
  113. everybody you know, even if they don't have a computer!  =u)
  114.  
  115.  
  116.                                   DTL/c/DTC
  117.                                   ---------
  118.  
  119.     A small program that you can use from a CLI window to feed commands to the
  120. library.  This program is pure code.  ie, it can be made resident using the
  121. "resident" command, or New WShell's "resi" command.  This program is just over
  122. 4100 bytes in size (quite small).  Due to the nature of libraries - they have
  123. a nasty tendency to be suddenly expunged whenever nobody is using them - it is
  124. best to first run the LScope program before using DTC.  That way, LScope will
  125. keep the library open.  DTC, when run, will open the library, give it the
  126. command(s) you specify, and then exit, closing the library.  If DTC is the
  127. only user of the library, then, when DTC runs and finishes, the library is
  128. closed and expungable, and will be expunged if the Amiga decides that it needs
  129. the extra memory used by the library.  With LScope running in the background,
  130. the library will remain open between calls to DTC.
  131.  
  132.     To get a list of the commands that DTC supports, just run DTC from the
  133. command line without any arguments.
  134.  
  135.     DTC supports multiple commands in a single invocation.  Each command
  136. should be separated by a space character.  For example, before, when you
  137. wanted to use DTC to reset the library defaults, load a tune (called
  138. HamsterDance, for instance) and then start the song playing, you had to type
  139. this:
  140.  
  141.  DTC rd                         (reset default playback parameters)
  142.  DTC lm HamsterDance            (load the song file called "HamsterDance")
  143.  DTC bp
  144.  
  145. ...Well now you can just type this:
  146.  
  147.  DTC rd lp HamsterDance         (Reset defaults, then Load & Play "HamsterDance")
  148.  
  149. ...which is much more economical.
  150.  
  151.   See the History.TXT file for details on changes made to DES-Tracker for this
  152. release.
  153.  
  154.  
  155.                                  DTL/c/LScope
  156.                                  ------------
  157.  
  158.     A visual scope program example for the library system.  You can run LScope
  159. from the CLI by typing "lscope" at the CLI prompt, or you can run it from a
  160. Workbench window by double-clicking on the LScope icon.This program serves two
  161. purposes.  It is a great example of what you can do with the DES-Tracker
  162. library, and it's a useful tool for spying on the library to see what it's
  163. doing at any given time.  LScope runs in the background, automatically giving
  164. you back your command-line prompt after you run it.  The display runs at 60
  165. frames per second with minimal use of CPU time.  It is only around 15K bytes
  166. in length, and requires about 45K of memory total, including memory required
  167. for the display.  The LScope program is completely system friendly, allowing
  168. you to do what ever you like (eg, modeming, programming, etc) at the same time
  169. that it is running.  It took me all of two days to write it in assembly
  170. language.
  171.  
  172.     Version 1.2 of LScope looks pretty much the same as version 1.1, since
  173. the only changes made were bug fixes (well, bug *fix*, actually).  LScope has
  174. not changed for this release of DES-Tracker.
  175.  
  176.  
  177.                               DTL/c/LScope.info
  178.                               -----------------
  179.  
  180.     This is just the .info file for the LScope program so you can run LScope
  181. from a Workbench window.
  182.  
  183.  
  184.                             DTL/docs/LibFuncs.DOC
  185.                             ---------------------
  186.  
  187.     This text file contains documentation for each of the library's function
  188. calls.  Handy dandy.  :)
  189.  
  190.  
  191.                             DTL/docs/RexxFuncs.DOC
  192.                             ----------------------
  193.  
  194.     This text file contains documentation for each of the library's ARexx
  195. function calls.  There are just over 40 of them, mostly because I haven't yet
  196. implemented auto stem variable creation.  Perhaps in a future release...
  197.  
  198.  
  199.                            DTL/docs/Structures.DOC
  200.                            -----------------------
  201.  
  202.     This text file contains documentation on the custom library structures
  203. used by the DES-Tracker library, including the library base structure itself.
  204.  
  205.  
  206.                             DTL/rexx/Jukebox.rexx
  207.                             ---------------------
  208.  
  209.     A simple jukebox program written in ARexx.  Plays all modules in the given
  210. path in a random order.
  211.  
  212.  
  213.                               DTL/rexx/Play.rexx
  214.                               ------------------
  215.  
  216.     Another simple ARexx program.  This one just loads up the specified module
  217. and starts it playing.  Unlike the jukebox above, this program gives you back
  218. your command line prompt right away.  Note that this ARexx program requires
  219. req.library.  That's my excuse for including req.library in the DES-Tracker
  220. package.  :)
  221.  
  222.  
  223.                        DTL/include/clib/dtlib_protos.h
  224.                        -------------------------------
  225.  
  226.     This is the prototypes file.  It is only needed for applications written
  227. in C.
  228.  
  229.  
  230.                      DTL/include/pragmas/dtlib_pragmas.h
  231.                      -----------------------------------
  232.  
  233.     This is the pragmas file for use with SAS/C.
  234.  
  235.  
  236.  
  237.                            DTL/include/fd/dtlib.fd
  238.                            -----------------------
  239.  
  240.     This is the function definitions file used for creating pragmas.  It is
  241. only needed for applications written in C.
  242.  
  243.  
  244.                         DTL/include/libraries/dtlib.i
  245.                         -----------------------------
  246.  
  247.     This is the include file for assembly language applications.  If you're
  248. writing an assembly language program that uses the DES-Tracker library, you
  249. will need to include this file.
  250.  
  251.  
  252.                         DTL/include/libraries/dtlib.h
  253.                         -----------------------------
  254.  
  255.     This is the C version of the above include file.
  256.  
  257.  
  258.                           DTL/include/proto/dtlib.h
  259.                           -------------------------
  260.  
  261.     This is the file you include if you're writing a C application that uses
  262. the DES-Tracker library.  As well as defining the library base pointer, this
  263. file will also include dtlib_pragmas.h and dtlib_protos.h for you.
  264.  
  265.  
  266.  
  267.                         Features of destracker.library
  268.                         ==============================
  269.  
  270.     Here is a brief list of the functions supported by the DES-Tracker library
  271. and what they do (a more detailed explanation of these functions can be found
  272. in both the LibFuncs.DOC and RexxFuncs.DOC file):
  273.  
  274. Function Name:      What it does:
  275.  
  276. OwnPlayer           Lock out other programs from using the library.
  277. DisownPlayer        Allow others programs to use the library again.
  278. SetFilter           Turn low-pass filter on/off (Amiga power light).
  279. SetChannelEnable    Selectively enable/disable specific sound channels.
  280. SetStartPosition    Set the position in a song at which to begin a play seq.
  281. SetEndPosition      Set the position in a song at which to end a play seq.
  282. SetIterations       Set the number of times to play a play sequence.
  283. PausePlaySeq        Temporarily suspend an active play sequence.
  284. ContinuePlaySeq     Resume a play seq. from the point at which it was paused.
  285. SetGlobalVolume     Set the global volume that music will play at.
  286. SetInstVolume       Set the default volume of a specific instrument.
  287. SetDefaultTempo     Set default tempo for the beginning of a play sequence.
  288. SetGlobalTempo      Set the global tempo for a song to play at.
  289. SetFineTempo        Set the global fine tempo for a song to play at.
  290. SetTimingMode       Set internal player timing to PAL (50Hz) or NTSC (60Hz).
  291. SetLoopIntent       Set/clear flag for whether a song is meant to loop or not.
  292. FadeGlobalVolume    Fade the global volume to a specific volume.
  293. SetVolumeFadeRate   Set the speed at which volume fades transpire.
  294. LoadModule          Load a song module into memory.
  295. UnloadModule        Release a song module from memory.
  296. BeginPlaySeq        Begin playing the predefined play sequence.
  297. VerifyModule        Determine if a disk file is a recognizable module format.
  298. SetDefaultPath      Set default path to use for file operations.
  299. RetitleModule       Provide a new name for a module.
  300. ApplyGlobalTempo    Permanently alter a module's global tempo.
  301. SetCurPosition      Set the current play position in a loaded module.
  302. SaveModule          Save a module back to disk in Soundtracker v2.6 format.
  303. SetSaveFormat       Set format for SaveModule to use (Soundtracker/Noisetracker).
  304. SetAutoTiming       Turn on/off auto timing detection (not available yet).
  305. ResetDefaults       Reset library parameters to their default values.
  306. SetTempoInt         Set tempo interpretation mode (BPM / Non-BPM).
  307. AddStatusSignal     Add a status-change signal bit to library's signal queue.
  308. RemStatusSignal     Remove a signal bit from library's signal queue.
  309.  
  310.     The above functions can be called from your own programs, regardless of
  311. what language you program in (providing that the language allows you to make
  312. calls to libraries, which is most likely).  The exception is ARexx, but of
  313. course, the DES-Tracker library has full ARexx support as well.
  314.  
  315.     From looking at the above routines, it would appear that they are mostly
  316. input routines.  That is, you give the functions input, but they don't yield
  317. any output, short of an error-status return code.  Well, the DES-Tracker
  318. Library gives as well as takes.  Read on...
  319.  
  320.     You open the library for use in the same way that you'd open the Dos
  321. library or Intuition Library (or any library, for that matter).  When you open
  322. the DES-Tracker library successfully, you get back a pointer to the
  323. DES-Tracker library base structure.  A pointer to the same instance of this
  324. structure is passed to all who open this library, and its elements are READ
  325. ONLY.  You must never write to them.
  326.  
  327.  
  328.  
  329.                              The "PSC0" Construct
  330.                              ====================
  331.  
  332.     "PSC0" essentially means "Playback Status Construct".  Future versions of
  333. this construct will have the name "PSC1", "PSC2", etc, so if you are scanning
  334. a file looking for this construct for your own purposes, you should only check
  335. for "PSC" and then check the fourth character for a valid digit.
  336.  
  337.     Whenever you tell the DES-Tracker library to save a song module back to
  338. disk (using the SaveModule function, see LibFuncs.DOC), the library will also
  339. append extra information about the song at the very end of the song file (it
  340. is put at the very end so you can still load the song up into the Soundtracker
  341. v2.6 or Noisetracker v2.0 editors).  This information is contained in a PSC0
  342. construct, a small block of data that looks like this:
  343.  
  344.     ULONG   "PSC0"          The PSC0 Identifier.
  345.     ULONG   size            Size of the data portion of the PSC0 construct.
  346.     UBYTE   PBFlags         Playback flags (see below)
  347.     BYTE    FineTempo       Fine tempo setting (-128..127)
  348.     UBYTE   DefaultTempo    Default tempo of the song (0..31).
  349.     UBYTE   Iterations      Default number of iterations for song.
  350.  
  351.  
  352.     The size field is the size of the entire PSC0 construct less the first two
  353. fields (ie, size is currently 4).
  354.  
  355.     The PBFlags field contains the following flags:
  356.  
  357.     Bit 7: PF_LOOPINTENT    Set to 1 if this song is supposed to loop at the
  358.                             end (see Structures.DOC for an explanation of this
  359.                             flag as well as the SetLoopIntent function in
  360.                             LibFuncs.DOC).
  361.  
  362.     Bit 6: PF_TIMINGMODE    Set to 0 for 60Hz (NTSC), 1 for 50Hz (PAL) timing.
  363.  
  364.  
  365.     Bit 5: PF_TEMPOINT      Set to 0 if song uses "BPM" (Beats Per Minute)
  366.                             tempo interpretation. Set to 1 if song only uses
  367.                             normal tempos in 1..255 range.
  368.  
  369.     The FineTempo field contains the fine tempo setting at the time that the
  370. song module was saved.  Its range is -128..127.  A value of 0 is the normal
  371. default.
  372.  
  373.     The DefaultTempo field contains the default tempo setting for when the
  374. song first starts playing.  This is useful for songs that don't have any tempo
  375. commands in them (with songs like this, the ApplyGlobalTempo function won't
  376. work, see LibFuncs.DOC).  You can use the SetDefaultTempo function to set this
  377. parameter prior to saving a module to disk.
  378.  
  379.     The last field was unused in versions 1.2 and earlier. It's function now
  380. is to hold the default number of iterations for the song.  This is provided so
  381. that you can play a song from DTC and have it play a given number of times
  382. automatically.  A value of 0 here means iterate infinitely.  Note that if you
  383. are writing a jukebox program (for example) you can use the loop intent flag
  384. to override the number of iterations if you like.  Or you can use the loop
  385. intent flag such that if it is clear, then play the song for the default
  386. number of iterations.  If it is set, then play the song for the default number
  387. of iterations plus one extra iteration, and fade out on the last iteration.
  388.  
  389.     Now, when you tell the library to save a module to disk, a PSC0 construct
  390. automatically gets appended to the end of the song file.  The next time you
  391. load up the song, the library will detect this PSC0 construct, extract the
  392. information from it and automatically set the respective parameters.
  393.  
  394.     Please bear in mind that if you load a module into the Soundtracker editor
  395. or Noisetracker editor and the song has a PSC0 construct at the end of it, the
  396. editor will throw away this information.  So, if you save the song from the
  397. editor, the PSC0 construct will be lost.
  398.  
  399.  
  400.  
  401.                                     WHEW!
  402.                                     =====
  403.  
  404.     Having said all that, I hope you enjoy using this library system.  I wrote
  405. the entire thing (DTC, LScope, the library itself) in 100% assembly language
  406. using Charlie Gibbs' a68k assembler.
  407.  
  408.   If you have any comments, criticisms, or suggestions (or just unbridled
  409. praise, ha ha), please let me know and help me to make this library system
  410. better and better.  I'd also *really* like to see any programs you write that
  411. use the DES-Tracker library (a deluge of scopes?  :).  Have fun!
  412.  
  413.  
  414.  
  415.                                 SPECIAL THANKS
  416.                                 ==============
  417.  
  418.     I must give special thanks to Colin Fox (of req.library fame, a good
  419. friend of mine for many years now) who helped me a great deal during the
  420. course of this project.  Not only did he do most of the work in creating the C
  421. bindings (and at the last minute, no less), but he also drew the nifty little
  422. icon for the LScope program at great expense, and at the last minute.  =u)
  423. Thanks, dude.
  424.  
  425.     Special thanks must also go to David Knox who brought a bug to my
  426. attention that occurred when DES-Tracker was used from within the Director II
  427. program.  I would not have found them for quite some time otherwise.  In
  428. return, I will give him a free plug. :)  David is head of the "Ready Robot
  429. Club" headquartered in Carmichael, California.  He publishes a monthly disk of
  430. educational games, stories and puzzles for kids from Kindergarten to Grade 6.
  431. He's been doing it for two years now, and has been mentioned in several
  432. magazines.  If you would like information about the Club, his address is as
  433. follows:
  434.                               David Knox
  435.                               P.O. Box 628
  436.                               Carmichael, CA
  437.                               95609-0628 U.S.A.
  438.  
  439.  
  440.     I feel I must also thank everybody who composes great Amiga tunes, as it
  441. was the excellent sound capabilities of the Amiga (and all these excellent
  442. tunes) that made me get an Amiga (I used to be an Atari ST owner, now it sits
  443. in the corner holding my door open).  :) BTW, my current fave tunes are Klisje
  444. Paa Klisje (sp?), Heaven & Hell, and everything written by Maruku Buranu (aka
  445. Marc Brown, the man's a total Protracker Wizard, and his SampleText idea is
  446. brilliant).  I wish I knew who wrote the first two tunes, but I thank them
  447. greatly for not stomping the instrument names in the module with inane
  448. comments.  :) (Marc Brown:  With the totally brilliant idea of using
  449. SampleText in your mods, *why* do you still trash the instrument names?).
  450.  
  451.     Also, kudos to Ed Mackey (Ed-Player looks great, I love the buttons), but
  452. I wish he wouldn't condone destroying instrument names in favor of author
  453. comments (couldn't people at least use the unused instrument slots for that
  454. kind of thing?)
  455.  
  456.     And I still don't know what the heck "Klisje Paa Klisje" means. :)
  457.  
  458.  
  459.                                WHAT'S IN STORE
  460.                                ===============
  461.  
  462.     - Amazing things are still in the works.  Every once in a while, though,
  463.       I will release a new version of DES-Tracker in the meantime, since
  464.       people keep asking for more features, and I'm trying to design my
  465.       amazing things. :)
  466.  
  467.                                           - Darren Schebek, October 2, 1992
  468.  
  469.  
  470. NOTE:  My usenet address is still dschebek@outb.wimsey.bc.ca as of this writing.
  471.        I sure hope it doesn't bloody well change on me again...
  472.  
  473.  
  474. You can write to me here:       or contact me on usenet at:
  475.  
  476.     Darren Schebek                  dschebek@outb.wimsey.bc.ca
  477.     5620 Sherwood Blvd.
  478.     Delta, B.C.                 or call the Wizard BBS (my hangout):
  479.     CANADA
  480.     V4L-2C5                         (604)322-3266 or (604)322-3972
  481.                                          (Sysop is Roger Earl)
  482.