home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / MADH Pascal 4.5 / Libraries & Interfaces / MAD.p next >
Encoding:
Text File  |  1997-03-13  |  3.9 KB  |  161 lines  |  [TEXT/CWIE]

  1. {
  2. ********************                        ***********************
  3.  
  4.     Player PRO 4.5x -- MAD Music Driver Definition -
  5.  
  6.     Library Version 4.5
  7.  
  8.     To use with MADH Library for CodeWarrior
  9.  
  10.     Antoine ROSSET
  11.     16 Tranchees
  12.     1206 GENEVA
  13.     SWITZERLAND
  14.  
  15.     Thank you for your interest in PlayerPRO !
  16.  
  17.     FAX:            (+41 22) 346 11 97
  18.     PHONE:         (+41 79) 203 74 62
  19.     Internet:         rosset@dial.eunet.ch
  20.  
  21.  
  22.     Ported to Pascal by Federico Filipponi (March 1997)
  23.     e-mail:    fedefil@fub.it
  24.                     fedefil@kagi.com
  25.     
  26.     Based on a previous work by Matthias Wuttke
  27.     e-mail: wuttke@stein.teuto.de
  28.                     matthias@kagi.com
  29.     
  30. ********************                        ***********************
  31. }
  32.  
  33. unit MAD;
  34.  
  35. interface
  36.  
  37. {$ALIGN MAC68K}
  38.  
  39.     uses
  40.         Types;
  41.  
  42. const
  43.     DEFAULT_VOLFADE = 300;
  44.  
  45. { INSTR. DESCRIPTION }
  46.     EFON    = 1;
  47.     EFSUSTAIN = 2;
  48.     EFLOOP = 4;
  49.  
  50. {
  51. ***    
  52. ***    PATTERN DESCRIPTION
  53. ***    
  54. }
  55. type
  56.     Cmd = record        { COMMAND }
  57.         ins: Byte;                    { Instrument no        0x00: no ins cmd }
  58.         note: Byte;                    { Note, see table        0xFF : no note cmd }
  59.         cmd: Byte;                    { Effect cmd }
  60.         arg: Byte;                    { Effect argument }
  61.         vol: Byte;                    { Volume                0xFF : no volume cmd }
  62.         unused: Byte;
  63.     end;
  64.     CmdPtr = ^Cmd;
  65.     
  66.     PatHeader = record        { HEADER }
  67.         size: LongInt;                        { Length of pattern: standard = 64 }
  68.         compMode: LongInt;                { Compression mode, none = 'NONE' }
  69.         name: packed array [0..31] of Char;
  70.         patBytes: LongInt;                { Pattern Size in Bytes }
  71.         unused2: LongInt;
  72.     end;
  73.     PatHeaderPtr = ^PatHeader;
  74.  
  75.     PatData = record        { DATA STRUCTURE : HEADER + COMMANDS }
  76.         header: PatHeader;            { Pattern = 64 notes to play }
  77.         Cmds: array [0..0] of Cmd;
  78.     end;
  79.     PatDataPtr = ^PatData;
  80.  
  81. {
  82.  ***    
  83.  ***    INSTRUMENT DESCRIPTION
  84.  ***    
  85. }
  86.     sData    = record        { SAMPLE }
  87.         size: LongInt;                { Sample length }
  88.         loopBeg: LongInt;            { LoopStart }
  89.         loopSize: LongInt;            { LoopLength }
  90.         vol: Byte;                         { Base volume }
  91.         c2spd: UnsignedWord;                { c2spd }
  92.         loopType: Byte;
  93.         amp: Byte;                         { 8 or 16 bits }
  94.         panning: Byte;
  95.         relNote: SignedByte;
  96.         name: packed array [0..31] of Char;{ Sample name }
  97.         data: Ptr;                         { Used only in memory, not in files }
  98.     end;
  99.     sDataPtr = ^sData;
  100.  
  101.     EnvRec = record    { Volume Envelope }
  102.         pos: Integer;                     { pos }
  103.         val: Integer;                     { val }
  104.     end;
  105.     EnvRecPtr = ^EnvRec;
  106.  
  107.     InstrData = record                         { INSTRUMENT }
  108.         name: packed array [0..31] of Char;            { instrument name }
  109.         theType: Byte;                                         { Instrument type = 0 }
  110.  
  111.         numSamples: Integer;                             { Number of samples in instrument }
  112.  
  113.         {}
  114.  
  115.         what: array [0..95] of Byte;             { Sample number for all notes }
  116.         volEnv: array [0..11] of EnvRec;    { Points for volume envelope }
  117.         pannEnv: array [0..11] of EnvRec;    { Points for panning envelope }
  118.         
  119.         volSize: Byte;                                         { Number of volume points }
  120.         pannSize: Byte;                                         { Number of panning points }
  121.         
  122.         volSus: Byte;                                             { Volume sustain point }
  123.         volBeg: Byte;                                             { Volume loop start point }
  124.         volEnd: Byte;                                             { Volume loop end point }
  125.         
  126.         pannSus: Byte;                                         { Panning sustain point }
  127.         pannBeg: Byte;                                         { Panning loop start point }
  128.         pannEnd: Byte;                                         { Panning loop end point }
  129.  
  130.         volType: Byte;                                         { Volume type: bit 0: On; 1: Sustain; 2: Loop }
  131.         pannType: Byte;                                         { Panning type: bit 0: On; 1: Sustain; 2: Loop }
  132.         
  133.         volFade: UnsignedWord;                        { Volume fadeout }
  134.         
  135.         vibDepth: Byte;
  136.         vibRate: Byte;
  137.     end;
  138.     InstrDataPtr = ^InstrData;
  139.  
  140. {
  141. ***    
  142. ***    MAD FILE HEADER DESCRIPTION
  143. ***    
  144. }
  145.     MADSpec = record
  146.         MAD: LongInt;                                             { Mad Identification: MADG in version 2.0 }
  147.         name: packed array [0..31] of Char;            { Music's name }
  148.         infos: packed array [0..255] of Char;        { Informations & Author name of the music }
  149.         numPat: Byte;                                             { Patterns number }
  150.         numChn: Byte;                                             { Channels number }
  151.         numPointers: Byte;                                 { Partition length }
  152.         oPointers: array [0..255] of Byte;{ Partition : Patterns ID List }
  153.         speed: Integer;                                         { Default speed }
  154.         tempo: Integer;                                         { Default tempo }
  155.         fid: array [0..63] of InstrData;    { Instruments description }
  156.     end;
  157.     MADSpecPtr = ^MADSpec;
  158.  
  159. {$ALIGN RESET}
  160.  
  161. end.