home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
multikit.zip
/
SOUND.DOC
< prev
next >
Wrap
Text File
|
1996-03-01
|
10KB
|
176 lines
Documentation ─────────────────────────────────────────────────────────────┐
│ SOUND Unit Documentation │
└───────────────────────────────────────────────────────────── MULTIKIT v1.0
The development of soundcards for the IBM PC compatible started off with the
ADLIB card several years ago. It was followed by the Soundblaster created by
Creative Labs which became standard on the PC. This device made it possible
to play digitized voices and from that time on the MODule file format which
came from the AMIGA actually became very popular. Nowadays the original for-
mat is a little bit antiquated because it was restricted to four channels
maximum. The newest players are supporting up to 32 channels, 16 bit samples
and much more effects than the original AMIGA module format. MULTIKIT allows
you to play modules if a GUS or a SB2+ is installed.
Read the following instructions before you use this unit in your programs:
(1) Every module file which you want to load with LOADMOD must be compres-
sed with COMPRESS (a MULTIKIT tool). This serves two purposes: reduc-
tion of the data size and crypting the file which prevents the "rip-
ping" of the module from your file(s).
(2) The module must cover the following requirements: only M.K. or FLT4,
6CHN, 8CHN or OCTA supported (not more than eight channels), sample
size always equal or less 65527 bytes, not more than 64 patterns, pat-
tern and sample data must fit in base memory.
(3) The player for the GUS differs from the SB2 player. As you probably
know the Gravis Ultrasound has hardware mixing and integrated effects
for samples but on Soundblaster you must do the mixing and effects in
realtime by requesting CPU power. Therefore the Soundblaster player
doesn't support all the effects (this would slow down you computer).
See the last chapter for more detailed information!
(4) CLOCK.TPU is needed because the module playing requires the allocation
of an internal timer handle. You must run CLOCKINIT (for frequency val-
ues see below) before you can play any modules. Remember to call CLOCK-
DONE before exiting your program. Be sure that there is at least one
free handle available for the player.
(5) Module playing is (espechially on Soundblaster) a time-critical process
and because of this you should avoid any disk access during the playing
of a module. Anyway the player should work stable.
Global types, constants and variables
─────────────────────────────────────
Type
ModType = ^ModInfoRec; The information of each single
ModInfoRec = Record module is stored in such a re-
miChannels: Byte; cord after is has been loaded.
miOrderLen: Byte; This is critical data. Changes
miReStart: Byte; could cause the crash of the
miOrder: Array[1..128] Of Byte; program.
miPatterns: Array[1..64] Of Pointer;
misampGUS: Array[1..31] Of LongInt;
miSampOfs: Array[1..31] Of Word;
miSampSeg: Array[1..31] Of Word;
miSampLen: Array[1..31] Of Word;
miSampRep: Array[1..31] Of Word;
miSampRepLen: Array[1..31] Of Word;
miSampFnTune: Array[1..31] Of Word;
miSampVol: Array[1..31] Of Word;
End;
Const
MixSpeed: Word = 22050; Mixing speed
MidCRate: Word = 8448; Middle C rate
DefTempo: Byte = 6; Default speed
DefBpm: Byte = 125; Default beats per minute
NONE = 0; Constants for
SB2 = 1; SOUNDCARD.DEVICE are avail-
GUS = 2; able after calling INITDEV.
NoError = 0; Constants for the values re-
FileErr = 1; turned by LOADMOD.
DataErr = 2;
Var
SoundCard: Record Holds the data of the detec-
Device: Byte; ted soundcard after INITDEV.
Addr: Word; You can change it manually if
Irq: Word; the autodetection fails.
End;
MainVolume: Word; Global volume rate
OrderPos, Number of current pattern
Row: Byte; Number of current row
Public procedures and functions
───────────────────────────────
Procedure InitDev;
This procedure detects and initialises the installed playback de-
vice. Currently GUS and Soundblaster are supported. The program
has been tested on SB Pro (Thanks to OKULAR), SB 16 and GUS MAX
(Thanks to Benjamin.Tuerpe@Informatik.TU-Chemnitz.DE). If you've
both (Soundblaster and GUS) then the GUS is preferred.
Function LoadMod(FName: String; FSeek: LongInt; Var Module: ModType): Byte;
Loads from the file FNAME at position FSEEK a compressed module
into the base memory.
Procedure FreeMod(Var Module: ModType);
Remove all data and free all memory allocated by MODULE.
Procedure PlayMod(Var Module: ModType);
Plays the specified MODULE through your soundcard.
Procedure StopMod;
Stops the playback. Call it only, if you're really playing!
Supported effects and differences between the players
─────────────────────────────────────────────────────
┌────────────────────────────┬──────────────────────┬──────────────────────┐
│ │ GUS │ SB2 │
├────────────────────────────┼──────────────────────┼──────────────────────┤
│ At least required │ │ │
│ timer frequency │ 1000Hz │ MIXSPEED DIV 1024 │
│ (CLOCKINIT) │ │ │
├────────────────────────────┼──────────────────────┼──────────────────────┤
│ Available variables │ │ │
│ │ │ │
│ MixSpeed │ No │ Yes │
│ MidCRate │ No │ Yes │
│ DefTempo │ Yes │ Yes │
│ DefBpm │ Yes │ Yes │
│ │ │ │
│ SoundCard.Device │ Yes │ Yes │
│ SoundCard.Addr │ Yes │ Yes │
│ SoundCard.Irq │ No │ Yes │
│ │ │ │
│ MainVolume │ Yes │ No │
│ OrderPos │ Yes │ Yes │
│ Row │ Yes │ Yes │
│ │ │ │
├────────────────────────────┼──────────────────────┼──────────────────────┤
│ Available Effects │ │ │
│ │ │ │
│ 00 Arpeggio │ Yes │ Should be │
│ 01 Portamento up │ Yes │ Yes │
│ 02 Portamento down │ Yes │ Yes │
│ 03 Portamento to note │ Yes │ Yes │
│ 04 Vibrato │ Yes │ Yes │
│ 05 Portamento + vol slide │ Yes │ Yes │
│ 06 Vibrato + volume slide │ Yes │ Yes │
│ 09 Offset │ Yes │ Yes │
│ 0A Volume slide │ Yes │ Yes │
│ 0B Position jump │ Yes │ Yes │
│ 0C Volume │ Yes │ Yes │
│ 0D Break pattern │ Yes │ Yes │
│ 0F Speed set and BPM set │ Yes │ Yes │
│ │ │ │
│ E1 Fine portamento up │ Yes │ No │
│ E2 Fine portamento down │ Yes │ No │
│ E9 Retrig note │ Yes │ No │
│ EA Fine volume up │ Yes │ No │
│ EB Fine volume down │ Yes │ No │
│ EC Cut note │ Yes │ No │
│ ED Delay note │ Yes │ No │
└────────────────────────────┴──────────────────────┴──────────────────────┘
This unit is part of MULTIKIT.
(C) Copyright by TSC-Software, 1996.