1 #ifndef _DOSLIB_SND_H_
\r
2 #define _DOSLIB_SND_H_
\r
3 /* C Header File: ADLIB *****************************************************
\r
7 Last Amended: 27th April, 1993
\r
9 Description: Low-level interface to the Adlib (or compatible)
\r
10 FM sound card. All information gleaned from
\r
11 Jeffrey S. Lee's "Programming the Adlib/Sound
\r
12 Blaster FM Music Chips". See Lee's document for
\r
13 further information.
\r
15 Compiled succesfully under Turbo C, Borland C++,
\r
16 and Microsoft Quick C (all latest versions).
\r
18 ****************************************************************************/
\r
19 #include "src\lib\lib_com.h"
\r
22 #define FACTOR 1193180
\r
25 #define MIN_REGISTER 0x01
\r
26 #define MAX_REGISTER 0xF5
\r
27 #define ADLIB_FM_ADDRESS 0x388 /* adlib address/status register */
\r
28 #define ADLIB_FM_DATA 0x389 /* adlib data register */
\r
31 static int percussiveMode = 0,currentBDContents = 0;
\r
32 //static int opTable[18] = {0,1,2,3,4,5,8,9,10,11,12,13,16,17,18,19,20,21};
\r
33 static int voiceModulator[11] = {0,1,2,6,7,8,12,16,14,17,13};
\r
34 static int voiceCarrier[9] = {3,4,5,9,10,11,15,16,17};
\r
38 * FM Instrument definition for .SBI files - SoundBlaster instrument
\r
39 * - these are the important parts - we will skip the header, but since
\r
40 * I am not sure where it starts and ends so I have had to guess.
\r
41 * However it SEEMS! to work. Each array has two values, one for
\r
45 byte SoundCharacteristic[2]; /* modulator frequency multiple... */
\r
46 byte Level[2]; /* modulator frequency level... */
\r
47 byte AttackDecay[2]; /* modulator attack/decay... */
\r
48 byte SustainRelease[2]; /* modulator sustain/release... */
\r
49 byte WaveSelect[2]; /* output waveform distortion */
\r
50 byte Feedback; /* feedback algorithm and strength */
\r
54 * Enumerated F-Numbers (in octave 4) for the chromatic scale.
\r
87 /* function prototyping */
\r
88 void WriteFM(int reg, int value);
\r
90 int AdlibExists(void);
\r
91 void FMReset(/*int percusiveMode*/); /* Resets the card, quiets all voices, sets the percussive mode state */
\r
92 void FMKeyOff(int voice);
\r
93 void FMKeyOn(int voice, int freq, int octave);
\r
94 void FMVoiceVolume(int voice, int vol);
\r
95 void FMSetVoice(int voiceNum, FMInstrument *ins);
\r
96 /* Remember: percussion instruments must be assigned only to the correct voice number. */
\r
97 //void FMSetPercusiveMode(int state);
\r
98 //int LoadSBI(char filename[], FMInstrument *ins);
\r
101 #endif/*_DOSLIB_SND_H_*/