Files
stk/doc/html/Sampler_8h-source.html
2013-09-29 23:47:43 +02:00

76 lines
6.3 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.5.8 -->
<div class="navpath"><a class="el" href="dir_c28bfe24b93fcab464ea84f988cb34ef.html">include</a>
</div>
<div class="contents">
<h1>Sampler.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef STK_SAMPLER_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define STK_SAMPLER_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "Instrmnt.h"</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include "ADSR.h"</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include "FileLoop.h"</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include "OnePole.h"</span>
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="keyword">namespace </span>stk {
<a name="l00010"></a>00010
<a name="l00011"></a>00011 <span class="comment">/***************************************************/</span>
<a name="l00020"></a>00020 <span class="comment">/***************************************************/</span>
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="classstk_1_1Sampler.html">00022</a> <span class="keyword">class </span><a class="code" href="classstk_1_1Sampler.html" title="STK sampling synthesis abstract base class.">Sampler</a> : <span class="keyword">public</span> <a class="code" href="classstk_1_1Instrmnt.html" title="STK instrument abstract base class.">Instrmnt</a>
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024 <span class="keyword">public</span>:
<a name="l00026"></a>00026 <a class="code" href="classstk_1_1Sampler.html#97dbec0c39f3307560736173b4ede4e1" title="Default constructor.">Sampler</a>( <span class="keywordtype">void</span> );
<a name="l00027"></a>00027
<a name="l00029"></a>00029 <span class="keyword">virtual</span> <a class="code" href="classstk_1_1Sampler.html#9262914e25d4b9fd28a760621902fd74" title="Class destructor.">~Sampler</a>( <span class="keywordtype">void</span> );
<a name="l00030"></a>00030
<a name="l00032"></a>00032 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Sampler.html#6c80aad733f5e90dfa63d29c6a5c88ac" title="Reset and clear all internal state.">clear</a>( <span class="keywordtype">void</span> );
<a name="l00033"></a>00033
<a name="l00035"></a>00035 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Sampler.html#746eaab88793e3e8cdac9f6e59e00ca3" title="Set instrument parameters for a particular frequency.">setFrequency</a>( StkFloat frequency ) = 0;
<a name="l00036"></a>00036
<a name="l00038"></a>00038 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Sampler.html#d277ac455b3434eeb21d628d6c70141a" title="Initiate the envelopes with a key-on event and reset the attack waves.">keyOn</a>( <span class="keywordtype">void</span> );
<a name="l00039"></a>00039
<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Sampler.html#808aec2bf546b01e1ef53503c5a164e1" title="Signal a key-off event to the envelopes.">keyOff</a>( <span class="keywordtype">void</span> );
<a name="l00042"></a>00042
<a name="l00044"></a>00044 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Sampler.html#36c3ed945fb3e8db300b7ae01a4a4a76" title="Stop a note with the given amplitude (speed of decay).">noteOff</a>( StkFloat amplitude );
<a name="l00045"></a>00045
<a name="l00047"></a>00047 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Sampler.html#d9c0789f033978165226beb7c8133cc3" title="Perform the control change specified by number and value (0.0 - 128.0).">controlChange</a>( <span class="keywordtype">int</span> number, StkFloat value ) = 0;
<a name="l00048"></a>00048
<a name="l00050"></a>00050 <span class="keyword">virtual</span> StkFloat <a class="code" href="classstk_1_1Sampler.html#08502c96fa3e5f4c853c781354ed1965" title="Compute and return one output sample.">tick</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 ) = 0;
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keyword">protected</span>:
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <a class="code" href="classstk_1_1ADSR.html" title="STK ADSR envelope class.">ADSR</a> adsr_;
<a name="l00055"></a>00055 std::vector&lt;FileWvIn *&gt; attacks_;
<a name="l00056"></a>00056 std::vector&lt;FileLoop *&gt; loops_;
<a name="l00057"></a>00057 <a class="code" href="classstk_1_1OnePole.html" title="STK one-pole filter class.">OnePole</a> filter_;
<a name="l00058"></a>00058 StkFloat baseFrequency_;
<a name="l00059"></a>00059 std::vector&lt;StkFloat&gt; attackRatios_;
<a name="l00060"></a>00060 std::vector&lt;StkFloat&gt; loopRatios_;
<a name="l00061"></a>00061 StkFloat attackGain_;
<a name="l00062"></a>00062 StkFloat loopGain_;
<a name="l00063"></a>00063
<a name="l00064"></a>00064 };
<a name="l00065"></a>00065
<a name="l00066"></a>00066 } <span class="comment">// stk namespace</span>
<a name="l00067"></a>00067
<a name="l00068"></a>00068 <span class="preprocessor">#endif</span>
</pre></div></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-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>