1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
2<head>
3<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
4<title>SNDInstData</title>
5<link rel="stylesheet" href="../css/nitro.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
7</head>
8<body>
9<div class="refentry" lang="ja"><a name="IDAKKWT"></a><div class="titlepage">
10<div></div>
11<div></div>
12</div>
13<h1>SNDInstData <IMG src="../image/NTR.gif" width="24" height="12" border="0" align=middle><IMG src="../image/TWL.gif" width="24" height="12" border="0" align=middle></h1>
14<h2>Definition</h2>
15<dl>
16<dd><pre class="funcsynopsisinfo"><code>#include &lt;nitro/snd.h&gt;</code></pre></dd>
17<dd><pre class="funcsynopsisinfo"><code>typedef struct SNDInstData
18{
19    u8 type;
20    u8 padding_;
21
22    struct SNDInstParam {
23        u16 wave[2];
24        u8 original_key;
25        u8 attack;
26        u8 decay;
27        u8 sustain;
28        u8 release;
29        u8 pan;
30    } param;
31} SNDInstData;
32</code></pre></dd>
33<dd><pre class="funcprototype"></pre></dd>
34</dl>
35<div class="refsection" lang="ja"><a name="IDATMWT"></a>
36      <h2>Elements</h2>
37
38      <div class="variablelist">
39<table border="0">
40<col align="left" valign="top">
41<tbody>
42<tr>
43<td><em><strong><code>type</code></strong></em></td>
44<td>The instrument type</td>
45</tr>
46<tr>
47<td><em><strong><code>wave</code></strong></em></td>
48<td>The waveform data information array</td>
49</tr>
50<tr>
51<td><em><strong><code>original_key</code></strong></em></td>
52<td>The original key. 60 is center node. </td>
53</tr>
54<tr>
55<td><em><strong><code>attack</code></strong></em></td>
56<td>The envelope's attack. Takes values in the range of 0 to 127. The larger the value, the faster the rise. </td>
57</tr>
58<tr>
59<td><em><strong><code>decay</code></strong></em></td>
60<td>The envelope's decay. Takes values in the range of 0 to 127. The larger the value, the faster the attenuation. </td>
61</tr>
62<tr>
63<td><em><strong><code>sustain</code></strong></em></td>
64<td>The envelope's sustain. Takes values in the range of 0 to 127. The larger the value, the higher the sustained gain. </td>
65</tr>
66<tr>
67<td><em><strong><code>release</code></strong></em></td>
68<td>The envelope's release. Takes values in the range of 0 to 127. The larger the value, the faster the attenuation.
69            <span class="note">(However, when the value is <code>SND_BANK_DISABLE_RELEASE(=255)</code>, it will not release, even when the note is off.)</span>)</td>
70</tr>
71<tr>
72<td><em><strong><code>pan</code></strong></em></td>
73<td>The pan. Takes values in the range of 0 (left) to 64 (center) to 127 (right).</td>
74</tr>
75</tbody>
76</table>
77</div>
78    </div>
79<div class="refsection" lang="ja"><a name="IDATOWT"></a>
80      <h2>Description</h2>
81      <p>
82The instrument data structure. This structure stores the parameters for each instrument inside the bank data.
83</p>
84      <p>
85This structure can be obtained with the <tt class="function"><a href="SND_ReadInstData.html">SND_ReadInstData</a></tt> function and updated with the <tt class="function"><a href="SND_WriteInstData.html">SND_WriteInstData</a></tt> function.
86</p>
87      <p>
88The instrument type takes the following values:
89</p>
90      <div class="table"><a name="IDALPWT"></a><p class="title"><b><font size="-1">TABLE: SNDInstType</b></p>
91<table summary="SNDInstType" border="1">
92<colgroup><col><col></colgroup>
93<thead>
94<tr>
95<th>Label</th>
96<th>Description</th>
97</tr>
98</thead>
99<tbody>
100<tr>
101<td>SND_INST_PCM</td>
102<td>PCM waveform data</td>
103</tr>
104<tr>
105<td>SND_INST_PSG</td>
106<td>PSG rectangular wave</td>
107</tr>
108<tr>
109<td>SND_INST_NOISE</td>
110<td>Noise</td>
111</tr>
112<tr>
113<td>SND_INST_DIRECTPCM</td>
114<td>PCM waveform data (direct address specification)</td>
115</tr>
116<tr>
117<td>SND_INST_NULL</td>
118<td>Dummy instrument (Does not sound)</td>
119</tr>
120</tbody>
121</table>
122</div>
123
124      <p>
125The waveform information array <em><strong><code>wave</code></strong></em> holds information about the waveform data. The meaning of this data differs for each instrument <em><strong><code>type</code></strong></em>.
126</p>
127
128      <div class="table"><a name="IDAORWT"></a><p class="title"><b><font size="-1">TABLE: Waveform Information Array</b></p>
129<table summary="wave pattern information arrangement" border="1">
130<colgroup><col><col><col></colgroup>
131<thead>
132<tr>
133<th>Inst Type</th>
134<th>wave[0]</th>
135<th>wave[1]</th>
136</tr>
137</thead>
138<tbody>
139<tr>
140<td>SND_INST_PCM</td>
141<td>Index number inside the Waveform Archive</td>
142<td>Waveform Archive number inside the bank</td>
143</tr>
144<tr>
145<td>SND_INST_PSG</td>
146<td>Duty ratio</td>
147<td>(Not Used)</td>
148</tr>
149<tr>
150<td>SND_INST_NOISE</td>
151<td>(Not Used)</td>
152<td>(Not Used)</td>
153</tr>
154<tr>
155<td>SND_INST_DIRECTPCM</td>
156<td>Lower 16 bits of the address of the <a href="SNDWaveData.html"><code>SNDWaveData</code></a> structure</td>
157<td>Upper 16 bits of the address of the <code><a href="SNDWaveData.html">SNDWaveData</a></code> structure</td>
158</tr>
159<tr>
160<td>SND_INST_NULL</td>
161<td>(Not Used)</td>
162<td>(Not Used)</td>
163</tr>
164</tbody>
165</table>
166</div>
167
168    </div>
169<h2>See Also</h2>
170<p><a href="SND_ReadInstData.html"><code>SND_ReadInstData</code></a>, <a href="SND_WriteInstData.html"><code>SND_WriteInstData</code></a>, <a href="SNDWaveData.html"><code>SNDWaveData</code></a></p>
171<h2>Revision History</h2>
172<p>
1732005/05/10 Added description of operations when <SPAN class="argument">release</SPAN> is 255. <br>2005/03/17 Added the <code>SND_INST_NULL</code> instrument type. <br>2005/01/19 Added a link to <code>SNDWaveData</code>. <br>2004/10/21 Fixed a typo in the required include file. <br>2004/07/20 Initial version.
174</p>
175</div>
176<hr><p>CONFIDENTIAL</p></body>
177</html>
178