
                                 
                                                
                                                
                                   
                                                
                                                
                                         


                         - PLAY_AST TPU -
                             VER:1.00
                        BY PATRICE BOUCHAND
                              a.k.a
                           Cagliostro
                  (Sorry for my broken english..)

1) WHAT IS IT ?

   PLAY_AST.TPU is a turbo pasccal 7 unit which allows you to play AST file
   in your own program.

2) WHAT 'S AN AST file ?

   AST file are made with the AST Tracker (made by me) which uses
     *the awe32 (EMU8000)
     *the FM synthesis
     *the MPU401 Midi interface
     *the beeper

  to play music ,

3) WHERE CAN I FIND THE AST TRACKER ?

   if you find this file ,i think you can find the ast tracker
   at the same place.
   At this time,you can find AST100 on the CD-ASC N33 of DP TOOL
   and the last release is AST103

4)*********************** STUCTURE OF THE TPU *******************************

FOR USING THE TPU ,JUST WRITE " USES PLAY_AST "

a)DETECTION

   As soon as you use the TPU, the results of your sound card's detection
   are put in those variables

    FMdt :  boolean, true if an opl2 or opl3 is found at $388

    AWEdt:  boolean, true if an EMU8000 is found
    awe_base:word ,Baseport of the AWE32 ,usually $620
    awemem :longint , Size of the awe32 RAM in byte

    MIDIdt: boolean ,true if an MPU401 MIDI interface is found
    MIDIp : word ,Baseport of the mpu401,usually $330

    SBdt  :boolean ,true if a SOUND BLASTER or compatible Card is found
    sbp : word ,Baseport of the SB DSP ,usually $220
          (only for volume)

 if you don't want to use the autodetected values of the Baseport because
 it doesn't work or you have more than one Sound Card
 you can use this procedure

  procedure force_awe32(w:word); this will detect if an awe32 is
                                 at the Baseport w.
                                 After running this procedure,you can
                                 see if the awe is detected in the
                                 variable awedt
                                 if awedt is true ,the size of the RAM
                                 on your AWE is in awemem;

  procedure force_midi(w:word);  this will detect if an MPU401 is
                                 at the Baseport w.
                                 After running this procedure,you can
                                 see if the MPU401 is detected in the
                                 variable MIDIdt.


  procedure force_SB(w:word);    this will detect if an SB is
                                 at the Baseport w.
                                 After running this procedure,you can
                                 see if the SB  is detected in the
                                 variable SBdt.

b) PLAYING PROCEDURE

 function ast_load(filename:string):boolean; this function trys to load the
                                             file which the name is filename
                                             ast_load is true if the file
                                             can be opened,false if it can't.
                                             BE CAREFULL:no test if the file
                                             is corrupted or isn't an AST file

 procedure ast_start; this procedure plays the song which has been loaded

 procedure ast_stop;  this procedure stops the song

 procedure ast_exit;  you should call ast_exit at the end of your program
                      this will clear the memory of song DaTa,
                                restore timer data
                                clean up the MPU401.

 procedure ast_clear; this procedure clears the song data,
                      BE CAREFULL: not extensively tested

 procedure setSBvolume(VL,VR:byte); this procedure sets the volume of the
                                    left and right channel of the SB.

c) EFFECT PROCEDURE

   The AST TPU uses a "PUMP TABLE" for effects,so you can replace the
   effects by your own effects

   the table of effects is a bidimensionnal array of procedure
   ef:array[0..3] of array [46..122] of procedure(val,v:byte);

   the first dimension is

     0: midi effects
     1: speaker effects
     2: FM effects
     3: AWE effects

   the second dimension is the number of the asci code of the effect

    example  ef[0][ord('m')] : Modulation effect of midi
             ef[3][ord('f')] : Filter effect of AWE

  if you want to replace one of this effects;
   you should make a procedure FAR called

    Procedure New_awe_f_effects(val,v:byte);FAR;
    begin

    end;

   you set the effect's table
    ef[3][ord('f')]:=New_awe_f_effects;

   BE CAREFULL : don't make procedure which takes too much time,
                 this  will altered the song

                 if you want your song to use the old effect,even if
                 you replace it, save the old effect, and call it
                 in your new procedure

                 if an error occures in this procedure ,this will cause
                 a CRASH...

 The TPU uses 2 counters ,a longint tim and a byte compt
 compt goes from 0 to 7 , and tim is increased as soon as compt =7;
 the speed which compt is increased, depends of the song's tempo


  That' all. see the 3 example's files for more informations.
  I hope my TPU isn't too buggy and i whish you good coding
  ( Sorry if your computer crash and i disclaim... etc)

************************* CONTACTING ME *************************************

  If you don't understand something or you have a problem or only if
  you want to contact me ,write me a letter

    BOUCHAND Patrice
    LE BOURG
    42990 Saint Georges en Couzan
    FRANCE

If Someone can send me a good english version of this file,i will be :)

*************************** DISTRIBUTION ************************************
  THIS TPU IS A FREEWARE ,IF YOU WANT TO REGISTERED,YOU CAN SEND ME
  A PROGRAM WHICH USES THE AST TPU.

  THIS CAN BE DISTRIBUTED ALL OVER THE WORLD, ON EVERYTHING (CD-ROM,BBS);
  CONTACT ME FOR COMMERCIAL USE

  AS I HAVEN'T GOT MODEM, PLEASE SEND THIS FILE TO ALL
  THE BBS , THE FTP-SITES ,WWW-SITES YOU KNOW

*****************************************************************************
 IF YOU ARE A SOUND CARD MANUFACTURER AND IF YOU WANT THAT AST TRACKER AND
 THIS TPU SUPPORT YOUR SOUND CARD ,SEND ME A SOUND CARD WITH A DOCUMENTATION
 I WILL TRY TO DO MY BEST..
*****************************************************************************



                                                 SEE YOU SOON AND THANKS
                                                 FOR READIND THIS DOC
