mirror of
https://github.com/thestk/stk
synced 2026-01-13 13:01:52 +00:00
379 lines
27 KiB
HTML
379 lines
27 KiB
HTML
<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-2011. </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-2011 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|