Files
stk/doc/html/classstk_1_1Asymp.html
2013-09-29 23:44:33 +02:00

156 lines
12 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.5.8 -->
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1Asymp.html">Asymp</a>
</div>
<div class="contents">
<h1>stk::Asymp Class Reference</h1><!-- doxytag: class="stk::Asymp" --><!-- doxytag: inherits="stk::Generator" -->STK asymptotic curve envelope class.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="Asymp_8h-source.html">Asymp.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for stk::Asymp:</div>
<div class="dynsection">
<p><center><img src="classstk_1_1Asymp.png" usemap="#stk::Asymp_map" border="0" alt=""></center>
<map name="stk::Asymp_map">
<area href="classstk_1_1Generator.html" alt="stk::Generator" shape="rect" coords="0,56,90,80">
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,90,24">
</map>
</div>
<p>
<a href="classstk_1_1Asymp-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="d8ea9fc5621a1d8b81001d459de265a0"></a><!-- doxytag: member="stk::Asymp::Asymp" ref="d8ea9fc5621a1d8b81001d459de265a0" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#d8ea9fc5621a1d8b81001d459de265a0">Asymp</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="d869abbd938c263a2c177de636f5a57c"></a><!-- doxytag: member="stk::Asymp::~Asymp" ref="d869abbd938c263a2c177de636f5a57c" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#d869abbd938c263a2c177de636f5a57c">~Asymp</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="51f0aad846eb6bda4c20eb63534786e2"></a><!-- doxytag: member="stk::Asymp::keyOn" ref="51f0aad846eb6bda4c20eb63534786e2" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#51f0aad846eb6bda4c20eb63534786e2">keyOn</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set target = 1. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="082e765dc3bd6b452e92b602af7a1042"></a><!-- doxytag: member="stk::Asymp::keyOff" ref="082e765dc3bd6b452e92b602af7a1042" args="(void)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#082e765dc3bd6b452e92b602af7a1042">keyOff</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set target = 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#ebd8ebaf6f6c9570d3ee78e1bcbbcbd2">setTau</a> (StkFloat tau)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the asymptotic rate via the time factor <em>tau</em> (must be &gt; 0). <a href="#ebd8ebaf6f6c9570d3ee78e1bcbbcbd2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ca998e9c4ae86b4958da59fc9433268c"></a><!-- doxytag: member="stk::Asymp::setTime" ref="ca998e9c4ae86b4958da59fc9433268c" args="(StkFloat time)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#ca998e9c4ae86b4958da59fc9433268c">setTime</a> (StkFloat time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the asymptotic rate based on a time duration (must be &gt; 0). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7b0f7025ba5f268f1e5ce097b209f0ec"></a><!-- doxytag: member="stk::Asymp::setTarget" ref="7b0f7025ba5f268f1e5ce097b209f0ec" args="(StkFloat target)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#7b0f7025ba5f268f1e5ce097b209f0ec">setTarget</a> (StkFloat target)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the target value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81881bb8aca615f69bbbfd56267f971c"></a><!-- doxytag: member="stk::Asymp::setValue" ref="81881bb8aca615f69bbbfd56267f971c" args="(StkFloat value)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#81881bb8aca615f69bbbfd56267f971c">setValue</a> (StkFloat value)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set current and target values to <em>value</em>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aba01ef0ac1a493a14a73c3b29259bde"></a><!-- doxytag: member="stk::Asymp::getState" ref="aba01ef0ac1a493a14a73c3b29259bde" args="(void) const " -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#aba01ef0ac1a493a14a73c3b29259bde">getState</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the current envelope <em>state</em> (0 = at target, 1 otherwise). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eb868c171e07206e2d5d30f8ce8f4436"></a><!-- doxytag: member="stk::Asymp::lastOut" ref="eb868c171e07206e2d5d30f8ce8f4436" args="(void) const " -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#eb868c171e07206e2d5d30f8ce8f4436">lastOut</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the last computed output value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="64df3b44aa1033b642d7a8a93659580e"></a><!-- doxytag: member="stk::Asymp::tick" ref="64df3b44aa1033b642d7a8a93659580e" args="(void)" -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#64df3b44aa1033b642d7a8a93659580e">tick</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute and return one output sample. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Asymp.html#2647bc013816f026915b1e92ddd6a322">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;frames, unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Fill a channel of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object with computed outputs. <a href="#2647bc013816f026915b1e92ddd6a322"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
STK asymptotic curve envelope class.
<p>
This class implements a simple envelope generator which asymptotically approaches a target value. The algorithm used is of the form:<p>
y[n] = a y[n-1] + (1-a) target,<p>
where a = exp(-T/tau), T is the sample period, and tau is a time constant. The user can set the time constant (default value = 0.3) and target value. Theoretically, this recursion never reaches its target, though the calculations in this class are stopped when the current value gets within a small threshold value of the target (at which time the current value is set to the target). It responds to <em>keyOn</em> and <em>keyOff</em> messages by ramping to 1.0 on keyOn and to 0.0 on keyOff.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ebd8ebaf6f6c9570d3ee78e1bcbbcbd2"></a><!-- doxytag: member="stk::Asymp::setTau" ref="ebd8ebaf6f6c9570d3ee78e1bcbbcbd2" args="(StkFloat tau)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::Asymp::setTau </td>
<td>(</td>
<td class="paramtype">StkFloat&nbsp;</td>
<td class="paramname"> <em>tau</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the asymptotic rate via the time factor <em>tau</em> (must be &gt; 0).
<p>
The rate is computed as described above. The value of <em>tau</em> must be greater than zero. Values of <em>tau</em> close to zero produce fast approach rates, while values greater than 1.0 produce rather slow rates.
</div>
</div><p>
<a class="anchor" name="2647bc013816f026915b1e92ddd6a322"></a><!-- doxytag: member="stk::Asymp::tick" ref="2647bc013816f026915b1e92ddd6a322" args="(StkFrames &amp;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> &amp; stk::Asymp::tick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="paramname"> <em>frames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>channel</em> = <code>0</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Fill a channel of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object with computed outputs.
<p>
The <code>channel</code> argument must be less than 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 (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>Implements <a class="el" href="classstk_1_1Generator.html#86bb0421223cf27e25704d5f27b97425">stk::Generator</a>.</p>
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Asymp_8h-source.html">Asymp.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>&copy;1995-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>