mirror of
https://github.com/thestk/stk
synced 2026-01-14 05:21:53 +00:00
189 lines
17 KiB
HTML
189 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"> <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_1Instrmnt.html">Instrmnt</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::Instrmnt Class Reference</h1><!-- doxytag: class="stk::Instrmnt" --><!-- doxytag: inherits="stk::Stk" -->STK instrument abstract base class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="Instrmnt_8h-source.html">Instrmnt.h</a>></code>
|
|
<p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::Instrmnt:</div>
|
|
<div class="dynsection">
|
|
|
|
<p><center><img src="classstk_1_1Instrmnt.png" usemap="#stk::Instrmnt_map" border="0" alt=""></center>
|
|
<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>
|
|
|
|
<p>
|
|
<a href="classstk_1_1Instrmnt-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="6f3c4dc01e0484f0ca4a3b14f1b7caf0"></a><!-- doxytag: member="stk::Instrmnt::Instrmnt" ref="6f3c4dc01e0484f0ca4a3b14f1b7caf0" args="(void)" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#6f3c4dc01e0484f0ca4a3b14f1b7caf0">Instrmnt</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class constructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0736ccd253b446660938d51909a32f44"></a><!-- doxytag: member="stk::Instrmnt::noteOn" ref="0736ccd253b446660938d51909a32f44" args="(StkFloat frequency, StkFloat amplitude)=0" -->
|
|
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#0736ccd253b446660938d51909a32f44">noteOn</a> (StkFloat frequency, StkFloat amplitude)=0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Start a note with the given frequency and amplitude. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="582c77e71cd2c5cb46ba6f78fa0ac6a2"></a><!-- doxytag: member="stk::Instrmnt::noteOff" ref="582c77e71cd2c5cb46ba6f78fa0ac6a2" args="(StkFloat amplitude)=0" -->
|
|
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#582c77e71cd2c5cb46ba6f78fa0ac6a2">noteOff</a> (StkFloat amplitude)=0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Stop a note with the given amplitude (speed of decay). <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="597efc508ad367a308fa11b8cbdc96a7"></a><!-- doxytag: member="stk::Instrmnt::setFrequency" ref="597efc508ad367a308fa11b8cbdc96a7" args="(StkFloat frequency)" -->
|
|
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#597efc508ad367a308fa11b8cbdc96a7">setFrequency</a> (StkFloat frequency)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set instrument parameters for a particular frequency. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5aecf9f4d4dcecdbef8271c7fe62b2cf"></a><!-- doxytag: member="stk::Instrmnt::controlChange" ref="5aecf9f4d4dcecdbef8271c7fe62b2cf" args="(int number, StkFloat value)" -->
|
|
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#5aecf9f4d4dcecdbef8271c7fe62b2cf">controlChange</a> (int number, StkFloat value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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" nowrap align="right" valign="top"><a class="anchor" name="32564b611598653fce5e708821b3fcb4"></a><!-- doxytag: member="stk::Instrmnt::channelsOut" ref="32564b611598653fce5e708821b3fcb4" args="(void) const " -->
|
|
unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#32564b611598653fce5e708821b3fcb4">channelsOut</a> (void) const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the number of output channels for the class. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="277ac5149ec22c33d794dfd462a82d2b"></a><!-- doxytag: member="stk::Instrmnt::lastFrame" ref="277ac5149ec22c33d794dfd462a82d2b" args="(void) const " -->
|
|
const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#277ac5149ec22c33d794dfd462a82d2b">lastFrame</a> (void) const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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" nowrap align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#aa6bd5e4a5be7f9b0be967daf012872e">lastOut</a> (unsigned int channel=0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the specified channel value of the last computed frame. <a href="#aa6bd5e4a5be7f9b0be967daf012872e"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Instrmnt.html#d5d070c1fc6f93124dfed2a27b8e3cf1">tick</a> (unsigned int channel=0)=0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute one sample frame and return the specified <code>channel</code> value. <a href="#d5d070c1fc6f93124dfed2a27b8e3cf1"></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_1Instrmnt.html#4abfe94b5fc8d87b47729fe317222eb9">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">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="#4abfe94b5fc8d87b47729fe317222eb9"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK instrument abstract base class.
|
|
<p>
|
|
This class provides a common interface for all STK instruments.<p>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="aa6bd5e4a5be7f9b0be967daf012872e"></a><!-- doxytag: member="stk::Instrmnt::lastOut" ref="aa6bd5e4a5be7f9b0be967daf012872e" 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 </td>
|
|
<td class="paramname"> <em>channel</em> = <code>0</code> </td>
|
|
<td> ) </td>
|
|
<td><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Return the specified channel value of the last computed frame.
|
|
<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#32564b611598653fce5e708821b3fcb4" 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. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classstk_1_1Instrmnt.html#277ac5149ec22c33d794dfd462a82d2b" title="Return an StkFrames reference to the last output sample frame.">lastFrame()</a> </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="d5d070c1fc6f93124dfed2a27b8e3cf1"></a><!-- doxytag: member="stk::Instrmnt::tick" ref="d5d070c1fc6f93124dfed2a27b8e3cf1" 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 </td>
|
|
<td class="paramname"> <em>channel</em> = <code>0</code> </td>
|
|
<td> ) </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>
|
|
For monophonic instruments, the <code>channel</code> argument is ignored.
|
|
<p>Implemented in <a class="el" href="classstk_1_1BandedWG.html#44f37146d33354afb085806bd8340497">stk::BandedWG</a>, <a class="el" href="classstk_1_1BeeThree.html#4649b9471bde3b978c20fcafcbef0fc7">stk::BeeThree</a>, <a class="el" href="classstk_1_1BlowBotl.html#68501c2422994c8dca50086b3d944119">stk::BlowBotl</a>, <a class="el" href="classstk_1_1BlowHole.html#3438c72b975481dae7d51f33f6f6fd94">stk::BlowHole</a>, <a class="el" href="classstk_1_1Bowed.html#4d583369f0b22335fff8cee3ce6f2750">stk::Bowed</a>, <a class="el" href="classstk_1_1Brass.html#4af1b7c4c1b374b65e04ccaa90886321">stk::Brass</a>, <a class="el" href="classstk_1_1Clarinet.html#4cd08bca954ad434bc636eda957ca8d5">stk::Clarinet</a>, <a class="el" href="classstk_1_1Drummer.html#d65c63bfad0ffac03db7f56cf706e4ba">stk::Drummer</a>, <a class="el" href="classstk_1_1Flute.html#b8f307f9a26ef2756ec4c0ea05f3acbe">stk::Flute</a>, <a class="el" href="classstk_1_1FM.html#81f351fd8732fd6e686735b7b45a4241">stk::FM</a>, <a class="el" href="classstk_1_1FMVoices.html#31111029e36d00230586250df7b4d887">stk::FMVoices</a>, <a class="el" href="classstk_1_1HevyMetl.html#0261504b82845034be67ac573d564ff7">stk::HevyMetl</a>, <a class="el" href="classstk_1_1Mandolin.html#99f5b51e76c97299dd8c58f27a6d0e62">stk::Mandolin</a>, <a class="el" href="classstk_1_1Mesh2D.html#e8a7e86e4774d8738098c79ab0d5e00a">stk::Mesh2D</a>, <a class="el" href="classstk_1_1Modal.html#c1fd3f5dcb9b5cbb8bed0bff330c3890">stk::Modal</a>, <a class="el" href="classstk_1_1Moog.html#b9635044198c12a5c1b5dbb94245ab5a">stk::Moog</a>, <a class="el" href="classstk_1_1PercFlut.html#c2b2958902c044413a1c7ff3bd0f8054">stk::PercFlut</a>, <a class="el" href="classstk_1_1Plucked.html#db4a5d731ad2b680120313f03a020c25">stk::Plucked</a>, <a class="el" href="classstk_1_1Resonate.html#b917279f4f57d5d305481426e9bffd98">stk::Resonate</a>, <a class="el" href="classstk_1_1Rhodey.html#199591ffb4230c653ec7d7ea52e37790">stk::Rhodey</a>, <a class="el" href="classstk_1_1Sampler.html#08502c96fa3e5f4c853c781354ed1965">stk::Sampler</a>, <a class="el" href="classstk_1_1Saxofony.html#955d2ea0b3236039851d19b681ca2b0f">stk::Saxofony</a>, <a class="el" href="classstk_1_1Shakers.html#e06ebba276cef74cb8c83db4e33f21c2">stk::Shakers</a>, <a class="el" href="classstk_1_1Simple.html#a65326847f8b693f7b5549d18df6e882">stk::Simple</a>, <a class="el" href="classstk_1_1Sitar.html#811c8d08d78cfbd5061396af7027043e">stk::Sitar</a>, <a class="el" href="classstk_1_1StifKarp.html#5cd896c59ee01fa8e21346ebe54365fc">stk::StifKarp</a>, <a class="el" href="classstk_1_1TubeBell.html#fa7422b2a7361f2ebe60ebff887ef36f">stk::TubeBell</a>, <a class="el" href="classstk_1_1VoicForm.html#c12629d2730f582e405b221e1d7b6f29">stk::VoicForm</a>, <a class="el" href="classstk_1_1Whistle.html#3835e290dae97acfe79e1f7458a39cda">stk::Whistle</a>, and <a class="el" href="classstk_1_1Wurley.html#2019cfe262eb755ac939c98bda0383bd">stk::Wurley</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="4abfe94b5fc8d87b47729fe317222eb9"></a><!-- doxytag: member="stk::Instrmnt::tick" ref="4abfe94b5fc8d87b47729fe317222eb9" 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::Instrmnt::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]</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>
|
|
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.
|
|
</div>
|
|
</div><p>
|
|
<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></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>
|