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 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378
|
<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_1FileLoop.html">FileLoop</a>
</div>
<div class="contents">
<h1>stk::FileLoop Class Reference</h1><!-- doxytag: class="stk::FileLoop" --><!-- doxytag: inherits="stk::FileWvIn" -->
<p>STK file looping / oscillator class.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="FileLoop_8h_source.html">FileLoop.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for stk::FileLoop:</div>
<div class="dynsection">
<div class="center">
<img src="classstk_1_1FileLoop.png" usemap="#stk::FileLoop_map" alt=""/>
<map id="stk::FileLoop_map" name="stk::FileLoop_map">
<area href="classstk_1_1FileWvIn.html" alt="stk::FileWvIn" shape="rect" coords="0,112,82,136"/>
<area href="classstk_1_1WvIn.html" alt="stk::WvIn" shape="rect" coords="0,56,82,80"/>
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,82,24"/>
</map>
</div>
</div>
<p><a href="classstk_1_1FileLoop-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"><a class="anchor" id="a0d977aae11d75d0327057add00fa7f84"></a><!-- doxytag: member="stk::FileLoop::FileLoop" ref="a0d977aae11d75d0327057add00fa7f84" args="(unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a0d977aae11d75d0327057add00fa7f84">FileLoop</a> (unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a268bfb1efe8e35bab81949b70e43b82c"></a><!-- doxytag: member="stk::FileLoop::FileLoop" ref="a268bfb1efe8e35bab81949b70e43b82c" args="(std::string fileName, bool raw=false, bool doNormalize=true, unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a268bfb1efe8e35bab81949b70e43b82c">FileLoop</a> (std::string fileName, bool raw=false, bool doNormalize=true, unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class constructor that opens a specified file. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6f0e0f9a5cc9c99627d0e12db007905"></a><!-- doxytag: member="stk::FileLoop::~FileLoop" ref="ab6f0e0f9a5cc9c99627d0e12db007905" args="(void)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#ab6f0e0f9a5cc9c99627d0e12db007905">~FileLoop</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a5905940c0dd046a95ca9c2a1d72983de">openFile</a> (std::string fileName, bool raw=false, bool doNormalize=true)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open the specified file and load its data. <a href="#a5905940c0dd046a95ca9c2a1d72983de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a51688a9e84b2f9e5a9c4e62588b65c52"></a><!-- doxytag: member="stk::FileLoop::closeFile" ref="a51688a9e84b2f9e5a9c4e62588b65c52" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a51688a9e84b2f9e5a9c4e62588b65c52">closeFile</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Close a file if one is open. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c539902d697d0b87334ca7dc4f3ce69"></a><!-- doxytag: member="stk::FileLoop::reset" ref="a2c539902d697d0b87334ca7dc4f3ce69" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a2c539902d697d0b87334ca7dc4f3ce69">reset</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear outputs and reset time (file) pointer to zero. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9f3c514ce166068197684a21d31c3a76"></a><!-- doxytag: member="stk::FileLoop::channelsOut" ref="a9f3c514ce166068197684a21d31c3a76" args="(void) const " -->
unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a9f3c514ce166068197684a21d31c3a76">channelsOut</a> (void) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the number of audio channels in the data or stream. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a7c4a3d5c427154bf653f86a53e900b8b">normalize</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Normalize data to a maximum of +-1.0. <a href="#a7c4a3d5c427154bf653f86a53e900b8b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#aa1ac0c8d19f412f66f5fdb89854e2833">normalize</a> (StkFloat peak)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Normalize data to a maximum of <em>+-peak</em>. <a href="#aa1ac0c8d19f412f66f5fdb89854e2833"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad86d4f64c44a6f2488779fef24fc1ee7"></a><!-- doxytag: member="stk::FileLoop::getSize" ref="ad86d4f64c44a6f2488779fef24fc1ee7" args="(void) const " -->
unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#ad86d4f64c44a6f2488779fef24fc1ee7">getSize</a> (void) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the file size in sample frames. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#aa18006c800c7dac1ddd277c987fe0003">getFileRate</a> (void) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the input file sample rate in Hz (not the data read rate). <a href="#aa18006c800c7dac1ddd277c987fe0003"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a13e1f693bc8a29d9051a400087347a3c">setRate</a> (StkFloat rate)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the data read rate in samples. The rate can be negative. <a href="#a13e1f693bc8a29d9051a400087347a3c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#aec8f94d8514b266acd83106ed0f24ead">setFrequency</a> (StkFloat frequency)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the data interpolation rate based on a looping frequency. <a href="#aec8f94d8514b266acd83106ed0f24ead"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1986db79fd04b93f4d10b8cdf75bca34"></a><!-- doxytag: member="stk::FileLoop::addTime" ref="a1986db79fd04b93f4d10b8cdf75bca34" args="(StkFloat time)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a1986db79fd04b93f4d10b8cdf75bca34">addTime</a> (StkFloat time)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Increment the read pointer by <em>time</em> samples, modulo file size. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a8e24d6f9292a9443fbc21e4e8797f482">addPhase</a> (StkFloat angle)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Increment current read pointer by <em>angle</em>, relative to a looping frequency. <a href="#a8e24d6f9292a9443fbc21e4e8797f482"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#afe462794ba202dd879d29c39e76ae111">addPhaseOffset</a> (StkFloat angle)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a phase offset to the current read pointer. <a href="#afe462794ba202dd879d29c39e76ae111"></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_1FileLoop.html#a826b6dd0968c5abd1020a9fe629a4ffd">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 frame. <a href="#a826b6dd0968c5abd1020a9fe629a4ffd"></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_1FileLoop.html#a037b31918134ed1839a8b48de774ab95">tick</a> (unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute a sample frame and return the specified <code>channel</code> value. <a href="#a037b31918134ed1839a8b48de774ab95"></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_1FileLoop.html#a3d91eb1f9c76d1bf6461ce2e4a3f8983">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &frames)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument with computed frames and return the same reference. <a href="#a3d91eb1f9c76d1bf6461ce2e4a3f8983"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>STK file looping / oscillator class. </p>
<p>This class provides audio file looping functionality. Any audio file that can be loaded by <a class="el" href="classstk_1_1FileRead.html" title="STK audio file input class.">FileRead</a> can be looped using this class.</p>
<p><a class="el" href="classstk_1_1FileLoop.html" title="STK file looping / oscillator class.">FileLoop</a> supports multi-channel data. It is important to distinguish the <a class="el" href="classstk_1_1FileLoop.html#a037b31918134ed1839a8b48de774ab95" title="Compute a sample frame and return the specified channel value.">tick()</a> method that computes a single frame (and returns only the specified sample of a multi-channel frame) from the overloaded one that takes an <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object for multi-channel and/or multi-frame data.</p>
<p>by Perry R. Cook and Gary P. Scavone, 1995-2012. </p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5905940c0dd046a95ca9c2a1d72983de"></a><!-- doxytag: member="stk::FileLoop::openFile" ref="a5905940c0dd046a95ca9c2a1d72983de" args="(std::string fileName, bool raw=false, bool doNormalize=true)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::openFile </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"> <em>fileName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>raw</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>doNormalize</em> = <code>true</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Open the specified file and load its data. </p>
<p>Data from a previously opened file will be overwritten by this function. An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if the file is not found, its format is unknown, or a read error occurs. If the file data is to be loaded incrementally from disk and normalization is specified, a scaling will be applied with respect to fixed-point limits. If the data format is floating-point, no scaling is performed. </p>
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#a7986664cd986cbacf4fb19e5c77deda1">stk::FileWvIn</a>.</p>
</div>
</div>
<a class="anchor" id="a7c4a3d5c427154bf653f86a53e900b8b"></a><!-- doxytag: member="stk::FileLoop::normalize" ref="a7c4a3d5c427154bf653f86a53e900b8b" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::normalize </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Normalize data to a maximum of +-1.0. </p>
<p>This function has no effect when data is incrementally loaded from disk. </p>
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#aaecd1950fca3a5513e0efe4e86754b11">stk::FileWvIn</a>.</p>
<p><div class="fragment"><pre class="fragment"><a name="l00065"></a>00065 { <a class="code" href="classstk_1_1FileLoop.html#a7c4a3d5c427154bf653f86a53e900b8b" title="Normalize data to a maximum of +-1.0.">FileWvIn::normalize</a>( 1.0 ); };
</pre></div></p>
</div>
</div>
<a class="anchor" id="aa1ac0c8d19f412f66f5fdb89854e2833"></a><!-- doxytag: member="stk::FileLoop::normalize" ref="aa1ac0c8d19f412f66f5fdb89854e2833" args="(StkFloat peak)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::normalize </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>peak</em></td>
<td> ) </td>
<td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Normalize data to a maximum of <em>+-peak</em>. </p>
<p>This function has no effect when data is incrementally loaded from disk. </p>
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#a670b16fcbdd2a510706c23faeb00a1be">stk::FileWvIn</a>.</p>
<p><div class="fragment"><pre class="fragment"><a name="l00072"></a>00072 { <a class="code" href="classstk_1_1FileLoop.html#a7c4a3d5c427154bf653f86a53e900b8b" title="Normalize data to a maximum of +-1.0.">FileWvIn::normalize</a>( peak ); };
</pre></div></p>
</div>
</div>
<a class="anchor" id="aa18006c800c7dac1ddd277c987fe0003"></a><!-- doxytag: member="stk::FileLoop::getFileRate" ref="aa18006c800c7dac1ddd277c987fe0003" args="(void) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StkFloat stk::FileLoop::getFileRate </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the input file sample rate in Hz (not the data read rate). </p>
<p>WAV, SND, and AIF formatted files specify a sample rate in their headers. STK RAW files have a sample rate of 22050 Hz by definition. MAT-files are assumed to have a rate of 44100 Hz. </p>
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#a867b7b7fdb60e5194e25d7a85a26ec0b">stk::FileWvIn</a>.</p>
<p><div class="fragment"><pre class="fragment"><a name="l00083"></a>00083 { <span class="keywordflow">return</span> data_.dataRate(); };
</pre></div></p>
</div>
</div>
<a class="anchor" id="a13e1f693bc8a29d9051a400087347a3c"></a><!-- doxytag: member="stk::FileLoop::setRate" ref="a13e1f693bc8a29d9051a400087347a3c" args="(StkFloat rate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::setRate </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>rate</em></td>
<td> ) </td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the data read rate in samples. The rate can be negative. </p>
<p>If the rate value is negative, the data is read in reverse order. </p>
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#aacd97ad5f30f9cdc8201b4244aa69901">stk::FileWvIn</a>.</p>
</div>
</div>
<a class="anchor" id="aec8f94d8514b266acd83106ed0f24ead"></a><!-- doxytag: member="stk::FileLoop::setFrequency" ref="aec8f94d8514b266acd83106ed0f24ead" args="(StkFloat frequency)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::setFrequency </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>frequency</em></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the data interpolation rate based on a looping frequency. </p>
<p>This function determines the interpolation rate based on the file size and the current <a class="el" href="classstk_1_1Stk.html#a5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>. The <em>frequency</em> value corresponds to file cycles per second. The frequency can be negative, in which case the loop is read in reverse order. </p>
<p><div class="fragment"><pre class="fragment"><a name="l00098"></a>00098 { this-><a class="code" href="classstk_1_1FileLoop.html#a13e1f693bc8a29d9051a400087347a3c" title="Set the data read rate in samples. The rate can be negative.">setRate</a>( file_.fileSize() * frequency / <a class="code" href="classstk_1_1Stk.html#a5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>() ); };
</pre></div></p>
</div>
</div>
<a class="anchor" id="a8e24d6f9292a9443fbc21e4e8797f482"></a><!-- doxytag: member="stk::FileLoop::addPhase" ref="a8e24d6f9292a9443fbc21e4e8797f482" args="(StkFloat angle)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::addPhase </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>angle</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Increment current read pointer by <em>angle</em>, relative to a looping frequency. </p>
<p>This function increments the read pointer based on the file size and the current <a class="el" href="classstk_1_1Stk.html#a5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>. The <em>anAngle</em> value is a multiple of file size. </p>
</div>
</div>
<a class="anchor" id="afe462794ba202dd879d29c39e76ae111"></a><!-- doxytag: member="stk::FileLoop::addPhaseOffset" ref="afe462794ba202dd879d29c39e76ae111" args="(StkFloat angle)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FileLoop::addPhaseOffset </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>angle</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Add a phase offset to the current read pointer. </p>
<p>This function determines a time offset based on the file size and the current <a class="el" href="classstk_1_1Stk.html#a5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>. The <em>angle</em> value is a multiple of file size. </p>
</div>
</div>
<a class="anchor" id="a826b6dd0968c5abd1020a9fe629a4ffd"></a><!-- doxytag: member="stk::FileLoop::lastOut" ref="a826b6dd0968c5abd1020a9fe629a4ffd" args="(unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StkFloat stk::FileLoop::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 frame. </p>
<p>For multi-channel files, use the <a class="el" href="classstk_1_1WvIn.html#a3ab86e33eff9f962c9ef7b41e3ccb77e" title="Return an StkFrames reference to the last computed sample frame.">lastFrame()</a> function to get all values from the last computed frame. If no file data is loaded, the returned value is 0.0. The <code>channel</code> argument must be less than the number of channels in the file data (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>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#ad17c12e8d51f90f59f0d0c9f6d626608">stk::FileWvIn</a>.</p>
<p><div class="fragment"><pre class="fragment"><a name="l00129"></a>00129 { <span class="keywordflow">return</span> <a class="code" href="classstk_1_1FileLoop.html#a826b6dd0968c5abd1020a9fe629a4ffd" title="Return the specified channel value of the last computed frame.">FileWvIn::lastOut</a>( channel ); };
</pre></div></p>
</div>
</div>
<a class="anchor" id="a037b31918134ed1839a8b48de774ab95"></a><!-- doxytag: member="stk::FileLoop::tick" ref="a037b31918134ed1839a8b48de774ab95" args="(unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StkFloat stk::FileLoop::tick </td>
<td>(</td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>channel</em> = <code>0</code></td>
<td> ) </td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Compute a sample frame and return the specified <code>channel</code> value. </p>
<p>For multi-channel files, use the <a class="el" href="classstk_1_1WvIn.html#a3ab86e33eff9f962c9ef7b41e3ccb77e" title="Return an StkFrames reference to the last computed sample frame.">lastFrame()</a> function to get all values from the computed frame. If no file data is loaded, the returned value is 0.0. The <code>channel</code> argument must be less than the number of channels in the file data (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>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#ada668a0bc0bf89e155ef341de00babc2">stk::FileWvIn</a>.</p>
</div>
</div>
<a class="anchor" id="a3d91eb1f9c76d1bf6461ce2e4a3f8983"></a><!-- doxytag: member="stk::FileLoop::tick" ref="a3d91eb1f9c76d1bf6461ce2e4a3f8983" args="(StkFrames &frames)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a>& stk::FileLoop::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>
<td> ) </td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Fill the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument with computed frames and return the same reference. </p>
<p>The number of channels in the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument should equal the number of channels in the file data. However, this is only checked if _STK_DEBUG_ is defined during compilation, in which case an incompatibility will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. If no file data is loaded, the function does nothing (a warning will be issued if _STK_DEBUG_ is defined during compilation and <a class="el" href="classstk_1_1Stk.html#a2d8b38b9f808fb7c5e65c228b4b7dbbb" title="Toggle display of WARNING and STATUS messages.">Stk::showWarnings()</a> has been set to <em>true</em>). </p>
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#ad492f9becef5dfc9202a027bc5ad4580">stk::FileWvIn</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="FileLoop_8h_source.html">FileLoop.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>
|