Files
stk/doc/html/classBlitSaw.html
2013-09-29 23:40:35 +02:00

92 lines
6.2 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="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.4.4 -->
<h1>BlitSaw Class Reference</h1><!-- doxytag: class="BlitSaw" --><!-- doxytag: inherits="Generator" --><code>#include &lt;<a class="el" href="BlitSaw_8h-source.html">BlitSaw.h</a>&gt;</code>
<p>
<p>Inheritance diagram for BlitSaw:
<p><center><img src="classBlitSaw.png" usemap="#BlitSaw_map" border="0" alt=""></center>
<map name="BlitSaw_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="classBlitSaw-members.html">List of all members.</a><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="classBlitSaw.html#a3">setFrequency()</a> function).<p>
Based on initial code of Robin Davies, 2005. Modified algorithm code by Gary Scavone, 2005.
<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="BlitSaw::BlitSaw" ref="a0" args="(StkFloat frequency=220.0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlitSaw.html#a0">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="a1"></a><!-- doxytag: member="BlitSaw::~BlitSaw" ref="a1" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlitSaw.html#a1">~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="a2"></a><!-- doxytag: member="BlitSaw::reset" ref="a2" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlitSaw.html#a2">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="a3"></a><!-- doxytag: member="BlitSaw::setFrequency" ref="a3" args="(StkFloat frequency)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBlitSaw.html#a3">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="classBlitSaw.html#a4">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="#a4"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a4"></a><!-- doxytag: member="BlitSaw::setHarmonics" ref="a4" args="(unsigned int nHarmonics=0)" --><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 BlitSaw::setHarmonics </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>nHarmonics</em> = <code>0</code> </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 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. </td>
</tr>
</table>
<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>
<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-2005 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>