1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
|
<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_1Flute.html">Flute</a>
</div>
<div class="contents">
<h1>stk::Flute Class Reference</h1><!-- doxytag: class="stk::Flute" --><!-- doxytag: inherits="stk::Instrmnt" -->
<p>STK flute physical model class.
<a href="#_details">More...</a></p>
<p><code>#include <<a class="el" href="Flute_8h_source.html">Flute.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for stk::Flute:</div>
<div class="dynsection">
<div class="center">
<img src="classstk_1_1Flute.png" usemap="#stk::Flute_map" alt=""/>
<map id="stk::Flute_map" name="stk::Flute_map">
<area href="classstk_1_1Instrmnt.html" alt="stk::Instrmnt" shape="rect" coords="0,56,76,80"/>
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,76,24"/>
</map>
</div>
</div>
<p><a href="classstk_1_1Flute-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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a9769eef3340651acc31b4997e9985e57">Flute</a> (StkFloat lowestFrequency)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class constructor, taking the lowest desired playing frequency. <a href="#a9769eef3340651acc31b4997e9985e57"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a76120aedfc0bab94416917d173f8a74e"></a><!-- doxytag: member="stk::Flute::~Flute" ref="a76120aedfc0bab94416917d173f8a74e" args="(void)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a76120aedfc0bab94416917d173f8a74e">~Flute</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4554fc4feffd469b83d02dd4e5471ffa"></a><!-- doxytag: member="stk::Flute::clear" ref="a4554fc4feffd469b83d02dd4e5471ffa" args="(void)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a4554fc4feffd469b83d02dd4e5471ffa">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"><a class="anchor" id="aea66780681552de9d12af6bb91f297da"></a><!-- doxytag: member="stk::Flute::setFrequency" ref="aea66780681552de9d12af6bb91f297da" args="(StkFloat frequency)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#aea66780681552de9d12af6bb91f297da">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" align="right" valign="top"><a class="anchor" id="a0732403c66b3667f5f6a8c80e90046e0"></a><!-- doxytag: member="stk::Flute::setJetReflection" ref="a0732403c66b3667f5f6a8c80e90046e0" args="(StkFloat coefficient)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a0732403c66b3667f5f6a8c80e90046e0">setJetReflection</a> (StkFloat coefficient)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the reflection coefficient for the jet delay (-1.0 - 1.0). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c0ef95a3170dafde08b65ee47102969"></a><!-- doxytag: member="stk::Flute::setEndReflection" ref="a7c0ef95a3170dafde08b65ee47102969" args="(StkFloat coefficient)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a7c0ef95a3170dafde08b65ee47102969">setEndReflection</a> (StkFloat coefficient)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the reflection coefficient for the air column delay (-1.0 - 1.0). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad37a862df945987f91e3164813ce911b"></a><!-- doxytag: member="stk::Flute::setJetDelay" ref="ad37a862df945987f91e3164813ce911b" args="(StkFloat aRatio)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#ad37a862df945987f91e3164813ce911b">setJetDelay</a> (StkFloat aRatio)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the length of the jet delay in terms of a ratio of jet delay to air column delay lengths. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33b58e80c6ebbd5bd45f90a7a1c6a025"></a><!-- doxytag: member="stk::Flute::startBlowing" ref="a33b58e80c6ebbd5bd45f90a7a1c6a025" args="(StkFloat amplitude, StkFloat rate)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a33b58e80c6ebbd5bd45f90a7a1c6a025">startBlowing</a> (StkFloat amplitude, StkFloat rate)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply breath velocity to instrument with given amplitude and rate of increase. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a65b8e74b1a99bc8bada4e80ebd512058"></a><!-- doxytag: member="stk::Flute::stopBlowing" ref="a65b8e74b1a99bc8bada4e80ebd512058" args="(StkFloat rate)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a65b8e74b1a99bc8bada4e80ebd512058">stopBlowing</a> (StkFloat rate)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decrease breath velocity with given rate of decrease. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af76a46645fd6ed5d3c15dc4bcde3d928"></a><!-- doxytag: member="stk::Flute::noteOn" ref="af76a46645fd6ed5d3c15dc4bcde3d928" args="(StkFloat frequency, StkFloat amplitude)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#af76a46645fd6ed5d3c15dc4bcde3d928">noteOn</a> (StkFloat frequency, StkFloat amplitude)</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" align="right" valign="top"><a class="anchor" id="ae371e0d2366ef9fae8d12898204e7b31"></a><!-- doxytag: member="stk::Flute::noteOff" ref="ae371e0d2366ef9fae8d12898204e7b31" args="(StkFloat amplitude)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#ae371e0d2366ef9fae8d12898204e7b31">noteOff</a> (StkFloat amplitude)</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"><a class="anchor" id="a968b3799338e39df35dcf94fe7ee90a2"></a><!-- doxytag: member="stk::Flute::controlChange" ref="a968b3799338e39df35dcf94fe7ee90a2" args="(int number, StkFloat value)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#a968b3799338e39df35dcf94fe7ee90a2">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" align="right" valign="top"><a class="anchor" id="ab8f307f9a26ef2756ec4c0ea05f3acbe"></a><!-- doxytag: member="stk::Flute::tick" ref="ab8f307f9a26ef2756ec4c0ea05f3acbe" args="(unsigned int channel=0)" -->
StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1Flute.html#ab8f307f9a26ef2756ec4c0ea05f3acbe">tick</a> (unsigned int channel=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute and return 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_1Flute.html#a86640ddfacea6fd9385bc4e197fe1a28">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 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="#a86640ddfacea6fd9385bc4e197fe1a28"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>STK flute physical model class. </p>
<p>This class implements a simple flute physical model, as discussed by Karjalainen, Smith, Waryznyk, etc. The jet model uses a polynomial, a la Cook.</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>Jet <a class="el" href="classstk_1_1Delay.html" title="STK non-interpolating delay line class.">Delay</a> = 2</li>
<li><a class="el" href="classstk_1_1Noise.html" title="STK noise generator.">Noise</a> Gain = 4</li>
<li>Vibrato Frequency = 11</li>
<li>Vibrato Gain = 1</li>
<li>Breath Pressure = 128</li>
</ul>
<p>by Perry R. Cook and Gary P. Scavone, 1995-2012. </p>
<hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="a9769eef3340651acc31b4997e9985e57"></a><!-- doxytag: member="stk::Flute::Flute" ref="a9769eef3340651acc31b4997e9985e57" args="(StkFloat lowestFrequency)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">stk::Flute::Flute </td>
<td>(</td>
<td class="paramtype">StkFloat </td>
<td class="paramname"> <em>lowestFrequency</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Class constructor, taking the lowest desired playing frequency. </p>
<p>An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if the rawwave path is incorrectly set. </p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a86640ddfacea6fd9385bc4e197fe1a28"></a><!-- doxytag: member="stk::Flute::tick" ref="a86640ddfacea6fd9385bc4e197fe1a28" 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::Flute::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, 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>
<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>
<p>Implements <a class="el" href="classstk_1_1Instrmnt.html#a34c6733ca145763462d9e44ae3c772b6">stk::Instrmnt</a>.</p>
<p><div class="fragment"><pre class="fragment"><a name="l00138"></a>00138 {
<a name="l00139"></a>00139 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nChannels = lastFrame_.channels();
<a name="l00140"></a>00140 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel > frames.channels() - nChannels ) {
<a name="l00142"></a>00142 oStream_ << <span class="stringliteral">"Flute::tick(): channel and StkFrames arguments are incompatible!"</span>;
<a name="l00143"></a>00143 <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="l00144"></a>00144 }
<a name="l00145"></a>00145 <span class="preprocessor">#endif</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span>
<a name="l00147"></a>00147 StkFloat *samples = &frames[channel];
<a name="l00148"></a>00148 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j, hop = frames.channels() - nChannels;
<a name="l00149"></a>00149 <span class="keywordflow">if</span> ( nChannels == 1 ) {
<a name="l00150"></a>00150 <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="l00151"></a>00151 *samples++ = <a class="code" href="classstk_1_1Flute.html#ab8f307f9a26ef2756ec4c0ea05f3acbe" title="Compute and return one output sample.">tick</a>();
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153 <span class="keywordflow">else</span> {
<a name="l00154"></a>00154 <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="l00155"></a>00155 *samples++ = <a class="code" href="classstk_1_1Flute.html#ab8f307f9a26ef2756ec4c0ea05f3acbe" title="Compute and return one output sample.">tick</a>();
<a name="l00156"></a>00156 <span class="keywordflow">for</span> ( j=1; j<nChannels; j++ )
<a name="l00157"></a>00157 *samples++ = lastFrame_[j];
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160
<a name="l00161"></a>00161 <span class="keywordflow">return</span> frames;
<a name="l00162"></a>00162 }
</pre></div></p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Flute_8h_source.html">Flute.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>
|