home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-03-13 | 3.9 KB | 161 lines | [TEXT/CWIE] |
- {
- ******************** ***********************
-
- Player PRO 4.5x -- MAD Music Driver Definition -
-
- Library Version 4.5
-
- To use with MADH Library for CodeWarrior
-
- Antoine ROSSET
- 16 Tranchees
- 1206 GENEVA
- SWITZERLAND
-
- Thank you for your interest in PlayerPRO !
-
- FAX: (+41 22) 346 11 97
- PHONE: (+41 79) 203 74 62
- Internet: rosset@dial.eunet.ch
-
-
- Ported to Pascal by Federico Filipponi (March 1997)
- e-mail: fedefil@fub.it
- fedefil@kagi.com
-
- Based on a previous work by Matthias Wuttke
- e-mail: wuttke@stein.teuto.de
- matthias@kagi.com
-
- ******************** ***********************
- }
-
- unit MAD;
-
- interface
-
- {$ALIGN MAC68K}
-
- uses
- Types;
-
- const
- DEFAULT_VOLFADE = 300;
-
- { INSTR. DESCRIPTION }
- EFON = 1;
- EFSUSTAIN = 2;
- EFLOOP = 4;
-
- {
- ***
- *** PATTERN DESCRIPTION
- ***
- }
- type
- Cmd = record { COMMAND }
- ins: Byte; { Instrument no 0x00: no ins cmd }
- note: Byte; { Note, see table 0xFF : no note cmd }
- cmd: Byte; { Effect cmd }
- arg: Byte; { Effect argument }
- vol: Byte; { Volume 0xFF : no volume cmd }
- unused: Byte;
- end;
- CmdPtr = ^Cmd;
-
- PatHeader = record { HEADER }
- size: LongInt; { Length of pattern: standard = 64 }
- compMode: LongInt; { Compression mode, none = 'NONE' }
- name: packed array [0..31] of Char;
- patBytes: LongInt; { Pattern Size in Bytes }
- unused2: LongInt;
- end;
- PatHeaderPtr = ^PatHeader;
-
- PatData = record { DATA STRUCTURE : HEADER + COMMANDS }
- header: PatHeader; { Pattern = 64 notes to play }
- Cmds: array [0..0] of Cmd;
- end;
- PatDataPtr = ^PatData;
-
- {
- ***
- *** INSTRUMENT DESCRIPTION
- ***
- }
- sData = record { SAMPLE }
- size: LongInt; { Sample length }
- loopBeg: LongInt; { LoopStart }
- loopSize: LongInt; { LoopLength }
- vol: Byte; { Base volume }
- c2spd: UnsignedWord; { c2spd }
- loopType: Byte;
- amp: Byte; { 8 or 16 bits }
- panning: Byte;
- relNote: SignedByte;
- name: packed array [0..31] of Char;{ Sample name }
- data: Ptr; { Used only in memory, not in files }
- end;
- sDataPtr = ^sData;
-
- EnvRec = record { Volume Envelope }
- pos: Integer; { pos }
- val: Integer; { val }
- end;
- EnvRecPtr = ^EnvRec;
-
- InstrData = record { INSTRUMENT }
- name: packed array [0..31] of Char; { instrument name }
- theType: Byte; { Instrument type = 0 }
-
- numSamples: Integer; { Number of samples in instrument }
-
- {}
-
- what: array [0..95] of Byte; { Sample number for all notes }
- volEnv: array [0..11] of EnvRec; { Points for volume envelope }
- pannEnv: array [0..11] of EnvRec; { Points for panning envelope }
-
- volSize: Byte; { Number of volume points }
- pannSize: Byte; { Number of panning points }
-
- volSus: Byte; { Volume sustain point }
- volBeg: Byte; { Volume loop start point }
- volEnd: Byte; { Volume loop end point }
-
- pannSus: Byte; { Panning sustain point }
- pannBeg: Byte; { Panning loop start point }
- pannEnd: Byte; { Panning loop end point }
-
- volType: Byte; { Volume type: bit 0: On; 1: Sustain; 2: Loop }
- pannType: Byte; { Panning type: bit 0: On; 1: Sustain; 2: Loop }
-
- volFade: UnsignedWord; { Volume fadeout }
-
- vibDepth: Byte;
- vibRate: Byte;
- end;
- InstrDataPtr = ^InstrData;
-
- {
- ***
- *** MAD FILE HEADER DESCRIPTION
- ***
- }
- MADSpec = record
- MAD: LongInt; { Mad Identification: MADG in version 2.0 }
- name: packed array [0..31] of Char; { Music's name }
- infos: packed array [0..255] of Char; { Informations & Author name of the music }
- numPat: Byte; { Patterns number }
- numChn: Byte; { Channels number }
- numPointers: Byte; { Partition length }
- oPointers: array [0..255] of Byte;{ Partition : Patterns ID List }
- speed: Integer; { Default speed }
- tempo: Integer; { Default tempo }
- fid: array [0..63] of InstrData; { Instruments description }
- end;
- MADSpecPtr = ^MADSpec;
-
- {$ALIGN RESET}
-
- end.