home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / SWMP13.ZIP / PAS.DOC < prev    next >
Encoding:
Text File  |  1995-05-16  |  6.6 KB  |  147 lines

  1.  
  2.  ┌────────────────────────────────────────────────────────────────────────────┐
  3.  │ Module Player V1.3      (c) 1994,1995 by Lord Excess of Sound Wizards Int. │
  4.  └────────────────────────────────────────────────────────────────────────────┘
  5.  
  6.  
  7.  
  8.         USING THE SWMP DRIVERS WITH 'TURBO PASCAL 6.0'
  9.         ──────────────────────────────────────────────
  10.  
  11.          First of all you have to unzip the files of the included
  12.         archive PAS_SDK.ZIP to a location where the pascal compiler can
  13.         find them. This is either the directory where you keep your
  14.         source code or even better the Turbo Pascal directory itself.
  15.         The files you need in any case are:
  16.  
  17.               MODPLAY.TPU           : main unit
  18.               MODPLAY.PAS           : source code
  19.               DETECT.TPU            : fully automatic hardware detection
  20.               SB_DRV.TPU            : SoundBlaster driver
  21.               SBP_DRV.TPU           : SoundBlaster Pro driver
  22.               GUS_DRV.TPU           : Gravis UltraSound driver
  23.  
  24.          The rest are example files, which can be important to
  25.         understand things better. Now the only step to link all
  26.         mod-procedures and functions is to add the following statements
  27.         after your program heading:
  28.  
  29.               PROGRAM xxxxx;
  30.               {$M $4000,0,0}        : This sets the heap size to zero
  31.                                     : else the drivers cannot alloc memory
  32.               USES ModPlay;         : include unit ModPlay
  33.               ...
  34.               ..
  35.  
  36.          At program start you have to initialize this unit using the
  37.         following procedure:
  38.  
  39. ┌──INIT DRIVER─────────────────────────────────────────────────────────────────
  40. │       PROCEDURE Mod_Init(Driver,Port: WORD; IRQ,DMA: BYTE);
  41. │         -> Select and initialize driver for sound output
  42. │            Driver = Detection         (0) :  Port = 0
  43. │                                              IRQ  = 0
  44. │                                              DMA  = 0
  45. │                   = SoundBlaster      (1) :  Port = SB base address ($220..)
  46. │                                              IRQ  = SB IRQ#
  47. │                                              DMA  = 1 (always)
  48. │                   = SoundBlaster_Pro  (2) :  Port = SBP base address
  49. │                                              IRQ  = SBP IRQ#
  50. │                                              DMA  = SBP DMA channel
  51. │                   = Gravis_UltraSound (3) :  Port = GUS base address
  52. │                                              IRQ  = GF1 IRQ#
  53. │                                              DMA  = MIDI IRQ# !!
  54.  
  55.          A very powerful hardware detection is able to detect any
  56.         supported soundcard with all required settings. So in general
  57.         the easiest way to init the drivers is:
  58.  
  59.                 MOD_Init(Detection,0,0,0);
  60.  
  61.  
  62.          If all fails you can override detection and select one of the
  63.         drivers by yourself, but in this case you have to know (or ask
  64.         for) the settings of an installed soundcard.
  65.  
  66.          If you want to know if initialisation was successfull, have a
  67.         look at the variable Soundcard (WORD), which will contain the
  68.         output device:
  69.  
  70.               0:        no sound available
  71.               1:        SoundBlaster            [ 22.2 kHz mono     ]
  72.               2:        SoundBlaster Pro        [ 21.7 kHz stereo   ]
  73.               3:        Gravis UltraSound       [ 44.1 kHz +stereo+ ]
  74.  
  75.          You do not have to handle this variable. You can also call the
  76.         driver's subfunctions even if no soundcard was detected,
  77.         nothing will happen in this case.
  78.  
  79.          At program end the unit selfrestores any altered interrupt
  80.         vectors etc.
  81.  
  82.          The following functions & procedures are available:
  83.         (Note: The first two procedures are enough to playback a mod !!!)
  84.  
  85. ┌──LOAD MODULE─────────────────────────────────────────────────────────────────
  86. │       PROCEDURE Mod_Load(FileName: STRING);
  87. │         -> Stops possible sound output, loads module file into memory,
  88. │            but does no start playing. If successful the variable
  89. │            Channels (WORD) will contain the number of channels, else zero.
  90. ┌──PLAY MODULE─────────────────────────────────────────────────────────────────
  91. │       PROCEDURE Mod_Play(Looping: WORD);
  92. │         -> Starts playing previously loaded song. If looping is zero,
  93. │            song is played only once, else continuously.
  94. ┌──STOP MODULE─────────────────────────────────────────────────────────────────
  95. │       PROCEDURE Mod_Stop;
  96. │         -> Stops sound output at once.
  97. ┌──MAIN VOLUME─────────────────────────────────────────────────────────────────
  98. │       PROCEDURE Mod_Volume(Volume: BYTE);
  99. │         -> Changes the driver's main volume setting. Valid values are
  100. │            between 0 (lowest) and 64 (loudest).
  101. ┌──STATUS──────────────────────────────────────────────────────────────────────
  102. │       FUNCTION Mod_Status: WORD;
  103. │         -> Returns 1 if sound is being played, else 0.
  104. ┌──GET POSITION────────────────────────────────────────────────────────────────
  105. │       FUNCTION Mod_Position: WORD;
  106. │         -> Returns 256*PatternNumber+LineNumber. Can be useful to
  107. │            syncronize a special graphic effect to the sound.
  108. ┌──JUMP BACK───────────────────────────────────────────────────────────────────
  109. │       PROCEDURE Mod_Rewind;
  110. │         -> Decreases current songposition. No effect in first pattern.
  111. ┌──JUMP FORWARD────────────────────────────────────────────────────────────────
  112. │       PROCEDURE Mod_Forward;
  113. │         -> Increases current songposition. No effect in last pattern.
  114.  
  115. ┌──PEAKS───────────────────────────────────────────────────────────────────────
  116. │       PROCEDURE Mod_Peak(VAR Peaks);
  117. │         -> Updates the array Peaks by copying the driver's volume
  118. │            setting (0..64) of each channel. The number of channels
  119. │            can be found in the variable Channels (WORD) and is either
  120. │            four, six or eight.
  121.  
  122.  
  123.          In general it remains to be said that you can do as much error
  124.         checking as you like, but it is not necessary. In a demo or
  125.         intro for example you do not care if there is sound available
  126.         to the grafix you produce on the screen (in most cases). But in
  127.         a player it is evident that you need to have any sounddevice at
  128.         all to output the sound! The best way is to take a look at the
  129.         example programs. Have a lot of fun!
  130.  
  131.  
  132.                                                  Lord Excess in May '95
  133.