1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" />
7    <title>Sound (snd) Sample Demo</title>
8  </head>
9  <body>
10    <h1>effect</h1>
11
12    <h2>Overview</h2>
13    <div class="section">
14      <p>
15      This is an effect demo.
16      </p>
17    </div>
18
19    <h2>How to Use</h2>
20    <div class="section">
21      <p>
22      <ul>
23        <li>A Button: Plays the sequence sound</li>
24        <li>X Button: Plays the wave sound</li>
25        <li>Y Button: Plays the stream sound</li>
26        <li>B Button: Stops the sound</li>
27      </ul>
28      <ul>
29        <li>Right Button, Left Button: Switches the effect</li>
30      </ul>
31      </p>
32    </div>
33
34    <h2>Description</h2>
35    <div class="section">
36      <p>
37      Demo to implement the following effects.
38      </p>
39      <ul>
40        <li><a href="../FxReverb/Overview.html">nw::snd::FxReverb</a></li>
41        <li><a href="../FxDelay/Overview.html">nw::snd::FxDelay</a></li>
42        <li>nn::snd::FxReverb</li>
43        <li>nn::snd::FxDelay</li>
44      </ul>
45
46      <p>
47      Main flow is in the order: set effect parameters, secure work memory, allocate work memory, register effect, remove effect, and release work memory.
48      </p>
49      <pre>
50    // nw::snd::FxReverb settings
51    {
52        // Parameter settings
53        nw::snd::FxReverb::FilterSize filterSize;
54        filterSize.m_Comb0 = 20 * 160;
55        filterSize.m_Comb1 = 30 * 160;
56        filterSize.m_AllPass = 13 * 160;
57
58        m_NwFxReverbParam.m_EarlyReflectionTime = 300;
59        m_NwFxReverbParam.m_FusedTime = 1000;
60        m_NwFxReverbParam.m_PreDelayTime = 200;
61        m_NwFxReverbParam.m_pFilterSize = &amp;filterSize;
62
63        m_NwFxReverb.SetParam( m_NwFxReverbParam );
64
65        // Secure work memory
66        size_t reverbBufferSize = m_NwFxReverb.GetRequiredMemSize();
67        m_pMemoryForNwFxReverb = MemAlloc( reverbBufferSize, 4 );
68
69        // Allocate work memory
70        m_NwFxReverb.AssignWorkBuffer(
71                reinterpret_cast<uptr>( m_pMemoryForNwFxReverb ),
72                reverbBufferSize );
73    }
74
75    // Register effect
76    nw::snd::SoundSystem::AppendEffect( nw::snd::AUX_BUS_A, &amp;m_NwFxReverb );
77
78    // Remove effect
79    nw::snd::SoundSystem::ClearEffect( nw::snd::AUX_BUS_A, 0 );
80
81    // Release work memory
82    m_NwFxReverb.ReleaseWorkBuffer();
83
84      </pre>
85      </div>
86
87      <h2>Revision History</h2>
88      <div class="section">
89        <dl class="history">
90          <dt>2010/10/21</dt>
91          <dd>Revised text concerning effects provided with CTR_SDK<br /></dd>
92          <dt>2010/10/01</dt>
93          <dd>Support for FxDelay</dd>
94          <dt>2010/09/27</dt>
95          <dd>Initial version.<br />
96          </dd>
97        </dl>
98      </div>
99    <hr><p>CONFIDENTIAL</p></body>
100  </html>
101
102