Files
stk/doc/html/classSineWave.html
2013-09-29 23:41:50 +02:00

191 lines
9.9 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"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="faq.html">FAQ</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.4.4 -->
<h1>SineWave Class Reference</h1><!-- doxytag: class="SineWave" --><!-- doxytag: inherits="Generator" --><code>#include &lt;<a class="el" href="SineWave_8h-source.html">SineWave.h</a>&gt;</code>
<p>
<p>Inheritance diagram for SineWave:
<p><center><img src="classSineWave.png" usemap="#SineWave_map" border="0" alt=""></center>
<map name="SineWave_map">
<area href="classGenerator.html" alt="Generator" shape="rect" coords="0,56,69,80">
<area href="classStk.html" alt="Stk" shape="rect" coords="0,0,69,24">
</map>
<a href="classSineWave-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
STK sinusoid oscillator class.
<p>
This class computes and saves a static sine "table" that can be shared by multiple instances. It has an interface similar to the <a class="el" href="classWaveLoop.html">WaveLoop</a> class but inherits from the <a class="el" href="classGenerator.html">Generator</a> class. Output values are computed using linear interpolation.<p>
The "table" length, set in <a class="el" href="SineWave_8h-source.html">SineWave.h</a>, is 2048 samples by default.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
<p>
<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="a0"></a><!-- doxytag: member="SineWave::SineWave" ref="a0" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a0">SineWave</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1"></a><!-- doxytag: member="SineWave::~SineWave" ref="a1" args="(void)" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a1">~SineWave</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2"></a><!-- doxytag: member="SineWave::reset" ref="a2" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a2">reset</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clear output and reset time pointer to zero. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a3">setRate</a> (StkFloat rate)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the data read rate in samples. The rate can be negative. <a href="#a3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a4">setFrequency</a> (StkFloat frequency)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the data interpolation rate based on a looping frequency. <a href="#a4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5"></a><!-- doxytag: member="SineWave::addTime" ref="a5" args="(StkFloat time)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a5">addTime</a> (StkFloat time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a6">addPhase</a> (StkFloat angle)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Increment current read pointer by <em>angle</em>, relative to a looping frequency. <a href="#a6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSineWave.html#a7">addPhaseOffset</a> (StkFloat angle)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a phase offset to the current read pointer. <a href="#a7"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3"></a><!-- doxytag: member="SineWave::setRate" ref="a3" args="(StkFloat rate)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void SineWave::setRate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">StkFloat&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>rate</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<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. </td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member="SineWave::setFrequency" ref="a4" args="(StkFloat frequency)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void SineWave::setFrequency </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">StkFloat&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>frequency</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<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.html#e0">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. </td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member="SineWave::addPhase" ref="a6" args="(StkFloat angle)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void SineWave::addPhase </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">StkFloat&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>angle</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<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.html#e0">Stk::sampleRate</a>. The <em>anAngle</em> value is a multiple of file size. </td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member="SineWave::addPhaseOffset" ref="a7" args="(StkFloat angle)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void SineWave::addPhaseOffset </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">StkFloat&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>angle</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<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.html#e0">Stk::sampleRate</a>. The <em>angle</em> value is a multiple of file size. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="SineWave_8h-source.html">SineWave.h</a></ul>
<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>&copy;1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>