home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / multikit.zip / SOUND.DOC < prev    next >
Text File  |  1996-03-01  |  10KB  |  176 lines

  1.  
  2.  Documentation ─────────────────────────────────────────────────────────────┐
  3.  │                          SOUND Unit Documentation                        │
  4.  └───────────────────────────────────────────────────────────── MULTIKIT v1.0
  5.  
  6.  
  7.  The development of soundcards for the IBM PC compatible started off with the
  8.  ADLIB card several years ago. It was followed by the Soundblaster created by
  9.  Creative Labs which became standard on the PC. This device made it  possible
  10.  to play digitized voices and from that time on the MODule file format  which
  11.  came from the AMIGA actually became very popular. Nowadays the original for-
  12.  mat is a little bit antiquated because it was restricted  to  four  channels
  13.  maximum. The newest players are supporting up to 32 channels, 16 bit samples
  14.  and much more effects than the original AMIGA module format. MULTIKIT allows
  15.  you to play modules if a GUS or a SB2+ is installed.
  16.  Read the following instructions before you use this unit in  your  programs:
  17.  
  18.  (1)  Every module file which you want to load with LOADMOD must be  compres-
  19.       sed with COMPRESS (a MULTIKIT tool). This serves two  purposes:  reduc-
  20.       tion of the data size and crypting the file which  prevents  the  "rip-
  21.       ping" of the module from your file(s).
  22.  
  23.  (2)  The module must cover the following requirements: only  M.K.  or  FLT4,
  24.       6CHN, 8CHN or OCTA supported (not more  than  eight  channels),  sample
  25.       size always equal or less 65527 bytes, not more than 64 patterns,  pat-
  26.       tern and sample data must fit in base memory.
  27.  
  28.  (3)  The player for the GUS differs from the SB2 player.  As  you  probably
  29.       know the Gravis Ultrasound has hardware mixing and integrated  effects
  30.       for samples but on Soundblaster you must do the mixing and effects  in
  31.       realtime by requesting CPU power. Therefore  the  Soundblaster  player
  32.       doesn't support all the effects (this would slow down  you  computer).
  33.       See the last chapter for more detailed information!
  34.  
  35.  (4)  CLOCK.TPU is needed because the module playing requires the  allocation
  36.       of an internal timer handle. You must run CLOCKINIT (for frequency val-
  37.       ues see below) before you can play any modules. Remember to call CLOCK-
  38.       DONE before exiting your program. Be sure that there is  at  least  one
  39.       free handle available for the player.
  40.  
  41.  (5)  Module playing is (espechially on Soundblaster) a time-critical process
  42.       and because of this you should avoid any disk access during the playing
  43.       of a module. Anyway the player should work stable.
  44.  
  45.  
  46.  
  47.  Global types, constants and variables
  48.  ─────────────────────────────────────
  49.  
  50.   Type
  51.    ModType        = ^ModInfoRec;              The information of each  single
  52.    ModInfoRec     = Record                    module is stored in such a  re-
  53.     miChannels:   Byte;                       cord after is has been  loaded.
  54.     miOrderLen:   Byte;                       This is critical data.  Changes
  55.     miReStart:    Byte;                       could cause the  crash  of  the
  56.     miOrder:      Array[1..128] Of Byte;      program.
  57.     miPatterns:   Array[1..64] Of Pointer;
  58.     misampGUS:    Array[1..31] Of LongInt;
  59.     miSampOfs:    Array[1..31] Of Word;
  60.     miSampSeg:    Array[1..31] Of Word;
  61.     miSampLen:    Array[1..31] Of Word;
  62.     miSampRep:    Array[1..31] Of Word;
  63.     miSampRepLen: Array[1..31] Of Word;
  64.     miSampFnTune: Array[1..31] Of Word;
  65.     miSampVol:    Array[1..31] Of Word;
  66.    End;
  67.  
  68.   Const
  69.    MixSpeed: Word = 22050;                      Mixing speed
  70.    MidCRate: Word = 8448;                       Middle C rate
  71.    DefTempo: Byte = 6;                          Default speed
  72.    DefBpm:   Byte = 125;                        Default beats per minute
  73.  
  74.    NONE      = 0;                               Constants for
  75.    SB2       = 1;                               SOUNDCARD.DEVICE  are  avail-
  76.    GUS       = 2;                               able after  calling  INITDEV.
  77.  
  78.    NoError   = 0;                               Constants for the values  re-
  79.    FileErr   = 1;                               turned by LOADMOD.
  80.    DataErr   = 2;
  81.  
  82.   Var
  83.    SoundCard: Record                            Holds the data of the  detec-
  84.     Device: Byte;                               ted soundcard after  INITDEV.
  85.     Addr:   Word;                               You can change it manually if
  86.     Irq:    Word;                               the autodetection fails.
  87.    End;
  88.  
  89.    MainVolume:    Word;                         Global volume rate
  90.    OrderPos,                                    Number of current pattern
  91.    Row:           Byte;                         Number of current row
  92.  
  93.  
  94.  
  95.  Public procedures and functions
  96.  ───────────────────────────────
  97.  
  98.  Procedure InitDev;
  99.            This procedure detects and initialises the installed playback  de-
  100.            vice. Currently GUS and Soundblaster are  supported.  The  program
  101.            has been tested on SB Pro (Thanks to OKULAR),  SB 16  and  GUS MAX
  102.            (Thanks to  Benjamin.Tuerpe@Informatik.TU-Chemnitz.DE). If  you've
  103.            both (Soundblaster and GUS) then the GUS is preferred.
  104.  
  105.  Function  LoadMod(FName: String; FSeek: LongInt; Var Module: ModType): Byte;
  106.            Loads from the file FNAME at position FSEEK  a  compressed  module
  107.            into the base memory.
  108.  
  109.  Procedure FreeMod(Var Module: ModType);
  110.            Remove all data and free all memory allocated by MODULE.
  111.  
  112.  Procedure PlayMod(Var Module: ModType);
  113.            Plays the specified MODULE through your soundcard.
  114.  
  115.  Procedure StopMod;
  116.            Stops the playback. Call it only, if you're really playing!
  117.  
  118.  
  119.  
  120.  Supported effects and differences between the players
  121.  ─────────────────────────────────────────────────────
  122.  
  123.  ┌────────────────────────────┬──────────────────────┬──────────────────────┐
  124.  │                            │          GUS         │         SB2          │
  125.  ├────────────────────────────┼──────────────────────┼──────────────────────┤
  126.  │ At least required          │                      │                      │
  127.  │ timer   frequency          │         1000Hz       │   MIXSPEED DIV 1024  │
  128.  │ (CLOCKINIT)                │                      │                      │
  129.  ├────────────────────────────┼──────────────────────┼──────────────────────┤
  130.  │ Available variables        │                      │                      │
  131.  │                            │                      │                      │
  132.  │  MixSpeed                  │          No          │         Yes          │
  133.  │  MidCRate                  │          No          │         Yes          │
  134.  │  DefTempo                  │          Yes         │         Yes          │
  135.  │  DefBpm                    │          Yes         │         Yes          │
  136.  │                            │                      │                      │
  137.  │  SoundCard.Device          │          Yes         │         Yes          │
  138.  │  SoundCard.Addr            │          Yes         │         Yes          │
  139.  │  SoundCard.Irq             │          No          │         Yes          │
  140.  │                            │                      │                      │
  141.  │  MainVolume                │          Yes         │         No           │
  142.  │  OrderPos                  │          Yes         │         Yes          │
  143.  │  Row                       │          Yes         │         Yes          │
  144.  │                            │                      │                      │
  145.  ├────────────────────────────┼──────────────────────┼──────────────────────┤
  146.  │ Available Effects          │                      │                      │
  147.  │                            │                      │                      │
  148.  │  00 Arpeggio               │          Yes         │      Should be       │
  149.  │  01 Portamento up          │          Yes         │         Yes          │
  150.  │  02 Portamento down        │          Yes         │         Yes          │
  151.  │  03 Portamento to note     │          Yes         │         Yes          │
  152.  │  04 Vibrato                │          Yes         │         Yes          │
  153.  │  05 Portamento + vol slide │          Yes         │         Yes          │
  154.  │  06 Vibrato + volume slide │          Yes         │         Yes          │
  155.  │  09 Offset                 │          Yes         │         Yes          │
  156.  │  0A Volume slide           │          Yes         │         Yes          │
  157.  │  0B Position jump          │          Yes         │         Yes          │
  158.  │  0C Volume                 │          Yes         │         Yes          │
  159.  │  0D Break pattern          │          Yes         │         Yes          │
  160.  │  0F Speed set and BPM set  │          Yes         │         Yes          │
  161.  │                            │                      │                      │
  162.  │  E1 Fine portamento up     │          Yes         │         No           │
  163.  │  E2 Fine portamento down   │          Yes         │         No           │
  164.  │  E9 Retrig note            │          Yes         │         No           │
  165.  │  EA Fine volume up         │          Yes         │         No           │
  166.  │  EB Fine volume down       │          Yes         │         No           │
  167.  │  EC Cut note               │          Yes         │         No           │
  168.  │  ED Delay note             │          Yes         │         No           │
  169.  └────────────────────────────┴──────────────────────┴──────────────────────┘
  170.  
  171.  
  172.  
  173.  This unit is part of MULTIKIT.
  174.  (C) Copyright by TSC-Software, 1996.
  175.  
  176.