MusStartEffect2.html
6.37 KB
1
2
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<html>
<head>
<title>NINTENDO64 Sound Tools Programing Manual</title>
</head>
<body bgcolor="#d0d0d0" text="#000000" link="#008000" vlink="#008000">
<h1><font color="#000080">MusStartEffect2()</font></h1>
<h2><font color="#ff0000">$B%W%m%H%?%$%W@k8@(B</font></h2>
<pre> musHandle <strong>MusStartEffect2</strong>(int <font color="#0000ff">number</font>, int <font color="#0000ff">volume</font>, int <font color="#0000ff">pan</font>, int <font color="#0000ff">overwrite</font>, int <font color="#0000ff">priority</font>);</pre>
<h2><font color="#ff0000">$B0z?t(B</font></h2>
<table>
<tr>
<td valign="top">
<font color="#0000ff"><code>number</code></font>
</td>
<td>
$B%5%&%s%I%(%U%'%/%H$NHV9f(B
</td>
</tr>
<tr>
<td valign="top">
<font color="#0000ff"><code>volume</code></font>
</td>
<td>
$B%\%j%e!<%`%9%1!<%k(B
</td>
</tr>
<tr>
<td valign="top">
<font color="#0000ff"><code>pan</code></font>
</td>
<td>
$B%Q%s%9%1!<%k(B
</td>
</tr>
<tr>
<td valign="top">
<font color="#0000ff"><code>overwrite</code></font>
</td>
<td>
$BF1$8HV9f$N%*!<%P!<%i%$%H!J>e=q$-MQ!K%5%&%s%I%(%U%'%/%H(B
</td>
</tr>
<tr>
<td valign="top">
<font color="#0000ff"><code>priority</code></font>
</td>
<td>
$B%W%i%$%*%j%F%#%l%Y%k(B
</td>
</tr>
</table>
<h2><font color="#ff0000">$B@bL@(B</font></h2>
<p>$B%3%s%H%m!<%k%Q%i%a!<%?$rMQ$$$F%5%&%s%I%(%U%'%/%H$r3+;O$7$^$9!#$3$N4X?t$O%W%m%0%i%^$,!"%\%j%e!<%`%9%1!<%k$H%Q%s%9%1!<%k$NCM$r;XDj$7!"F1$8HV9f$N%5%&%s%I%(%U%'%/%H$r%*!<%P!<%i%$%H$9$k$?$a$N%A%c%s%M%k3d$jEv$F4X?t$N%U%i%0$rMQ0U$7!"%W%i%$%*%j%F%#$NCM$r;XDj$G$-$k$h$&$K!"%5%&%s%I%(%U%'%/%H$r3+;O$7$^$9!#(B</p>
<p><a href="MusFxBankSetSingle.html"><code>MusFxBankSetSingle()</code></a>$B4X?t$G%*!<%P!<%i%$%I$,@_Dj$5$l$F$$$J$$8B$j3+;O$7$?%5%&%s%I%(%U%'%/%H$K$O%G%U%)%k%H$N%5%&%s%I%(%U%'%/%H%P%s%/$,;HMQ$5$l$^$9!#%5%&%s%I%(%U%'%/%H%P%s%/$,@_Dj$5$l$F$$$?$N$J$i!"$3$N4X?t$O$=$N%5%&%s%I%(%U%'%/%H%*!<%P!<%i%$%I$r;HMQ$7!"$=$N%*!<%P!<%i%$%I$r%/%j%"$7$^$9!#(B</p>
<p>$B%5%s%W%k%P%s%/%*!<%P!<%i%$%I$,(B<a href="MusFxBankSetPtrBank.html"><code>MusFxBankSetPtrBank()</code></a>$B4X?t!"$^$?$O$h$j9b$$%W%i%$%*%j%F%#$r;}$D(B<a href="MusPtrBankSetSingle.html"><code>MusPtrBankSetSingle()</code></a>$B4X?t$G@_Dj$5$l$F$$$J$$8B$j%5%&%s%I%(%U%'%/%H$O%G%U%)%k%H$N%5%s%W%k%P%s%/$r;H$$$^$9!#%5%s%W%k%P%s%/%*!<%P!<%i%$%I$,(B<a href="MusPtrBankSetSingle.html"><code>MusPtrBankSetSingle()</code></a>$B4X?t$G@_Dj$5$l$F$$$?$N$J$i!"$3$N4X?t$O$=$N%5%&%s%I%(%U%'%/%H%*!<%P!<%i%$%I$r;HMQ$7!"$=$N%*!<%P!<%i%$%I$r%/%j%"$7$^$9!#(B</p>
<p><font color="#0000ff"><code>number</code></font>$B$NCM$O!"(B0$B$+$i%5%&%s%I%(%U%'%/%H$N?t$NHO0O$N?tCM$G$9!#MxMQ2DG=$J%5%&%s%I%(%U%'%/%H$N?t$O(B<a href="MusFxBankNumberOfEffects.html"><code>MusFxBankNumberOfEffects()</code></a>$B4X?t$r;HMQ$9$k$3$H$GJ,$+$j$^$9!#8=:_$N(B'#defines'$B$N%j%9%H$O%5%&%s%I%(%U%'%/%H%P%s%/$K4X$9$k%X%C%@%U%!%$%k(B(NINTENDO64 Sound Tools$B$+$iF@$i$l$^$9(B)$B$KB8:_$7$F$$$^$9!#$3$l$O?t;z$h$j$bL>A0$G%5%&%s%I%(%U%'%/%H$r;XDj$7$?$$%W%m%0%i%^$,MxMQ$G$-$^$9!#(B</p>
<p><font color="#0000ff"><code>volume</code></font>$B$NCM$O(B0$B$+$i(B0x100(256)$B$NHO0OFb$G$"$k$Y$-$G$9!#$3$NHO0O$O85!9$N%5%&%s%I%G!<%?$NCf$GDj5A$5$l$?CM$N(B0%$B$+$i(B200%$B$rI=$7$F$$$^$9!#%G%U%)%k%H$N%\%j%e!<%`%9%1!<%k$NCM$O$9$Y$F$N%A%c%s%M%k$K4X$7$F(B0x80(100%)$B$G$9!#$3$NCM$O(B<a href="MusHandleSetVolume.html"><code>MusHandleSetVolume()</code></a>$B4X?t$K$h$C$FMW5a$5$l$?%\%j%e!<%`$NCM$HF1$8$G$9!#(B</p>
<p><font color="#0000ff"><code>pan</code></font>$B$NCM$O(B0$B$+$i(B0x100(256)$B$NHO0OFb$G$"$k$Y$-$G$9!#$3$NHO0O$O85!9$N%5%&%s%I%G!<%?$NCf$GDj5A$5$l$?CM$N(B0%$B$+$i(B200%$B$rI=$7$F$$$^$9!#%G%U%)%k%H$N%Q%s%]%8%7%g%s%9%1!<%k$NCM$O$9$Y$F$N%A%c%s%M%k$K4X$7$F(B0x80(100%)$B$G$9!#$3$l$O(B<a href="MusHandleSetPan.html"><code>MusHandleSetPan()</code></a>$B4X?t$K$h$C$FMW5a$5$l$?%Q%s$NCM$HF1$8$G$9!#(B</p>
<p><font color="#0000ff"><code>overwrite</code></font>$B%U%i%0$O%A%c%s%M%k3d$jEv$F$N%W%m%;%9$K1F6A$7$^$9!#%U%i%0$,(B0$B$G$J$$>l9g!"!"$b$7%5%&%s%I%(%U%'%/%H$NHV9f$,8=:_:F@8Cf$G$"$l$P!"$=$N%A%c%s%M%k$O?7$7$$%5%&%s%I%(%U%'%/%H$K$h$C$F;HMQ$5$l$^$9!#(B</p>
<p><font color="#0000ff"><code>priority</code></font>$B$NCM$K$h$C$F%W%m%0%i%^$OH`$iFH<+$N%W%i%$%*%j%F%#%l%Y%k$rM?$($i$l$k$h$&$K$J$j$^$9!#$b$7$3$NCM$,(B-1$B$K@_Dj$5$l$?$J$i!"%5%&%s%I%(%U%'%/%H$O%5%&%s%I%G!<%?$NCf$GM?$($i$l$?%W%i%$%*%j%F%#$NCM$G3+;O$5$l$^$9!#(B</p>
<h2><font color="#ff0000">$BLa$jCM(B</font></h2>
<p>$B%5%&%s%I%O%s%I%i!"$"$k$$$O$b$7%5%&%s%I%(%U%'%/%H$,%H%j%,$5$l$F$$$J$1$l$P(B0</p>
<h2><font color="#ff0000">$BNc(B</font></h2>
<pre> unsigned long Start3DSfx(int effect, float distance, float angle)
{
int scale; <font color="#800000">/* distance scale 16-bit fraction */</font>
int priority; <font color="#800000">/* adjusted priority level */</font>
int pan; <font color="#800000">/* pan scale value */</font>
int volume; <font color="#800000">/* volume level */</font>
<font color="#800000">/* calculate distance scale */</font>
if (distance>=MAX_DISTANCE)
return (0); <font color="#800000">/* sound is too far away! */</font>
distance = (MAX_DISTANCE-distance)*(65536.0/MAX_DISTANCE);
scale = (int)distance;
<font color="#800000">/* calculate pan position */</font>
if (angle>180.0)
angle -= 180.0;
else
angle = 180.0-angle;
angle = angle*(256.0/180.0);
pan = (int)angle;
<font color="#800000">/* calculate priority value */</font>
priority = Priority[effect]+((scale*MAX_PRI_CHANGE)>>16);
<font color="#800000">/* calculate volume level */</font>
volume = (0x80*scale)>>16;
return (<strong>StartSoundEffect2</strong>(effect, volume, pan, 1, priority));
}
</pre>
<h2><font color="#ff0000">$B;2>H(B</font></h2>
<a href="MusStartEffect.html"><code>MusStartEffect()</code></a>,
<a href="MusHandleAsk.html"><code>MusHandleAsk()</code></a>,
<a href="MusHandleSetFreqOffset.html"><code>MusHandleSetFreqOffset()</code></a>,
<a href="MusHandleSetPan.html"><code>MusHandleSetPan()</code></a>,
<a href="MusHandleSetVolume.html"><code>MusHandleSetVolume()</code></a>,
<a href="MusHandleStop.html"><code>MusHandleStop()</code></a>,
<a href="MusSetMasterVolume.html"><code>MusSetMasterVolume()</code></a>,
<a href="MusAsk.html"><code>MusAsk()</code></a>,
<a href="MusStop.html"><code>MusStop()</code></a>
</body>
</html>