Files
stk/doc/html/classstk_1_1Instrmnt.html
2013-09-29 23:48:48 +02:00

177 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.6.2 -->
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1Instrmnt.html">Instrmnt</a>
</div>
<div class="contents">
<h1>stk::Instrmnt Class Reference</h1><!-- doxytag: class="stk::Instrmnt" --><!-- doxytag: inherits="stk::Stk" -->
<p>STK instrument abstract base class.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Instrmnt_8h_source.html">Instrmnt.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for stk::Instrmnt:</div>
<div class="dynsection">
<div class="center">
<img src="classstk_1_1Instrmnt.png" usemap="#stk::Instrmnt_map" alt=""/>
<map id="stk::Instrmnt_map" name="stk::Instrmnt_map">
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,96,24"/>
<area href="classstk_1_1BandedWG.html" alt="stk::BandedWG" shape="rect" coords="106,112,202,136"/>
<area href="classstk_1_1BlowBotl.html" alt="stk::BlowBotl" shape="rect" coords="106,168,202,192"/>
<area href="classstk_1_1BlowHole.html" alt="stk::BlowHole" shape="rect" coords="106,224,202,248"/>
<area href="classstk_1_1Bowed.html" alt="stk::Bowed" shape="rect" coords="106,280,202,304"/>
<area href="classstk_1_1Brass.html" alt="stk::Brass" shape="rect" coords="106,336,202,360"/>
<area href="classstk_1_1Clarinet.html" alt="stk::Clarinet" shape="rect" coords="106,392,202,416"/>
<area href="classstk_1_1Drummer.html" alt="stk::Drummer" shape="rect" coords="106,448,202,472"/>
<area href="classstk_1_1Flute.html" alt="stk::Flute" shape="rect" coords="106,504,202,528"/>
<area href="classstk_1_1FM.html" alt="stk::FM" shape="rect" coords="106,560,202,584"/>
<area href="classstk_1_1Mesh2D.html" alt="stk::Mesh2D" shape="rect" coords="106,616,202,640"/>
<area href="classstk_1_1Modal.html" alt="stk::Modal" shape="rect" coords="106,672,202,696"/>
<area href="classstk_1_1Plucked.html" alt="stk::Plucked" shape="rect" coords="106,728,202,752"/>
<area href="classstk_1_1PluckTwo.html" alt="stk::PluckTwo" shape="rect" coords="106,784,202,808"/>
<area href="classstk_1_1Resonate.html" alt="stk::Resonate" shape="rect" coords="106,840,202,864"/>
<area href="classstk_1_1Sampler.html" alt="stk::Sampler" shape="rect" coords="106,896,202,920"/>
<area href="classstk_1_1Saxofony.html" alt="stk::Saxofony" shape="rect" coords="106,952,202,976"/>
<area href="classstk_1_1Shakers.html" alt="stk::Shakers" shape="rect" coords="106,1008,202,1032"/>
<area href="classstk_1_1Simple.html" alt="stk::Simple" shape="rect" coords="106,1064,202,1088"/>
<area href="classstk_1_1Sitar.html" alt="stk::Sitar" shape="rect" coords="106,1120,202,1144"/>
<area href="classstk_1_1StifKarp.html" alt="stk::StifKarp" shape="rect" coords="106,1176,202,1200"/>
<area href="classstk_1_1VoicForm.html" alt="stk::VoicForm" shape="rect" coords="106,1232,202,1256"/>
<area href="classstk_1_1Whistle.html" alt="stk::Whistle" shape="rect" coords="106,1288,202,1312"/>
</map>
</div>
</div>
<p><a href="classstk_1_1Instrmnt-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f3c4dc01e0484f0ca4a3b14f1b7caf0"></a><!-- doxytag: member="stk::Instrmnt::Instrmnt" ref="a6f3c4dc01e0484f0ca4a3b14f1b7caf0" args="(void)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a6f3c4dc01e0484f0ca4a3b14f1b7caf0">Instrmnt</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0736ccd253b446660938d51909a32f44"></a><!-- doxytag: member="stk::Instrmnt::noteOn" ref="a0736ccd253b446660938d51909a32f44" args="(StkFloat frequency, StkFloat amplitude)=0" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a0736ccd253b446660938d51909a32f44">noteOn</a> (StkFloat frequency, StkFloat amplitude)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start a note with the given frequency and amplitude. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a582c77e71cd2c5cb46ba6f78fa0ac6a2"></a><!-- doxytag: member="stk::Instrmnt::noteOff" ref="a582c77e71cd2c5cb46ba6f78fa0ac6a2" args="(StkFloat amplitude)=0" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a582c77e71cd2c5cb46ba6f78fa0ac6a2">noteOff</a> (StkFloat amplitude)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a note with the given amplitude (speed of decay). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a597efc508ad367a308fa11b8cbdc96a7"></a><!-- doxytag: member="stk::Instrmnt::setFrequency" ref="a597efc508ad367a308fa11b8cbdc96a7" args="(StkFloat frequency)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a597efc508ad367a308fa11b8cbdc96a7">setFrequency</a> (StkFloat frequency)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set instrument parameters for a particular frequency. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5aecf9f4d4dcecdbef8271c7fe62b2cf"></a><!-- doxytag: member="stk::Instrmnt::controlChange" ref="a5aecf9f4d4dcecdbef8271c7fe62b2cf" args="(int number, StkFloat value)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a5aecf9f4d4dcecdbef8271c7fe62b2cf">controlChange</a> (int number, StkFloat value)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Perform the control change specified by <em>number</em> and <em>value</em> (0.0 - 128.0). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a32564b611598653fce5e708821b3fcb4"></a><!-- doxytag: member="stk::Instrmnt::channelsOut" ref="a32564b611598653fce5e708821b3fcb4" args="(void) const " -->
unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a32564b611598653fce5e708821b3fcb4">channelsOut</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of output channels for the class. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a277ac5149ec22c33d794dfd462a82d2b"></a><!-- doxytag: member="stk::Instrmnt::lastFrame" ref="a277ac5149ec22c33d794dfd462a82d2b" args="(void) const " -->
const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#a277ac5149ec22c33d794dfd462a82d2b">lastFrame</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return an <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> reference to the last output sample frame. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#aaa6bd5e4a5be7f9b0be967daf012872e">lastOut</a> (unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the specified channel value of the last computed frame. <a href="#aaa6bd5e4a5be7f9b0be967daf012872e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual StkFloat&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#ad5d070c1fc6f93124dfed2a27b8e3cf1">tick</a> (unsigned int channel=0)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute one sample frame and return the specified <code>channel</code> value. <a href="#ad5d070c1fc6f93124dfed2a27b8e3cf1"></a><br/></td></tr>
<tr><td class="memItemLeft" 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_1Instrmnt.html#a4abfe94b5fc8d87b47729fe317222eb9">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 the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object with computed sample frames, starting at the specified channel. <a href="#a4abfe94b5fc8d87b47729fe317222eb9"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>STK instrument abstract base class. </p>
<p>This class provides a common interface for all STK instruments.</p>
<p>by Perry R. Cook and Gary P. Scavone, 1995 - 2010. </p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aaa6bd5e4a5be7f9b0be967daf012872e"></a><!-- doxytag: member="stk::Instrmnt::lastOut" ref="aaa6bd5e4a5be7f9b0be967daf012872e" args="(unsigned int channel=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">StkFloat stk::Instrmnt::lastOut </td>
<td>(</td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>channel</em> = <code>0</code></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the specified channel value of the last computed frame. </p>
<p>The <code>channel</code> argument must be less than the number of output channels, which can be determined with the <a class="el" href="classstk_1_1Instrmnt.html#a32564b611598653fce5e708821b3fcb4" title="Return the number of output channels for the class.">channelsOut()</a> function (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>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classstk_1_1Instrmnt.html#a277ac5149ec22c33d794dfd462a82d2b" title="Return an StkFrames reference to the last output sample frame.">lastFrame()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ad5d070c1fc6f93124dfed2a27b8e3cf1"></a><!-- doxytag: member="stk::Instrmnt::tick" ref="ad5d070c1fc6f93124dfed2a27b8e3cf1" args="(unsigned int channel=0)=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual StkFloat stk::Instrmnt::tick </td>
<td>(</td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>channel</em> = <code>0</code></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Compute one sample frame and return the specified <code>channel</code> value. </p>
<p>For monophonic instruments, the <code>channel</code> argument is ignored. </p>
<p>Implemented in <a class="el" href="classstk_1_1BandedWG.html#a44f37146d33354afb085806bd8340497">stk::BandedWG</a>, <a class="el" href="classstk_1_1BeeThree.html#a4649b9471bde3b978c20fcafcbef0fc7">stk::BeeThree</a>, <a class="el" href="classstk_1_1BlowBotl.html#a68501c2422994c8dca50086b3d944119">stk::BlowBotl</a>, <a class="el" href="classstk_1_1BlowHole.html#a3438c72b975481dae7d51f33f6f6fd94">stk::BlowHole</a>, <a class="el" href="classstk_1_1Bowed.html#a4d583369f0b22335fff8cee3ce6f2750">stk::Bowed</a>, <a class="el" href="classstk_1_1Brass.html#a4af1b7c4c1b374b65e04ccaa90886321">stk::Brass</a>, <a class="el" href="classstk_1_1Clarinet.html#a4cd08bca954ad434bc636eda957ca8d5">stk::Clarinet</a>, <a class="el" href="classstk_1_1Drummer.html#ad65c63bfad0ffac03db7f56cf706e4ba">stk::Drummer</a>, <a class="el" href="classstk_1_1Flute.html#ab8f307f9a26ef2756ec4c0ea05f3acbe">stk::Flute</a>, <a class="el" href="classstk_1_1FM.html#a81f351fd8732fd6e686735b7b45a4241">stk::FM</a>, <a class="el" href="classstk_1_1FMVoices.html#a31111029e36d00230586250df7b4d887">stk::FMVoices</a>, <a class="el" href="classstk_1_1HevyMetl.html#a0261504b82845034be67ac573d564ff7">stk::HevyMetl</a>, <a class="el" href="classstk_1_1Mandolin.html#a99f5b51e76c97299dd8c58f27a6d0e62">stk::Mandolin</a>, <a class="el" href="classstk_1_1Mesh2D.html#ae8a7e86e4774d8738098c79ab0d5e00a">stk::Mesh2D</a>, <a class="el" href="classstk_1_1Modal.html#ac1fd3f5dcb9b5cbb8bed0bff330c3890">stk::Modal</a>, <a class="el" href="classstk_1_1Moog.html#ab9635044198c12a5c1b5dbb94245ab5a">stk::Moog</a>, <a class="el" href="classstk_1_1PercFlut.html#ac2b2958902c044413a1c7ff3bd0f8054">stk::PercFlut</a>, <a class="el" href="classstk_1_1Plucked.html#adb4a5d731ad2b680120313f03a020c25">stk::Plucked</a>, <a class="el" href="classstk_1_1Resonate.html#ab917279f4f57d5d305481426e9bffd98">stk::Resonate</a>, <a class="el" href="classstk_1_1Rhodey.html#a199591ffb4230c653ec7d7ea52e37790">stk::Rhodey</a>, <a class="el" href="classstk_1_1Sampler.html#a08502c96fa3e5f4c853c781354ed1965">stk::Sampler</a>, <a class="el" href="classstk_1_1Saxofony.html#a955d2ea0b3236039851d19b681ca2b0f">stk::Saxofony</a>, <a class="el" href="classstk_1_1Shakers.html#ae06ebba276cef74cb8c83db4e33f21c2">stk::Shakers</a>, <a class="el" href="classstk_1_1Simple.html#aa65326847f8b693f7b5549d18df6e882">stk::Simple</a>, <a class="el" href="classstk_1_1Sitar.html#a811c8d08d78cfbd5061396af7027043e">stk::Sitar</a>, <a class="el" href="classstk_1_1StifKarp.html#a5cd896c59ee01fa8e21346ebe54365fc">stk::StifKarp</a>, <a class="el" href="classstk_1_1TubeBell.html#afa7422b2a7361f2ebe60ebff887ef36f">stk::TubeBell</a>, <a class="el" href="classstk_1_1VoicForm.html#ac12629d2730f582e405b221e1d7b6f29">stk::VoicForm</a>, <a class="el" href="classstk_1_1Whistle.html#a3835e290dae97acfe79e1f7458a39cda">stk::Whistle</a>, and <a class="el" href="classstk_1_1Wurley.html#a2019cfe262eb755ac939c98bda0383bd">stk::Wurley</a>.</p>
</div>
</div>
<a class="anchor" id="a4abfe94b5fc8d87b47729fe317222eb9"></a><!-- doxytag: member="stk::Instrmnt::tick" ref="a4abfe94b5fc8d87b47729fe317222eb9" 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::Instrmnt::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]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Fill the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object with computed sample frames, starting at the specified channel. </p>
<p>The <code>channel</code> argument plus the number of output channels 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>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Instrmnt_8h_source.html">Instrmnt.h</a></li>
</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-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>