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

247 lines
17 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_1FormSwep.html">FormSwep</a>
</div>
<div class="contents">
<h1>stk::FormSwep Class Reference</h1><!-- doxytag: class="stk::FormSwep" --><!-- doxytag: inherits="stk::Filter" -->STK sweepable formant filter class.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="FormSwep_8h-source.html">FormSwep.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for stk::FormSwep:</div>
<div class="dynsection">
<p><center><img src="classstk_1_1FormSwep.png" usemap="#stk::FormSwep_map" border="0" alt=""></center>
<map name="stk::FormSwep_map">
<area href="classstk_1_1Filter.html" alt="stk::Filter" shape="rect" coords="0,56,93,80">
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,93,24">
</map>
</div>
<p>
<a href="classstk_1_1FormSwep-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="eb0093d5962acf4b5d582730e8c8bab9"></a><!-- doxytag: member="stk::FormSwep::FormSwep" ref="eb0093d5962acf4b5d582730e8c8bab9" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#eb0093d5962acf4b5d582730e8c8bab9">FormSwep</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor creates a second-order pass-through filter. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c02cd2882f67e8ed9c315dfbf10b05a9"></a><!-- doxytag: member="stk::FormSwep::~FormSwep" ref="c02cd2882f67e8ed9c315dfbf10b05a9" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#c02cd2882f67e8ed9c315dfbf10b05a9">~FormSwep</a> ()</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="91096ebd684df25fc36a759f642b2200"></a><!-- doxytag: member="stk::FormSwep::ignoreSampleRateChange" ref="91096ebd684df25fc36a759f642b2200" args="(bool ignore=true)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#91096ebd684df25fc36a759f642b2200">ignoreSampleRateChange</a> (bool ignore=true)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function to enable/disable the automatic updating of class data when the STK sample rate changes. <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_1FormSwep.html#a6fe339cc937260c46e8c169a58d8529">setResonance</a> (StkFloat frequency, StkFloat radius)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the filter coefficients for a resonance at <em>frequency</em> (in Hz). <a href="#a6fe339cc937260c46e8c169a58d8529"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3aede7b088dbe2ca98b3398a5f953ae7"></a><!-- doxytag: member="stk::FormSwep::setStates" ref="3aede7b088dbe2ca98b3398a5f953ae7" args="(StkFloat frequency, StkFloat radius, StkFloat gain=1.0)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#3aede7b088dbe2ca98b3398a5f953ae7">setStates</a> (StkFloat frequency, StkFloat radius, StkFloat gain=1.0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set both the current and target resonance parameters. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2f00d2edf80fbf8f74a284c68caf07d6"></a><!-- doxytag: member="stk::FormSwep::setTargets" ref="2f00d2edf80fbf8f74a284c68caf07d6" args="(StkFloat frequency, StkFloat radius, StkFloat gain=1.0)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#2f00d2edf80fbf8f74a284c68caf07d6">setTargets</a> (StkFloat frequency, StkFloat radius, StkFloat gain=1.0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set target resonance parameters. <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_1FormSwep.html#27ba31acdbe8334da1830e14872fd226">setSweepRate</a> (StkFloat rate)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the sweep rate (between 0.0 - 1.0). <a href="#27ba31acdbe8334da1830e14872fd226"></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="classstk_1_1FormSwep.html#242edcbe2a6f88393357b5a5ccec43e8">setSweepTime</a> (StkFloat time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the sweep rate in terms of a time value in seconds. <a href="#242edcbe2a6f88393357b5a5ccec43e8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3d8405c24e8539b389daf86fccfe5d70"></a><!-- doxytag: member="stk::FormSwep::lastOut" ref="3d8405c24e8539b389daf86fccfe5d70" args="(void) const " -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#3d8405c24e8539b389daf86fccfe5d70">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="ba0d15e1d102cb0fee0806e1bb05c774"></a><!-- doxytag: member="stk::FormSwep::tick" ref="ba0d15e1d102cb0fee0806e1bb05c774" args="(StkFloat input)" -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FormSwep.html#ba0d15e1d102cb0fee0806e1bb05c774">tick</a> (StkFloat input)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input one sample to the filter and return a reference to one output. <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_1FormSwep.html#27f68dc2bb3fa41322ae49cf59cc9884">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">Take a channel of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object as inputs to the filter and replace with corresponding outputs. <a href="#27f68dc2bb3fa41322ae49cf59cc9884"></a><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_1FormSwep.html#8a16af2b4e169946cedb8fec2bb1417a">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;iFrames, <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;oFrames, unsigned int iChannel=0, unsigned int oChannel=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take a channel of the <code>iFrames</code> object as inputs to the filter and write outputs to the <code>oFrames</code> object. <a href="#8a16af2b4e169946cedb8fec2bb1417a"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
STK sweepable formant filter class.
<p>
This class implements a formant (resonance) which can be "swept" over time from one frequency setting to another. It provides methods for controlling the sweep rate and target frequency.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a6fe339cc937260c46e8c169a58d8529"></a><!-- doxytag: member="stk::FormSwep::setResonance" ref="a6fe339cc937260c46e8c169a58d8529" args="(StkFloat frequency, StkFloat radius)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FormSwep::setResonance </td>
<td>(</td>
<td class="paramtype">StkFloat&nbsp;</td>
<td class="paramname"> <em>frequency</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">StkFloat&nbsp;</td>
<td class="paramname"> <em>radius</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the filter coefficients for a resonance at <em>frequency</em> (in Hz).
<p>
This method determines the filter coefficients corresponding to two complex-conjugate poles with the given <em>frequency</em> (in Hz) and <em>radius</em> from the z-plane origin. The filter zeros are placed at z = 1, z = -1, and the coefficients are then normalized to produce a constant unity gain (independent of the filter <em>gain</em> parameter). The resulting filter frequency response has a resonance at the given <em>frequency</em>. The closer the poles are to the unit-circle (<em>radius</em> close to one), the narrower the resulting resonance width.
</div>
</div><p>
<a class="anchor" name="27ba31acdbe8334da1830e14872fd226"></a><!-- doxytag: member="stk::FormSwep::setSweepRate" ref="27ba31acdbe8334da1830e14872fd226" args="(StkFloat rate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FormSwep::setSweepRate </td>
<td>(</td>
<td class="paramtype">StkFloat&nbsp;</td>
<td class="paramname"> <em>rate</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the sweep rate (between 0.0 - 1.0).
<p>
The formant parameters are varied in increments of the sweep rate between their current and target values. A sweep rate of 1.0 will produce an immediate change in resonance parameters from their current values to the target values. A sweep rate of 0.0 will produce no change in resonance parameters.
</div>
</div><p>
<a class="anchor" name="242edcbe2a6f88393357b5a5ccec43e8"></a><!-- doxytag: member="stk::FormSwep::setSweepTime" ref="242edcbe2a6f88393357b5a5ccec43e8" args="(StkFloat time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::FormSwep::setSweepTime </td>
<td>(</td>
<td class="paramtype">StkFloat&nbsp;</td>
<td class="paramname"> <em>time</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the sweep rate in terms of a time value in seconds.
<p>
This method adjusts the sweep rate based on a given time for the formant parameters to reach their target values.
</div>
</div><p>
<a class="anchor" name="27f68dc2bb3fa41322ae49cf59cc9884"></a><!-- doxytag: member="stk::FormSwep::tick" ref="27f68dc2bb3fa41322ae49cf59cc9884" 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::FormSwep::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>
Take a channel of the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object as inputs to the filter and replace with corresponding outputs.
<p>
The <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument reference is returned. 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_1Filter.html#3260a238824c4a748ac057b84b7d3f21">stk::Filter</a>.</p>
</div>
</div><p>
<a class="anchor" name="8a16af2b4e169946cedb8fec2bb1417a"></a><!-- doxytag: member="stk::FormSwep::tick" ref="8a16af2b4e169946cedb8fec2bb1417a" args="(StkFrames &amp;iFrames, StkFrames &amp;oFrames, unsigned int iChannel=0, unsigned int oChannel=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::FormSwep::tick </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="paramname"> <em>iFrames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td>
<td class="paramname"> <em>oFrames</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>iChannel</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>oChannel</em> = <code>0</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Take a channel of the <code>iFrames</code> object as inputs to the filter and write outputs to the <code>oFrames</code> object.
<p>
The <code>iFrames</code> object reference is returned. Each channel argument must be less than the number of channels in the corresponding <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.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="FormSwep_8h-source.html">FormSwep.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>