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>SND_SetupChannelNoise</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="IDAFLWT"></a><div class="titlepage">
10<div></div>
11<div></div>
12</div>
13<h1>SND_SetupChannelNoise <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>Syntax</h2>
15<dl>
16<dd><pre class="funcsynopsisinfo"><code>#include &lt;nitro/snd.h&gt;</code></pre></dd>
17<dd><pre class="funcprototype"><code class="funcprototype">void SND_SetupChannelNoise(
18        int <var>chNo</var>,
19        int <var>volume</var>,
20        SNDChannelDataShift <var>shift</var>,
21        int <var>timer</var>,
22        int <var>pan</var> );</code><br></pre></dd>
23</dl>
24<div class="refsection" lang="ja"><a name="IDAKNWT"></a>
25      <h2>Arguments</h2>
26
27      <div class="variablelist">
28<table border="0">
29<col align="left" valign="top">
30<tbody>
31<tr>
32<td><em><strong><code>chNo</code></strong></em></td>
33<td>The channel number. Takes a value between 14 and 15.</td>
34</tr>
35<tr>
36<td><em><strong><code>volume</code></strong></em></td>
37<td>The volume. Takes a value between 0 and 127.</td>
38</tr>
39<tr>
40<td><em><strong><code>shift</code></strong></em></td>
41<td>Data shift specification.</td>
42</tr>
43<tr>
44<td><em><strong><code>timer</code></strong></em></td>
45<td>The timer. Takes a value between 0x10 and 0xffff.</td>
46</tr>
47<tr>
48<td><em><strong><code>pan</code></strong></em></td>
49<td>The pan. Takes values in the range of 0 (left) to 64 (center) to 127 (right).</td>
50</tr>
51</tbody>
52</table>
53</div>
54
55    </div>
56<div class="refsection" lang="ja"><a name="IDAVOWT"></a>
57      <h2>Return Values</h2>
58
59      <p>None.</p>
60    </div>
61<div class="refsection" lang="ja"><a name="IDA2OWT"></a>
62      <h2>Description</h2>
63      <p>
64This function sets up a channel for playing white noise.
65</p>
66      <p>
67The function sets the parameters for the channel specified by <em><strong><code>chNo</code></strong></em>. The channel must first be locked by the <tt class="function"><a href="SND_LockChannel.html">SND_LockChannel</a></tt> function. Once the parameters have been set, call the <tt class="function"><a href="SND_StartTimer.html">SND_StartTimer</a></tt> function to begin actual playback.
68</p>
69
70      <p>
71Choose from among these values for the data shift setting <code>shift</code>:
72</p>
73      <div class="table"><a name="IDAWPWT"></a><p class="title"><b><b>Table. SNDChannelDataShift</b></b></p>
74<table summary="SNDChannelDataShift" border="1">
75<colgroup><col><col></colgroup>
76<thead>
77<tr>
78<th>Label</th>
79<th>Description</th>
80</tr>
81</thead>
82<tbody>
83<tr>
84<td>SND_CHANNEL_DATASHIFT_NONE</td>
85<td>Do not perform a data shift.</td>
86</tr>
87<tr>
88<td>SND_CHANNEL_DATASHIFT_1BIT</td>
89<td>Shift data 1 bit right.</td>
90</tr>
91<tr>
92<td>SND_CHANNEL_DATASHIFT_2BIT</td>
93<td>Shift data 2 bits right.</td>
94</tr>
95<tr>
96<td>SND_CHANNEL_DATASHIFT_4BIT</td>
97<td>Shift data 4 bits right.</td>
98</tr>
99</tbody>
100</table>
101</div>
102
103      <p>
104<em>timer</em> specifies 8 cycles of white noise by clock count. The number of ticks per second is approximately 16.757 MHz with <code>SND_TIMER_CLOCK</code>. For example, the following calculation will play a pitch that has a frequency <em>freq</em> Hz.
105</p>
106<pre class="programlisting">timer = <code>SND_TIMER_CLOCK</code> / ( 8 * <em>freq</em> )</pre>
107      <p>
108
109</p>
110      <div class="note">
111<h3 class="title">Note</h3>
112<p>
113This function is an ARM7 reserved function. After this function is called, its processing will occur only after the command is issued with the <tt class="function"><a href="SND_FlushCommand.html">SND_FlushCommand</a></tt> function.
114</p>
115<p>
116If program execution must be synchronized with process completion, first use the <tt class="function"><a href="SND_GetCurrentCommandTag.html">SND_GetCurrentCommandTag</a></tt> function to obtain the command tag immediately after calling this function. Then, after the command is issued, use the command tag and call either the <tt class="function"><a href="SND_IsFinishedCommandTag.html">SND_IsFinishedCommandTag</a></tt> or <tt class="function"><a href="SND_WaitForCommandProc.html">SND_WaitForCommandProc</a></tt> function to confirm that processing has finished or to wait for it to complete.
117</p>
118</div>
119    </div>
120<h2>See Also</h2>
121<p><code><a href="SND_LockChannel.html">SND_LockChannel</a>, <a href="SND_StartTimer.html">SND_StartTimer</a>, <a href="SND_FlushCommand.html">SND_FlushCommand</a>, <a href="SND_GetCurrentCommandTag.html">SND_GetCurrentCommandTag</a>, <a href="SND_IsFinishedCommandTag.html">SND_IsFinishedCommandTag</a>, <a href="SND_WaitForCommandProc.html">SND_WaitForCommandProc</a></code></p>
122<h2>Revision History</h2>
123<p>
1242005/02/17 Added a note about ARM7 command processing. <br>2004/08/10 Initial version.
125</p>
126</div>
127<hr><p>CONFIDENTIAL</p></body>
128</html>
129