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

139 lines
10 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_1BlitSaw.html">BlitSaw</a>
</div>
<div class="contents">
<h1>stk::BlitSaw Class Reference</h1><!-- doxytag: class="stk::BlitSaw" --><!-- doxytag: inherits="stk::Generator" -->STK band-limited sawtooth wave class.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="BlitSaw_8h-source.html">BlitSaw.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for stk::BlitSaw:</div>
<div class="dynsection">
<p><center><img src="classstk_1_1BlitSaw.png" usemap="#stk::BlitSaw_map" border="0" alt=""></center>
<map name="stk::BlitSaw_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_1BlitSaw-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="8a245ef05cc58c521edaded5c6cdd5ee"></a><!-- doxytag: member="stk::BlitSaw::BlitSaw" ref="8a245ef05cc58c521edaded5c6cdd5ee" args="(StkFloat frequency=220.0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1BlitSaw.html#8a245ef05cc58c521edaded5c6cdd5ee">BlitSaw</a> (StkFloat frequency=220.0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class constructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="24cd2cc9852ce73252a99f7eff63879b"></a><!-- doxytag: member="stk::BlitSaw::~BlitSaw" ref="24cd2cc9852ce73252a99f7eff63879b" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1BlitSaw.html#24cd2cc9852ce73252a99f7eff63879b">~BlitSaw</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="3010cf9a0905368b857df2d332968036"></a><!-- doxytag: member="stk::BlitSaw::reset" ref="3010cf9a0905368b857df2d332968036" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1BlitSaw.html#3010cf9a0905368b857df2d332968036">reset</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets the oscillator state and phase to 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fa6f1103a61221eebf5f49f3a7df4145"></a><!-- doxytag: member="stk::BlitSaw::setFrequency" ref="fa6f1103a61221eebf5f49f3a7df4145" args="(StkFloat frequency)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1BlitSaw.html#fa6f1103a61221eebf5f49f3a7df4145">setFrequency</a> (StkFloat frequency)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the sawtooth oscillator rate in terms of a frequency in Hz. <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_1BlitSaw.html#8abd2b9a5b8d26926a383c1e56605545">setHarmonics</a> (unsigned int nHarmonics=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the number of harmonics generated in the signal. <a href="#8abd2b9a5b8d26926a383c1e56605545"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="254758ecd4166cc4e7d6fced5650a198"></a><!-- doxytag: member="stk::BlitSaw::lastOut" ref="254758ecd4166cc4e7d6fced5650a198" args="(void) const " -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1BlitSaw.html#254758ecd4166cc4e7d6fced5650a198">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="03536a1f1823ea41649b4a62ba98007c"></a><!-- doxytag: member="stk::BlitSaw::tick" ref="03536a1f1823ea41649b4a62ba98007c" args="(void)" -->
StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1BlitSaw.html#03536a1f1823ea41649b4a62ba98007c">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_1BlitSaw.html#b53f6ba99ef5c4f8982f6c0f07bf2e1d">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="#b53f6ba99ef5c4f8982f6c0f07bf2e1d"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
STK band-limited sawtooth wave class.
<p>
This class generates a band-limited sawtooth waveform using a closed-form algorithm reported by Stilson and Smith in "Alias-Free Digital Synthesis of Classic Analog Waveforms", 1996. The user can specify both the fundamental frequency of the sawtooth and the number of harmonics contained in the resulting signal.<p>
If nHarmonics is 0, then the signal will contain all harmonics up to half the sample rate. Note, however, that this setting may produce aliasing in the signal when the frequency is changing (no automatic modification of the number of harmonics is performed by the <a class="el" href="classstk_1_1BlitSaw.html#fa6f1103a61221eebf5f49f3a7df4145" title="Set the sawtooth oscillator rate in terms of a frequency in Hz.">setFrequency()</a> function).<p>
Based on initial code of Robin Davies, 2005. Modified algorithm code by Gary Scavone, 2005. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="8abd2b9a5b8d26926a383c1e56605545"></a><!-- doxytag: member="stk::BlitSaw::setHarmonics" ref="8abd2b9a5b8d26926a383c1e56605545" args="(unsigned int nHarmonics=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void stk::BlitSaw::setHarmonics </td>
<td>(</td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>nHarmonics</em> = <code>0</code> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the number of harmonics generated in the signal.
<p>
This function sets the number of harmonics contained in the resulting signal. It is equivalent to (2 * M) + 1 in the BLIT algorithm. The default value of 0 sets the algorithm for maximum harmonic content (harmonics up to half the sample rate). This parameter is not checked against the current sample rate and fundamental frequency. Thus, aliasing can result if one or more harmonics for a given fundamental frequency exceeds fs / 2. This behavior was chosen over the potentially more problematic solution of automatically modifying the M parameter, which can produce audible clicks in the signal.
</div>
</div><p>
<a class="anchor" name="b53f6ba99ef5c4f8982f6c0f07bf2e1d"></a><!-- doxytag: member="stk::BlitSaw::tick" ref="b53f6ba99ef5c4f8982f6c0f07bf2e1d" 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::BlitSaw::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="BlitSaw_8h-source.html">BlitSaw.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>