mirror of
https://github.com/thestk/stk
synced 2026-01-12 04:21:52 +00:00
389 lines
25 KiB
HTML
389 lines
25 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.5.8 -->
|
|
<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" -->STK file looping / oscillator class.
|
|
<a href="#_details">More...</a>
|
|
<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">
|
|
|
|
<p><center><img src="classstk_1_1FileLoop.png" usemap="#stk::FileLoop_map" border="0" alt=""></center>
|
|
<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>
|
|
|
|
<p>
|
|
<a href="classstk_1_1FileLoop-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0d977aae11d75d0327057add00fa7f84"></a><!-- doxytag: member="stk::FileLoop::FileLoop" ref="0d977aae11d75d0327057add00fa7f84" args="(unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#0d977aae11d75d0327057add00fa7f84">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" nowrap align="right" valign="top"><a class="anchor" name="268bfb1efe8e35bab81949b70e43b82c"></a><!-- doxytag: member="stk::FileLoop::FileLoop" ref="268bfb1efe8e35bab81949b70e43b82c" 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#268bfb1efe8e35bab81949b70e43b82c">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" nowrap align="right" valign="top"><a class="anchor" name="b6f0e0f9a5cc9c99627d0e12db007905"></a><!-- doxytag: member="stk::FileLoop::~FileLoop" ref="b6f0e0f9a5cc9c99627d0e12db007905" args="(void)" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#b6f0e0f9a5cc9c99627d0e12db007905">~FileLoop</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#5905940c0dd046a95ca9c2a1d72983de">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="#5905940c0dd046a95ca9c2a1d72983de"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="51688a9e84b2f9e5a9c4e62588b65c52"></a><!-- doxytag: member="stk::FileLoop::closeFile" ref="51688a9e84b2f9e5a9c4e62588b65c52" args="(void)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#51688a9e84b2f9e5a9c4e62588b65c52">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" nowrap align="right" valign="top"><a class="anchor" name="2c539902d697d0b87334ca7dc4f3ce69"></a><!-- doxytag: member="stk::FileLoop::reset" ref="2c539902d697d0b87334ca7dc4f3ce69" args="(void)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#2c539902d697d0b87334ca7dc4f3ce69">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" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#7c4a3d5c427154bf653f86a53e900b8b">normalize</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Normalize data to a maximum of +-1.0. <a href="#7c4a3d5c427154bf653f86a53e900b8b"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a1ac0c8d19f412f66f5fdb89854e2833">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="#a1ac0c8d19f412f66f5fdb89854e2833"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d86d4f64c44a6f2488779fef24fc1ee7"></a><!-- doxytag: member="stk::FileLoop::getSize" ref="d86d4f64c44a6f2488779fef24fc1ee7" args="(void) const " -->
|
|
unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#d86d4f64c44a6f2488779fef24fc1ee7">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" nowrap align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#a18006c800c7dac1ddd277c987fe0003">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="#a18006c800c7dac1ddd277c987fe0003"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#13e1f693bc8a29d9051a400087347a3c">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="#13e1f693bc8a29d9051a400087347a3c"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#ec8f94d8514b266acd83106ed0f24ead">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="#ec8f94d8514b266acd83106ed0f24ead"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1986db79fd04b93f4d10b8cdf75bca34"></a><!-- doxytag: member="stk::FileLoop::addTime" ref="1986db79fd04b93f4d10b8cdf75bca34" args="(StkFloat time)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#1986db79fd04b93f4d10b8cdf75bca34">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" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#8e24d6f9292a9443fbc21e4e8797f482">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="#8e24d6f9292a9443fbc21e4e8797f482"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#fe462794ba202dd879d29c39e76ae111">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="#fe462794ba202dd879d29c39e76ae111"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#826b6dd0968c5abd1020a9fe629a4ffd">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="#826b6dd0968c5abd1020a9fe629a4ffd"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileLoop.html#037b31918134ed1839a8b48de774ab95">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="#037b31918134ed1839a8b48de774ab95"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap 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#3d91eb1f9c76d1bf6461ce2e4a3f8983">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="#3d91eb1f9c76d1bf6461ce2e4a3f8983"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK file looping / oscillator class.
|
|
<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>
|
|
<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#037b31918134ed1839a8b48de774ab95" 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>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="5905940c0dd046a95ca9c2a1d72983de"></a><!-- doxytag: member="stk::FileLoop::openFile" ref="5905940c0dd046a95ca9c2a1d72983de" 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>
|
|
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>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#7986664cd986cbacf4fb19e5c77deda1">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="7c4a3d5c427154bf653f86a53e900b8b"></a><!-- doxytag: member="stk::FileLoop::normalize" ref="7c4a3d5c427154bf653f86a53e900b8b" 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>
|
|
This function has no effect when data is incrementally loaded from disk.
|
|
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#aecd1950fca3a5513e0efe4e86754b11">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="a1ac0c8d19f412f66f5fdb89854e2833"></a><!-- doxytag: member="stk::FileLoop::normalize" ref="a1ac0c8d19f412f66f5fdb89854e2833" 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>
|
|
This function has no effect when data is incrementally loaded from disk.
|
|
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#670b16fcbdd2a510706c23faeb00a1be">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="a18006c800c7dac1ddd277c987fe0003"></a><!-- doxytag: member="stk::FileLoop::getFileRate" ref="a18006c800c7dac1ddd277c987fe0003" 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>
|
|
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>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#867b7b7fdb60e5194e25d7a85a26ec0b">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="13e1f693bc8a29d9051a400087347a3c"></a><!-- doxytag: member="stk::FileLoop::setRate" ref="13e1f693bc8a29d9051a400087347a3c" 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>
|
|
If the rate value is negative, the data is read in reverse order.
|
|
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#acd97ad5f30f9cdc8201b4244aa69901">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="ec8f94d8514b266acd83106ed0f24ead"></a><!-- doxytag: member="stk::FileLoop::setFrequency" ref="ec8f94d8514b266acd83106ed0f24ead" 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>
|
|
This function determines the interpolation rate based on the file size and the current <a class="el" href="classstk_1_1Stk.html#5fbe37000a611ce56075ee7d8936472d" 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.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="8e24d6f9292a9443fbc21e4e8797f482"></a><!-- doxytag: member="stk::FileLoop::addPhase" ref="8e24d6f9292a9443fbc21e4e8797f482" 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>
|
|
This function increments the read pointer based on the file size and the current <a class="el" href="classstk_1_1Stk.html#5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>. The <em>anAngle</em> value is a multiple of file size.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="fe462794ba202dd879d29c39e76ae111"></a><!-- doxytag: member="stk::FileLoop::addPhaseOffset" ref="fe462794ba202dd879d29c39e76ae111" 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>
|
|
This function determines a time offset based on the file size and the current <a class="el" href="classstk_1_1Stk.html#5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate</a>. The <em>angle</em> value is a multiple of file size.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="826b6dd0968c5abd1020a9fe629a4ffd"></a><!-- doxytag: member="stk::FileLoop::lastOut" ref="826b6dd0968c5abd1020a9fe629a4ffd" 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>
|
|
For multi-channel files, use the <a class="el" href="classstk_1_1WvIn.html#3ab86e33eff9f962c9ef7b41e3ccb77e" 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>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#d17c12e8d51f90f59f0d0c9f6d626608">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="037b31918134ed1839a8b48de774ab95"></a><!-- doxytag: member="stk::FileLoop::tick" ref="037b31918134ed1839a8b48de774ab95" 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>
|
|
For multi-channel files, use the <a class="el" href="classstk_1_1WvIn.html#3ab86e33eff9f962c9ef7b41e3ccb77e" 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>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#da668a0bc0bf89e155ef341de00babc2">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="3d91eb1f9c76d1bf6461ce2e4a3f8983"></a><!-- doxytag: member="stk::FileLoop::tick" ref="3d91eb1f9c76d1bf6461ce2e4a3f8983" 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>
|
|
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#2d8b38b9f808fb7c5e65c228b4b7dbbb" title="Toggle display of WARNING and STATUS messages.">Stk::showWarnings()</a> has been set to <em>true</em>).
|
|
<p>Reimplemented from <a class="el" href="classstk_1_1FileWvIn.html#d492f9becef5dfc9202a027bc5ad4580">stk::FileWvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<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></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-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|