home *** CD-ROM | disk | FTP | other *** search
/ Intermedia 1998 January / inter1_98.iso / www / rozi / MOD2.ZIP / MODULES.DOC < prev    next >
Text File  |  1995-05-20  |  3KB  |  74 lines

  1.  
  2.   MODULES.TPU
  3.  
  4.   MODule playing routines.
  5.   Based on TINY MOD v0.1b by Carlos Hasan, (C) 1993.
  6.   Supplemented and recoded for PASCAL by TSC-Software, 1995.
  7.  
  8.   --------------------------------------------------------------------------
  9.  
  10.   This library was designed for playing AMIGA MOD-files within TURBO PASCAL.
  11.   You are able to load  several MODules into mem and play  them any time you
  12.   want to. Soundblaster or 10000000000% compatible is needed. 80286 CPU too.
  13.  
  14.   The following data and procedures are defined as public:
  15.  
  16.  
  17.   Const
  18.    MixSpeed: Word = 41000;   { INT 8 will call the sound calculating routine }
  19.                  { at least MixSpeed/1024 times per second.         }
  20.  
  21.    MidCRate: Word =  8448;   { C-2 frequency                     }
  22.  
  23.    DefTempo: Byte =     6;
  24.  
  25.    DefBpm:   Byte =   125;   { Speed of MODule (in beats per minute)         }
  26.  
  27.  
  28.   Type
  29.    MODDataRec     = ^ModInfoRec;    { Module information resources           }
  30.    ModInfoRec     = Record
  31.     OrderLen:     Byte;
  32.     ReStart:      Byte;
  33.     Order:        Array[1..128] Of Byte;
  34.     Patterns:     Pointer;
  35.     SampOfs:      Array[1..31] Of Word;
  36.     SampSeg:      Array[1..31] Of Word;
  37.     SampLen:      Array[1..31] Of Word;
  38.     SampRep:      Array[1..31] Of Word;
  39.     SampRepLen:   Array[1..31] Of Word;
  40.     SampVol:      Array[1..31] Of Word;
  41.     PatSize:      Word;
  42.    End;
  43.  
  44.   Var
  45.    ErrorInfo:     Byte;       { 0 = OK, 1 = Error                   }
  46.    OrderPos:      Byte;    { Current order to be played               }
  47.    Row:           Byte;    { Current row (1..64) of order           }
  48.  
  49.  
  50.   Procedure LoadMOD(FName: String; FSeek: LongInt; Var MODData: MODDataRec);
  51.   { Loads a module from file "FName" at position "FSeek" into memory.      }
  52.   { This procedure allocates PASCAL-memory only! The MODule itself and the }
  53.   { information about it must fit into mem, or the program terminates with }
  54.   { a runtime error.                               }
  55.  
  56.   Procedure FreeMOD(Var MODData: MODDataRec);
  57.   { All memory taken by the MODule and information resources is released   }
  58.   { by this procedure.                                }
  59.  
  60.   Procedure PlayMOD(Var MODData: MODDataRec);
  61.   { Start playing of a specified MODule immediately. Don't set MixSpeed    }
  62.   { too high if you have a slow computer. And don't disable the interrupts }
  63.   { because you won't hear music anymore. It's not recommended to change   }
  64.   { any of the variables declared above during the playback.           }
  65.  
  66.   Procedure StopMOD;
  67.   { Stop the MODule currently played and shut down the Soundblaster device }
  68.  
  69.  
  70.   See the example MPLAY.PAS how to use the unit.  AVOID DOING STRANGE THINGS
  71.   DURING THE PLAYBACK BY ANY CHANCE (like causing runtime errors)! Make sure
  72.   that you've shut down the Soundblaster device before  exiting the program.
  73.  
  74.