mirror of
https://github.com/thestk/stk
synced 2026-01-14 05:21:53 +00:00
212 lines
16 KiB
HTML
212 lines
16 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_1TwoPole.html">TwoPole</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::TwoPole Class Reference</h1><!-- doxytag: class="stk::TwoPole" --><!-- doxytag: inherits="stk::Filter" -->STK two-pole filter class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="TwoPole_8h-source.html">TwoPole.h</a>></code>
|
|
<p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::TwoPole:</div>
|
|
<div class="dynsection">
|
|
|
|
<p><center><img src="classstk_1_1TwoPole.png" usemap="#stk::TwoPole_map" border="0" alt=""></center>
|
|
<map name="stk::TwoPole_map">
|
|
<area href="classstk_1_1Filter.html" alt="stk::Filter" shape="rect" coords="0,56,81,80">
|
|
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,81,24">
|
|
</map>
|
|
</div>
|
|
|
|
<p>
|
|
<a href="classstk_1_1TwoPole-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="01a2b3b3d286e00a097918ec5f8a287b"></a><!-- doxytag: member="stk::TwoPole::TwoPole" ref="01a2b3b3d286e00a097918ec5f8a287b" args="(void)" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#01a2b3b3d286e00a097918ec5f8a287b">TwoPole</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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="abc2e1046f8f908fc78a53b50b00ed9f"></a><!-- doxytag: member="stk::TwoPole::~TwoPole" ref="abc2e1046f8f908fc78a53b50b00ed9f" args="()" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#abc2e1046f8f908fc78a53b50b00ed9f">~TwoPole</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d0a3ac1b5d4e651a7ff1efb1d5362c0b"></a><!-- doxytag: member="stk::TwoPole::ignoreSampleRateChange" ref="d0a3ac1b5d4e651a7ff1efb1d5362c0b" args="(bool ignore=true)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#d0a3ac1b5d4e651a7ff1efb1d5362c0b">ignoreSampleRateChange</a> (bool ignore=true)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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"><a class="anchor" name="0a5bfc68061c1dbaa40bfbb9ddb67b7d"></a><!-- doxytag: member="stk::TwoPole::setB0" ref="0a5bfc68061c1dbaa40bfbb9ddb67b7d" args="(StkFloat b0)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#0a5bfc68061c1dbaa40bfbb9ddb67b7d">setB0</a> (StkFloat b0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the b[0] coefficient value. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d0c2f8ddc09ca1eb864515d816ebacdd"></a><!-- doxytag: member="stk::TwoPole::setA1" ref="d0c2f8ddc09ca1eb864515d816ebacdd" args="(StkFloat a1)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#d0c2f8ddc09ca1eb864515d816ebacdd">setA1</a> (StkFloat a1)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the a[1] coefficient value. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="309960a8b2cf6858f43f43dc739146ea"></a><!-- doxytag: member="stk::TwoPole::setA2" ref="309960a8b2cf6858f43f43dc739146ea" args="(StkFloat a2)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#309960a8b2cf6858f43f43dc739146ea">setA2</a> (StkFloat a2)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the a[2] coefficient value. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f9b68df9cc424a09e3ecb7f078bcacd3"></a><!-- doxytag: member="stk::TwoPole::setCoefficients" ref="f9b68df9cc424a09e3ecb7f078bcacd3" args="(StkFloat b0, StkFloat a1, StkFloat a2, bool clearState=false)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#f9b68df9cc424a09e3ecb7f078bcacd3">setCoefficients</a> (StkFloat b0, StkFloat a1, StkFloat a2, bool clearState=false)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set all filter coefficients. <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_1TwoPole.html#00997b12a1cf0a04888124eaf85c565d">setResonance</a> (StkFloat frequency, StkFloat radius, bool normalize=false)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the filter coefficients for a resonance at <em>frequency</em> (in Hz). <a href="#00997b12a1cf0a04888124eaf85c565d"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8a4fb4afe3e06c689827ecaec478aad1"></a><!-- doxytag: member="stk::TwoPole::lastOut" ref="8a4fb4afe3e06c689827ecaec478aad1" args="(void) const " -->
|
|
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#8a4fb4afe3e06c689827ecaec478aad1">lastOut</a> (void) const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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="d4612f9b6f971a4dd76b23bb2b9fefbc"></a><!-- doxytag: member="stk::TwoPole::tick" ref="d4612f9b6f971a4dd76b23bb2b9fefbc" args="(StkFloat input)" -->
|
|
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1TwoPole.html#d4612f9b6f971a4dd76b23bb2b9fefbc">tick</a> (StkFloat input)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Input one sample to the filter and return one output. <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_1TwoPole.html#9e8bd9ed925a1c4966fbc0b0799ce46b">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &frames, unsigned int channel=0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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="#9e8bd9ed925a1c4966fbc0b0799ce46b"></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_1TwoPole.html#5c9b52082c0d2845a5ca01ca276fe8f8">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &iFrames, <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &oFrames, unsigned int iChannel=0, unsigned int oChannel=0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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="#5c9b52082c0d2845a5ca01ca276fe8f8"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK two-pole filter class.
|
|
<p>
|
|
This class implements a two-pole digital filter. A method is provided for creating a resonance in the frequency response while maintaining a nearly constant filter gain.<p>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="00997b12a1cf0a04888124eaf85c565d"></a><!-- doxytag: member="stk::TwoPole::setResonance" ref="00997b12a1cf0a04888124eaf85c565d" args="(StkFloat frequency, StkFloat radius, bool normalize=false)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::TwoPole::setResonance </td>
|
|
<td>(</td>
|
|
<td class="paramtype">StkFloat </td>
|
|
<td class="paramname"> <em>frequency</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">StkFloat </td>
|
|
<td class="paramname"> <em>radius</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"> <em>normalize</em> = <code>false</code></td><td> </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. If <em>normalize</em> is true, the coefficients are then normalized to produce unity gain at <em>frequency</em> (the actual maximum filter gain tends to be slightly greater than unity when <em>radius</em> is not close to one). 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. An unstable filter will result for <em>radius</em> >= 1.0. For a better resonance filter, use a <a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole, two-zero) filter class.">BiQuad</a> filter. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classstk_1_1BiQuad.html" title="STK biquad (two-pole, two-zero) filter class.">BiQuad</a> filter class </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="9e8bd9ed925a1c4966fbc0b0799ce46b"></a><!-- doxytag: member="stk::TwoPole::tick" ref="9e8bd9ed925a1c4966fbc0b0799ce46b" args="(StkFrames &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> & stk::TwoPole::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>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>channel</em> = <code>0</code></td><td> </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="5c9b52082c0d2845a5ca01ca276fe8f8"></a><!-- doxytag: member="stk::TwoPole::tick" ref="5c9b52082c0d2845a5ca01ca276fe8f8" args="(StkFrames &iFrames, StkFrames &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> & stk::TwoPole::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </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> & </td>
|
|
<td class="paramname"> <em>oFrames</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>iChannel</em> = <code>0</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>oChannel</em> = <code>0</code></td><td> </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="TwoPole_8h-source.html">TwoPole.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>
|