1#ifndef _ULTRASOUND_H_
2#define _ULTRASOUND_H_
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53#define _GUS_NUMVOICES 0x00
54#define _GUS_VOICESAMPLE 0x01
55#define _GUS_VOICEON 0x02
56#define _GUS_VOICEOFF 0x03
57#define _GUS_VOICEMODE 0x04
58#define _GUS_VOICEBALA 0x05
59#define _GUS_VOICEFREQ 0x06
60#define _GUS_VOICEVOL 0x07
61#define _GUS_RAMPRANGE 0x08
62#define _GUS_RAMPRATE 0x09
63#define _GUS_RAMPMODE 0x0a
64#define _GUS_RAMPON 0x0b
65#define _GUS_RAMPOFF 0x0c
66#define _GUS_VOICEFADE 0x0d
67#define _GUS_VOLUME_SCALE 0x0e
68#define _GUS_VOICEVOL2 0x0f
69#define _GUS_VOICE_POS 0x10
70
71
72
73
74
75#define _GUS_CMD(chn, voice, cmd, p1, p2) \
76 {_SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_PRIVATE;\
77 _seqbuf[_seqbufptr+1] = (chn); _seqbuf[_seqbufptr+2] = cmd;\
78 _seqbuf[_seqbufptr+3] = voice;\
79 *(unsigned short*)&_seqbuf[_seqbufptr+4] = p1;\
80 *(unsigned short*)&_seqbuf[_seqbufptr+6] = p2;\
81 _SEQ_ADVBUF(8);}
82
83#define GUS_NUMVOICES(chn, p1) _GUS_CMD(chn, 0, _GUS_NUMVOICES, (p1), 0)
84#define GUS_VOICESAMPLE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICESAMPLE, (p1), 0)
85#define GUS_VOICEON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEON, (p1), 0)
86#define GUS_VOICEOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEOFF, 0, 0)
87#define GUS_VOICEFADE(chn, voice) _GUS_CMD(chn, voice, _GUS_VOICEFADE, 0, 0)
88#define GUS_VOICEMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEMODE, (p1), 0)
89#define GUS_VOICEBALA(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEBALA, (p1), 0)
90#define GUS_VOICEFREQ(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICEFREQ, \
91 (p) & 0xffff, ((p) >> 16) & 0xffff)
92#define GUS_VOICEVOL(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL, (p1), 0)
93#define GUS_VOICEVOL2(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_VOICEVOL2, (p1), 0)
94#define GUS_RAMPRANGE(chn, voice, low, high) _GUS_CMD(chn, voice, _GUS_RAMPRANGE, (low), (high))
95#define GUS_RAMPRATE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_RAMPRATE, (p1), (p2))
96#define GUS_RAMPMODE(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPMODE, (p1), 0)
97#define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0)
98#define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0)
99#define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2))
100#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \
101 (p) & 0xffff, ((p) >> 16) & 0xffff)
102
103#endif
104