mirror of
https://github.com/thestk/stk
synced 2026-01-14 13:31:53 +00:00
106 lines
6.2 KiB
HTML
106 lines
6.2 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="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.3.4 -->
|
|
<h1>Voicer.h</h1><div class="fragment"><pre>00001 <span class="comment">/***************************************************/</span>
|
|
00030 <span class="comment">/***************************************************/</span>
|
|
00031
|
|
00032 <span class="preprocessor">#ifndef STK_VOICER_H</span>
|
|
00033 <span class="preprocessor"></span><span class="preprocessor">#define STK_VOICER_H</span>
|
|
00034 <span class="preprocessor"></span>
|
|
00035 <span class="preprocessor">#include "Instrmnt.h"</span>
|
|
00036 <span class="preprocessor">#include <vector></span>
|
|
00037
|
|
<a name="l00038"></a><a class="code" href="classVoicer.html">00038</a> <span class="keyword">class </span><a class="code" href="classVoicer.html">Voicer</a> : <span class="keyword">public</span> <a class="code" href="classStk.html">Stk</a>
|
|
00039 {
|
|
00040 <span class="keyword">public</span>:
|
|
00042 <a class="code" href="classVoicer.html#a0">Voicer</a>( StkFloat decayTime=0.2 );
|
|
00043
|
|
00045 <a class="code" href="classVoicer.html#a1">~Voicer</a>();
|
|
00046
|
|
00048
|
|
00052 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a2">addInstrument</a>( <a class="code" href="classInstrmnt.html">Instrmnt</a> *instrument, <span class="keywordtype">int</span> channel=0 );
|
|
00053
|
|
00055
|
|
00060 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a3">removeInstrument</a>( <a class="code" href="classInstrmnt.html">Instrmnt</a> *instrument );
|
|
00061
|
|
00063
|
|
00071 <span class="keywordtype">long</span> <a class="code" href="classVoicer.html#a4">noteOn</a>( StkFloat noteNumber, StkFloat amplitude, <span class="keywordtype">int</span> channel=0 );
|
|
00072
|
|
00074
|
|
00077 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a5">noteOff</a>( StkFloat noteNumber, StkFloat amplitude, <span class="keywordtype">int</span> channel=0 );
|
|
00078
|
|
00080
|
|
00083 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a5">noteOff</a>( <span class="keywordtype">long</span> tag, StkFloat amplitude );
|
|
00084
|
|
00086
|
|
00089 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a7">setFrequency</a>( StkFloat noteNumber, <span class="keywordtype">int</span> channel=0 );
|
|
00090
|
|
00092
|
|
00095 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a7">setFrequency</a>( <span class="keywordtype">long</span> tag, StkFloat noteNumber );
|
|
00096
|
|
00098 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a9">pitchBend</a>( StkFloat value, <span class="keywordtype">int</span> channel=0 );
|
|
00099
|
|
00101 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a9">pitchBend</a>( <span class="keywordtype">long</span> tag, StkFloat value );
|
|
00102
|
|
00104 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a11">controlChange</a>( <span class="keywordtype">int</span> number, StkFloat value, <span class="keywordtype">int</span> channel=0 );
|
|
00105
|
|
00107 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a11">controlChange</a>( <span class="keywordtype">long</span> tag, <span class="keywordtype">int</span> number, StkFloat value );
|
|
00108
|
|
00110 <span class="keywordtype">void</span> <a class="code" href="classVoicer.html#a13">silence</a>( <span class="keywordtype">void</span> );
|
|
00111
|
|
00113 StkFloat <a class="code" href="classVoicer.html#a14">tick</a>();
|
|
00114
|
|
00116 StkFloat *<a class="code" href="classVoicer.html#a14">tick</a>(StkFloat *vector, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> vectorSize);
|
|
00117
|
|
00119
|
|
00125 <span class="keyword">virtual</span> <a class="code" href="classStkFrames.html">StkFrames</a>& <a class="code" href="classVoicer.html#a14">tick</a>( <a class="code" href="classStkFrames.html">StkFrames</a>& frames, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 1 );
|
|
00126
|
|
00128 StkFloat <a class="code" href="classVoicer.html#a17">lastOut</a>() <span class="keyword">const</span>;
|
|
00129
|
|
00131 StkFloat <a class="code" href="classVoicer.html#a18">lastOutLeft</a>() <span class="keyword">const</span>;
|
|
00132
|
|
00134 StkFloat <a class="code" href="classVoicer.html#a19">lastOutRight</a>() <span class="keyword">const</span>;
|
|
00135
|
|
00136 <span class="keyword">protected</span>:
|
|
00137
|
|
00138 <span class="keyword">struct </span>Voice {
|
|
00139 <a class="code" href="classInstrmnt.html">Instrmnt</a> *instrument;
|
|
00140 <span class="keywordtype">long</span> tag;
|
|
00141 StkFloat noteNumber;
|
|
00142 StkFloat frequency;
|
|
00143 <span class="keywordtype">int</span> sounding;
|
|
00144 <span class="keywordtype">int</span> channel;
|
|
00145
|
|
00146 <span class="comment">// Default constructor.</span>
|
|
00147 Voice()
|
|
00148 :instrument(0), tag(0), noteNumber(-1.0), frequency(0.0),
|
|
00149 sounding(0), channel(0) {}
|
|
00150 };
|
|
00151
|
|
00152 std::vector<Voice> voices_;
|
|
00153 <span class="keywordtype">long</span> tags_;
|
|
00154 <span class="keywordtype">int</span> muteTime_;
|
|
00155 StkFloat lastOutput_;
|
|
00156 StkFloat lastOutputLeft_;
|
|
00157 StkFloat lastOutputRight_;
|
|
00158 };
|
|
00159
|
|
00160 <span class="preprocessor">#endif</span>
|
|
</pre></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-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|