mirror of
https://github.com/thestk/stk
synced 2026-01-18 07:01:53 +00:00
355 lines
23 KiB
HTML
355 lines
23 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.6.2 -->
|
|
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1Guitar.html">Guitar</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::Guitar Class Reference</h1><!-- doxytag: class="stk::Guitar" --><!-- doxytag: inherits="stk::Stk" -->
|
|
<p>STK guitar model class.
|
|
<a href="#_details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="Guitar_8h_source.html">Guitar.h</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::Guitar:</div>
|
|
<div class="dynsection">
|
|
<div class="center">
|
|
<img src="classstk_1_1Guitar.png" usemap="#stk::Guitar_map" alt=""/>
|
|
<map id="stk::Guitar_map" name="stk::Guitar_map">
|
|
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,67,24"/>
|
|
</map>
|
|
</div>
|
|
</div>
|
|
|
|
<p><a href="classstk_1_1Guitar-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="a7eac8ce2d2d6db176770639fe547bcb2"></a><!-- doxytag: member="stk::Guitar::Guitar" ref="a7eac8ce2d2d6db176770639fe547bcb2" args="(unsigned int nStrings=6, std::string bodyfile="")" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#a7eac8ce2d2d6db176770639fe547bcb2">Guitar</a> (unsigned int nStrings=6, std::string bodyfile="")</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class constructor, specifying an arbitrary number of strings (default = 6). <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adb7355a9bcf6e94d9db4809175cbae1b"></a><!-- doxytag: member="stk::Guitar::clear" ref="adb7355a9bcf6e94d9db4809175cbae1b" args="(void)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#adb7355a9bcf6e94d9db4809175cbae1b">clear</a> (void)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reset and clear all internal state. <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#a95c212c2d6a72ee93c2000f0308df9cc">setBodyFile</a> (std::string bodyfile="")</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the string excitation, using either a soundfile or computed noise. <a href="#a95c212c2d6a72ee93c2000f0308df9cc"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#a4a2098002e20c5aac3927e2c080c64ca">setPluckPosition</a> (StkFloat position, int string=-1)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the pluck position for one or all strings. <a href="#a4a2098002e20c5aac3927e2c080c64ca"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#adc1d5eadc46cbcdb8ddcf8b0e4aae9db">setLoopGain</a> (StkFloat gain, int string=-1)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the loop gain for one or all strings. <a href="#adc1d5eadc46cbcdb8ddcf8b0e4aae9db"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8812168a7ffc5318d42a25b1cfda7bff"></a><!-- doxytag: member="stk::Guitar::setFrequency" ref="a8812168a7ffc5318d42a25b1cfda7bff" args="(StkFloat frequency, unsigned int string=0)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#a8812168a7ffc5318d42a25b1cfda7bff">setFrequency</a> (StkFloat frequency, unsigned int string=0)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set instrument parameters for a particular frequency. <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#a9dec744a074dba5c869b2aec1198ada7">noteOn</a> (StkFloat frequency, StkFloat amplitude, unsigned int string=0)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Start a note with the given frequency and amplitude. <a href="#a9dec744a074dba5c869b2aec1198ada7"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="accf5a4b16602560591ed010245a297d4"></a><!-- doxytag: member="stk::Guitar::noteOff" ref="accf5a4b16602560591ed010245a297d4" args="(StkFloat amplitude, unsigned int string=0)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#accf5a4b16602560591ed010245a297d4">noteOff</a> (StkFloat amplitude, unsigned int string=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" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#ae9900d35d4f5ae7a67dfcc62a1175aba">controlChange</a> (int number, StkFloat value, int string=-1)</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). <a href="#ae9900d35d4f5ae7a67dfcc62a1175aba"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aee53aa17d760670cc875c06f1de6af91"></a><!-- doxytag: member="stk::Guitar::lastOut" ref="aee53aa17d760670cc875c06f1de6af91" args="(void)" -->
|
|
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#aee53aa17d760670cc875c06f1de6af91">lastOut</a> (void)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the last computed output value. <br/></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a47223c1ef411141ae04b0971497b5fb8"></a><!-- doxytag: member="stk::Guitar::tick" ref="a47223c1ef411141ae04b0971497b5fb8" args="(StkFloat input=0.0)" -->
|
|
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Guitar.html#a47223c1ef411141ae04b0971497b5fb8">tick</a> (StkFloat input=0.0)</td></tr>
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Take an optional input sample and compute one output sample. <br/></td></tr>
|
|
<tr><td class="memItemLeft" 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_1Guitar.html#aa8a2447a813f400c92ab2333c2d8a125">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 <code>iFrames</code> object as inputs to the class and write outputs to the <code>oFrames</code> object. <a href="#aa8a2447a813f400c92ab2333c2d8a125"></a><br/></td></tr>
|
|
<tr><td class="memItemLeft" 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_1Guitar.html#a8ed813db2c23a9893e7d329528d659e8">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 effect and write outputs to the <code>oFrames</code> object. <a href="#a8ed813db2c23a9893e7d329528d659e8"></a><br/></td></tr>
|
|
</table>
|
|
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
|
<p>STK guitar model class. </p>
|
|
<p>This class implements a guitar model with an arbitrary number of strings (specified during instantiation). Each string is represented by an <a class="el" href="classstk_1_1Twang.html" title="STK enhanced plucked string class.">stk::Twang</a> object. The model supports commuted synthesis, as discussed by Smith and Karjalainen. It also includes a basic body coupling model and supports feedback.</p>
|
|
<p>This class does not attempt voice management. Rather, most functions support a parameter to specify a particular string number and string (voice) management is assumed to occur externally. Note that this class does not inherit from <a class="el" href="classstk_1_1Instrmnt.html" title="STK instrument abstract base class.">stk::Instrmnt</a> because of API inconsistencies.</p>
|
|
<p>This is a digital waveguide model, making its use possibly subject to patents held by Stanford University, Yamaha, and others.</p>
|
|
<p>Control Change Numbers:</p>
|
|
<ul>
|
|
<li>Bridge Coupling Gain = 2</li>
|
|
<li>Pluck Position = 4</li>
|
|
<li>Loop Gain = 11</li>
|
|
<li>Coupling <a class="el" href="classstk_1_1Filter.html" title="STK abstract filter class.">Filter</a> Pole = 1</li>
|
|
<li>Pick <a class="el" href="classstk_1_1Filter.html" title="STK abstract filter class.">Filter</a> Pole = 128</li>
|
|
</ul>
|
|
<p>by Gary P. Scavone, 2012. </p>
|
|
<hr/><h2>Member Function Documentation</h2>
|
|
<a class="anchor" id="a95c212c2d6a72ee93c2000f0308df9cc"></a><!-- doxytag: member="stk::Guitar::setBodyFile" ref="a95c212c2d6a72ee93c2000f0308df9cc" args="(std::string bodyfile="")" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::Guitar::setBodyFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>bodyfile</em> = <code>""</code></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Set the string excitation, using either a soundfile or computed noise. </p>
|
|
<p>If no argument is provided, the std::string is empty, or an error occurs reading the file data, an enveloped noise signal will be generated for use as the pluck excitation. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a4a2098002e20c5aac3927e2c080c64ca"></a><!-- doxytag: member="stk::Guitar::setPluckPosition" ref="a4a2098002e20c5aac3927e2c080c64ca" args="(StkFloat position, int string=-1)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::Guitar::setPluckPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">StkFloat </td>
|
|
<td class="paramname"> <em>position</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>string</em> = <code>-1</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Set the pluck position for one or all strings. </p>
|
|
<p>If the <code>string</code> argument is < 0, the pluck position is set for all strings. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="adc1d5eadc46cbcdb8ddcf8b0e4aae9db"></a><!-- doxytag: member="stk::Guitar::setLoopGain" ref="adc1d5eadc46cbcdb8ddcf8b0e4aae9db" args="(StkFloat gain, int string=-1)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::Guitar::setLoopGain </td>
|
|
<td>(</td>
|
|
<td class="paramtype">StkFloat </td>
|
|
<td class="paramname"> <em>gain</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>string</em> = <code>-1</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Set the loop gain for one or all strings. </p>
|
|
<p>If the <code>string</code> argument is < 0, the loop gain is set for all strings. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a9dec744a074dba5c869b2aec1198ada7"></a><!-- doxytag: member="stk::Guitar::noteOn" ref="a9dec744a074dba5c869b2aec1198ada7" args="(StkFloat frequency, StkFloat amplitude, unsigned int string=0)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::Guitar::noteOn </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>amplitude</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>string</em> = <code>0</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Start a note with the given frequency and amplitude. </p>
|
|
<p>If the <code>amplitude</code> parameter is less than 0.2, the string will be undamped but it will not be "plucked." </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ae9900d35d4f5ae7a67dfcc62a1175aba"></a><!-- doxytag: member="stk::Guitar::controlChange" ref="ae9900d35d4f5ae7a67dfcc62a1175aba" args="(int number, StkFloat value, int string=-1)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::Guitar::controlChange </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>number</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">StkFloat </td>
|
|
<td class="paramname"> <em>value</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>string</em> = <code>-1</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Perform the control change specified by <em>number</em> and <em>value</em> (0.0 - 128.0). </p>
|
|
<p>If the <code>string</code> argument is < 0, then the control change is applied to all strings (if appropriate). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="aa8a2447a813f400c92ab2333c2d8a125"></a><!-- doxytag: member="stk::Guitar::tick" ref="aa8a2447a813f400c92ab2333c2d8a125" 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::Guitar::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>Take a channel of the <code>iFrames</code> object as inputs to the class and write outputs to the <code>oFrames</code> object. </p>
|
|
<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. </p>
|
|
|
|
<p><div class="fragment"><pre class="fragment"><a name="l00163"></a>00163 {
|
|
<a name="l00164"></a>00164 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
|
<a name="l00165"></a>00165 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel >= frames.channels() ) {
|
|
<a name="l00166"></a>00166 oStream_ << <span class="stringliteral">"Guitar::tick(): channel and StkFrames arguments are incompatible!"</span>;
|
|
<a name="l00167"></a>00167 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
|
|
<a name="l00168"></a>00168 }
|
|
<a name="l00169"></a>00169 <span class="preprocessor">#endif</span>
|
|
<a name="l00170"></a>00170 <span class="preprocessor"></span>
|
|
<a name="l00171"></a>00171 StkFloat *samples = &frames[channel];
|
|
<a name="l00172"></a>00172 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> hop = frames.channels();
|
|
<a name="l00173"></a>00173 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<frames.frames(); i++, samples += hop )
|
|
<a name="l00174"></a>00174 *samples = <a class="code" href="classstk_1_1Guitar.html#a47223c1ef411141ae04b0971497b5fb8" title="Take an optional input sample and compute one output sample.">tick</a>( *samples );
|
|
<a name="l00175"></a>00175
|
|
<a name="l00176"></a>00176 <span class="keywordflow">return</span> frames;
|
|
<a name="l00177"></a>00177 }
|
|
</pre></div></p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a8ed813db2c23a9893e7d329528d659e8"></a><!-- doxytag: member="stk::Guitar::tick" ref="a8ed813db2c23a9893e7d329528d659e8" 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::Guitar::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 effect and write outputs to the <code>oFrames</code> object. </p>
|
|
<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. </p>
|
|
|
|
<p><div class="fragment"><pre class="fragment"><a name="l00180"></a>00180 {
|
|
<a name="l00181"></a>00181 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
|
<a name="l00182"></a>00182 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( iChannel >= iFrames.channels() || oChannel >= oFrames.channels() ) {
|
|
<a name="l00183"></a>00183 oStream_ << <span class="stringliteral">"Guitar::tick(): channel and StkFrames arguments are incompatible!"</span>;
|
|
<a name="l00184"></a>00184 <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff" title="Static function for error reporting and handling using c-strings.">handleError</a>( StkError::FUNCTION_ARGUMENT );
|
|
<a name="l00185"></a>00185 }
|
|
<a name="l00186"></a>00186 <span class="preprocessor">#endif</span>
|
|
<a name="l00187"></a>00187 <span class="preprocessor"></span>
|
|
<a name="l00188"></a>00188 StkFloat *iSamples = &iFrames[iChannel];
|
|
<a name="l00189"></a>00189 StkFloat *oSamples = &oFrames[oChannel];
|
|
<a name="l00190"></a>00190 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iHop = iFrames.channels(), oHop = oFrames.channels();
|
|
<a name="l00191"></a>00191 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<iFrames.frames(); i++, iSamples += iHop, oSamples += oHop )
|
|
<a name="l00192"></a>00192 *oSamples = <a class="code" href="classstk_1_1Guitar.html#a47223c1ef411141ae04b0971497b5fb8" title="Take an optional input sample and compute one output sample.">tick</a>( *iSamples );
|
|
<a name="l00193"></a>00193
|
|
<a name="l00194"></a>00194 <span class="keywordflow">return</span> iFrames;
|
|
<a name="l00195"></a>00195 }
|
|
</pre></div></p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="Guitar_8h_source.html">Guitar.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>©1995-2012 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|