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 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
|
<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> <img src="ccrma.gif"> <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="faq.html">FAQ</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.6.2 -->
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1FreeVerb.html">FreeVerb</a>
</div>
<div class="contents">
<h1>stk::FreeVerb Class Reference</h1><!-- doxytag: class="stk::FreeVerb" --><!-- doxytag: inherits="stk::Effect" -->
<p>Jezar at Dreampoint's <a class="el" href="classstk_1_1FreeVerb.html" title="Jezar at Dreampoint's FreeVerb, implemented in STK.">FreeVerb</a>, implemented in STK.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="FreeVerb_8h_source.html">FreeVerb.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for stk::FreeVerb:</div>
<div class="dynsection">
<div class="center">
<img src="classstk_1_1FreeVerb.png" usemap="#stk::FreeVerb_map" alt=""/>
<map id="stk::FreeVerb_map" name="stk::FreeVerb_map">
<area href="classstk_1_1Effect.html" alt="stk::Effect" shape="rect" coords="0,56,88,80"/>
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,88,24"/>
</map>
</div>
</div>
<p><a href="classstk_1_1FreeVerb-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#aba12855fab8cddc4119cbd854e86214a">FreeVerb</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classstk_1_1FreeVerb.html" title="Jezar at Dreampoint's FreeVerb, implemented in STK.">FreeVerb</a> Constructor. <a href="#aba12855fab8cddc4119cbd854e86214a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a203cd66e21f9ca127139b4948e26dfb9"></a><!-- doxytag: member="stk::FreeVerb::~FreeVerb" ref="a203cd66e21f9ca127139b4948e26dfb9" args="()" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a203cd66e21f9ca127139b4948e26dfb9">~FreeVerb</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af51f5592b04eba08092c2377debf16a8"></a><!-- doxytag: member="stk::FreeVerb::setEffectMix" ref="af51f5592b04eba08092c2377debf16a8" args="(StkFloat mix)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#af51f5592b04eba08092c2377debf16a8">setEffectMix</a> (StkFloat mix)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the effect mix [0 = mostly dry, 1 = mostly wet]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a60133f8378e8a6f775a01d7d3ca44307"></a><!-- doxytag: member="stk::FreeVerb::setRoomSize" ref="a60133f8378e8a6f775a01d7d3ca44307" args="(StkFloat value)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a60133f8378e8a6f775a01d7d3ca44307">setRoomSize</a> (StkFloat value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the room size (comb filter feedback gain) parameter [0,1]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af92c7e8a19aa0a265afc72cf45141d27"></a><!-- doxytag: member="stk::FreeVerb::getRoomSize" ref="af92c7e8a19aa0a265afc72cf45141d27" args="(void)" -->
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#af92c7e8a19aa0a265afc72cf45141d27">getRoomSize</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the room size (comb filter feedback gain) parameter. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8576f27cfb65f06c019e80772eaed0fb"></a><!-- doxytag: member="stk::FreeVerb::setDamping" ref="a8576f27cfb65f06c019e80772eaed0fb" args="(StkFloat value)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a8576f27cfb65f06c019e80772eaed0fb">setDamping</a> (StkFloat value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the damping parameter [0=low damping, 1=higher damping]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5dd46db58e656e5e9f1c1b1545a14036"></a><!-- doxytag: member="stk::FreeVerb::getDamping" ref="a5dd46db58e656e5e9f1c1b1545a14036" args="(void)" -->
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a5dd46db58e656e5e9f1c1b1545a14036">getDamping</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the damping parameter. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6ebb13f2d7d2940a0f49a08a191185c5"></a><!-- doxytag: member="stk::FreeVerb::setWidth" ref="a6ebb13f2d7d2940a0f49a08a191185c5" args="(StkFloat value)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a6ebb13f2d7d2940a0f49a08a191185c5">setWidth</a> (StkFloat value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the width (left-right mixing) parameter [0,1]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb2e0328715a9446f0d5f625ffc88805"></a><!-- doxytag: member="stk::FreeVerb::getWidth" ref="abb2e0328715a9446f0d5f625ffc88805" args="(void)" -->
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#abb2e0328715a9446f0d5f625ffc88805">getWidth</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the width (left-right mixing) parameter. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af1070d0612b81c22031907269cf60cfc"></a><!-- doxytag: member="stk::FreeVerb::setMode" ref="af1070d0612b81c22031907269cf60cfc" args="(bool isFrozen)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#af1070d0612b81c22031907269cf60cfc">setMode</a> (bool isFrozen)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the mode [frozen = 1, unfrozen = 0]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6510448e8d12077bd475a714aace5177"></a><!-- doxytag: member="stk::FreeVerb::getMode" ref="a6510448e8d12077bd475a714aace5177" args="(void)" -->
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a6510448e8d12077bd475a714aace5177">getMode</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the current freeze mode [frozen = 1, unfrozen = 0]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3a6551cb5dcf80f27f683c81f47284f3"></a><!-- doxytag: member="stk::FreeVerb::clear" ref="a3a6551cb5dcf80f27f683c81f47284f3" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a3a6551cb5dcf80f27f683c81f47284f3">clear</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clears delay lines, etc. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#aab7afe56ff978369328cbf4dd4c4cfa3">lastOut</a> (unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the specified channel value of the last computed stereo frame. <a href="#aab7afe56ff978369328cbf4dd4c4cfa3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a0cd5d18a9636029196415879e6a027ee">tick</a> (StkFloat inputL, StkFloat inputR=0.0, unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Input one or two samples to the effect and return the specified <code>channel</code> value of the computed stereo frame. <a href="#a0cd5d18a9636029196415879e6a027ee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a4d9cad73cbd30a4866e0b15c09ca4ac9">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &frames, unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Take two channels of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object as inputs to the effect and replace with stereo outputs. <a href="#a4d9cad73cbd30a4866e0b15c09ca4ac9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#af633ae5e8384cc632ec04a3145651dc3">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &iFrames, <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &oFrames, unsigned int iChannel=0, unsigned int oChannel=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Take one or two channels of the <code>iFrames</code> object as inputs to the effect and write stereo outputs to the <code>oFrames</code> object. <a href="#af633ae5e8384cc632ec04a3145651dc3"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5be3a015730462494a5807a86cd693d1"></a><!-- doxytag: member="stk::FreeVerb::update" ref="a5be3a015730462494a5807a86cd693d1" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FreeVerb.html#a5be3a015730462494a5807a86cd693d1">update</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Update interdependent parameters. <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Jezar at Dreampoint's <a class="el" href="classstk_1_1FreeVerb.html" title="Jezar at Dreampoint's FreeVerb, implemented in STK.">FreeVerb</a>, implemented in STK. </p>
<p>Freeverb is a free and open-source Schroeder reverberator originally implemented in C++. The parameters of the reverberation model are exceptionally well tuned. <a class="el" href="classstk_1_1FreeVerb.html" title="Jezar at Dreampoint's FreeVerb, implemented in STK.">FreeVerb</a> uses 8 lowpass-feedback-comb-filters in parallel, followed by 4 Schroeder allpass filters in series. The input signal can be either mono or stereo, and the output signal is stereo. The delay lengths are optimized for a sample rate of 44100 Hz.</p>
<p>Ported to STK by Gregory Burlet, 2012. </p>
<hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="aba12855fab8cddc4119cbd854e86214a"></a><!-- doxytag: member="stk::FreeVerb::FreeVerb" ref="aba12855fab8cddc4119cbd854e86214a" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">stk::FreeVerb::FreeVerb </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="classstk_1_1FreeVerb.html" title="Jezar at Dreampoint's FreeVerb, implemented in STK.">FreeVerb</a> Constructor. </p>
<p>Initializes the effect with default parameters. Note that these defaults are slightly different than those in the original implementation of <a class="el" href="classstk_1_1FreeVerb.html" title="Jezar at Dreampoint's FreeVerb, implemented in STK.">FreeVerb</a> [<a class="el" href="classstk_1_1Effect.html" title="STK abstract effects parent class.">Effect</a> Mix: 0.75; Room Size: 0.75; Damping: 0.25; Width: 1.0; Mode: freeze mode off]. </p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aab7afe56ff978369328cbf4dd4c4cfa3"></a><!-- doxytag: member="stk::FreeVerb::lastOut" ref="aab7afe56ff978369328cbf4dd4c4cfa3" args="(unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StkFloat stk::FreeVerb::lastOut </td>
<td>(</td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>channel</em> = <code>0</code></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the specified channel value of the last computed stereo frame. </p>
<p>Use the <a class="el" href="classstk_1_1Effect.html#a3d7e2b8942bf7adcc71dfc6dccbb7aa0" title="Return an StkFrames reference to the last output sample frame.">lastFrame()</a> function to get both values of the last computed stereo frame. The <code>channel</code> argument must be 0 or 1 (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. </p>
<p><div class="fragment"><pre class="fragment"><a name="l00166"></a>00166 {
<a name="l00167"></a>00167 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
<a name="l00168"></a>00168 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel > 1 ) {
<a name="l00169"></a>00169 oStream_ << <span class="stringliteral">"FreeVerb::lastOut(): channel argument must be less than 2!"</span>;
<a name="l00170"></a>00170 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172 <span class="preprocessor">#endif</span>
<a name="l00173"></a>00173 <span class="preprocessor"></span>
<a name="l00174"></a>00174 <span class="keywordflow">return</span> lastFrame_[channel];
<a name="l00175"></a>00175 }
</pre></div></p>
</div>
</div>
<a class="anchor" id="a0cd5d18a9636029196415879e6a027ee"></a><!-- doxytag: member="stk::FreeVerb::tick" ref="a0cd5d18a9636029196415879e6a027ee" args="(StkFloat inputL, StkFloat inputR=0.0, unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StkFloat stk::FreeVerb::tick </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>inputL</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>inputR</em> = <code>0.0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>channel</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Input one or two samples to the effect and return the specified <code>channel</code> value of the computed stereo frame. </p>
<p>Use the <a class="el" href="classstk_1_1Effect.html#a3d7e2b8942bf7adcc71dfc6dccbb7aa0" title="Return an StkFrames reference to the last output sample frame.">lastFrame()</a> function to get both values of the computed stereo output frame. The <code>channel</code> argument must be 0 or 1 (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. </p>
<p><div class="fragment"><pre class="fragment"><a name="l00178"></a>00178 {
<a name="l00179"></a>00179 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
<a name="l00180"></a>00180 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel > 1 ) {
<a name="l00181"></a>00181 oStream_ << <span class="stringliteral">"FreeVerb::tick(): channel argument must be less than 2!"</span>;
<a name="l00182"></a>00182 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>(StkError::FUNCTION_ARGUMENT);
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184 <span class="preprocessor">#endif</span>
<a name="l00185"></a>00185 <span class="preprocessor"></span>
<a name="l00186"></a>00186 <span class="keywordflow">if</span> ( !inputR ) {
<a name="l00187"></a>00187 inputR = inputL;
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189
<a name="l00190"></a>00190 StkFloat fInput = (inputL + inputR) * gain_;
<a name="l00191"></a>00191 StkFloat outL = 0.0;
<a name="l00192"></a>00192 StkFloat outR = 0.0;
<a name="l00193"></a>00193
<a name="l00194"></a>00194 <span class="comment">// Parallel LBCF filters</span>
<a name="l00195"></a>00195 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i < nCombs; i++ ) {
<a name="l00196"></a>00196 <span class="comment">// Left channel</span>
<a name="l00197"></a>00197 <span class="comment">//StkFloat yn = fInput + (roomSize_ * FreeVerb::undenormalize(combLPL_[i].tick(FreeVerb::undenormalize(combDelayL_[i].nextOut()))));</span>
<a name="l00198"></a>00198 StkFloat yn = fInput + (roomSize_ * combLPL_[i].tick( combDelayL_[i].nextOut() ) );
<a name="l00199"></a>00199 combDelayL_[i].tick(yn);
<a name="l00200"></a>00200 outL += yn;
<a name="l00201"></a>00201
<a name="l00202"></a>00202 <span class="comment">// Right channel</span>
<a name="l00203"></a>00203 <span class="comment">//yn = fInput + (roomSize_ * FreeVerb::undenormalize(combLPR_[i].tick(FreeVerb::undenormalize(combDelayR_[i].nextOut()))));</span>
<a name="l00204"></a>00204 yn = fInput + (roomSize_ * combLPR_[i].tick( combDelayR_[i].nextOut() ) );
<a name="l00205"></a>00205 combDelayR_[i].tick(yn);
<a name="l00206"></a>00206 outR += yn;
<a name="l00207"></a>00207 }
<a name="l00208"></a>00208
<a name="l00209"></a>00209 <span class="comment">// Series allpass filters</span>
<a name="l00210"></a>00210 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i < nAllpasses; i++ ) {
<a name="l00211"></a>00211 <span class="comment">// Left channel</span>
<a name="l00212"></a>00212 <span class="comment">//StkFloat vn_m = FreeVerb::undenormalize(allPassDelayL_[i].nextOut());</span>
<a name="l00213"></a>00213 StkFloat vn_m = allPassDelayL_[i].nextOut();
<a name="l00214"></a>00214 StkFloat vn = outL + (g_ * vn_m);
<a name="l00215"></a>00215 allPassDelayL_[i].tick(vn);
<a name="l00216"></a>00216
<a name="l00217"></a>00217 <span class="comment">// calculate output</span>
<a name="l00218"></a>00218 outL = -vn + (1.0 + g_)*vn_m;
<a name="l00219"></a>00219
<a name="l00220"></a>00220 <span class="comment">// Right channel</span>
<a name="l00221"></a>00221 <span class="comment">//vn_m = FreeVerb::undenormalize(allPassDelayR_[i].nextOut());</span>
<a name="l00222"></a>00222 vn_m = allPassDelayR_[i].nextOut();
<a name="l00223"></a>00223 vn = outR + (g_ * vn_m);
<a name="l00224"></a>00224 allPassDelayR_[i].tick(vn);
<a name="l00225"></a>00225
<a name="l00226"></a>00226 <span class="comment">// calculate output</span>
<a name="l00227"></a>00227 outR = -vn + (1.0 + g_)*vn_m;
<a name="l00228"></a>00228 }
<a name="l00229"></a>00229
<a name="l00230"></a>00230 <span class="comment">// Mix output</span>
<a name="l00231"></a>00231 lastFrame_[0] = outL*wet1_ + outR*wet2_ + inputL*dry_;
<a name="l00232"></a>00232 lastFrame_[1] = outR*wet1_ + outL*wet2_ + inputR*dry_;
<a name="l00233"></a>00233
<a name="l00234"></a>00234 <span class="comment">/*</span>
<a name="l00235"></a>00235 <span class="comment"> // Hard limiter ... there's not much else we can do at this point</span>
<a name="l00236"></a>00236 <span class="comment"> if ( lastFrame_[0] >= 1.0 ) {</span>
<a name="l00237"></a>00237 <span class="comment"> lastFrame_[0] = 0.9999;</span>
<a name="l00238"></a>00238 <span class="comment"> }</span>
<a name="l00239"></a>00239 <span class="comment"> if ( lastFrame_[0] <= -1.0 ) {</span>
<a name="l00240"></a>00240 <span class="comment"> lastFrame_[0] = -0.9999;</span>
<a name="l00241"></a>00241 <span class="comment"> }</span>
<a name="l00242"></a>00242 <span class="comment"> if ( lastFrame_[1] >= 1.0 ) {</span>
<a name="l00243"></a>00243 <span class="comment"> lastFrame_[1] = 0.9999;</span>
<a name="l00244"></a>00244 <span class="comment"> }</span>
<a name="l00245"></a>00245 <span class="comment"> if ( lastFrame_[1] <= -1.0 ) {</span>
<a name="l00246"></a>00246 <span class="comment"> lastFrame_[1] = -0.9999;</span>
<a name="l00247"></a>00247 <span class="comment"> }</span>
<a name="l00248"></a>00248 <span class="comment"> */</span>
<a name="l00249"></a>00249
<a name="l00250"></a>00250 <span class="keywordflow">return</span> lastFrame_[channel];
<a name="l00251"></a>00251 }
</pre></div></p>
</div>
</div>
<a class="anchor" id="a4d9cad73cbd30a4866e0b15c09ca4ac9"></a><!-- doxytag: member="stk::FreeVerb::tick" ref="a4d9cad73cbd30a4866e0b15c09ca4ac9" args="(StkFrames &frames, unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a>& stk::FreeVerb::tick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td>
<td class="paramname"> <em>frames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>channel</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Take two channels of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object as inputs to the effect and replace with stereo outputs. </p>
<p>The <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument reference is returned. The stereo inputs are taken from (and written back to) the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument starting at the specified <code>channel</code>. Therefore, the <code>channel</code> argument must be less than ( channels() - 1 ) of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. </p>
</div>
</div>
<a class="anchor" id="af633ae5e8384cc632ec04a3145651dc3"></a><!-- doxytag: member="stk::FreeVerb::tick" ref="af633ae5e8384cc632ec04a3145651dc3" args="(StkFrames &iFrames, StkFrames &oFrames, unsigned int iChannel=0, unsigned int oChannel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a>& stk::FreeVerb::tick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td>
<td class="paramname"> <em>iFrames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td>
<td class="paramname"> <em>oFrames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>iChannel</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>oChannel</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Take one or two channels of the <code>iFrames</code> object as inputs to the effect and write stereo outputs to the <code>oFrames</code> object. </p>
<p>The <code>iFrames</code> object reference is returned. The <code>iChannel</code> argument must be less than the number of channels in the <code>iFrames</code> argument (the first channel is specified by 0). If more than one channel of data exists in <code>iFrames</code> starting from <code>iChannel</code>, stereo data is input to the effect. The <code>oChannel</code> argument must be less than ( channels() - 1 ) of the <code>oFrames</code> argument. However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="FreeVerb_8h_source.html">FreeVerb.h</a></li>
</ul>
</div>
<HR>
<table>
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>©1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>
|