mirror of
https://github.com/thestk/stk
synced 2026-04-19 22:16:54 +00:00
Release 4.4.3 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
cfdfe7736a
commit
f13d5bb3cd
@@ -81,7 +81,7 @@ const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & <
|
||||
<p>This class can be used to manage a group of STK instrument classes. Individual voices can be controlled via unique note tags. Instrument groups can be controlled by group number.</p>
|
||||
<p>A previously constructed STK instrument class is linked with a voice manager using the <a class="el" href="classstk_1_1Voicer.html#aff9fc9304ef6ae9f7aa1e15611728b8c" title="Add an instrument with an optional group number to the voice manager.">addInstrument()</a> function. An optional group number argument can be specified to the <a class="el" href="classstk_1_1Voicer.html#aff9fc9304ef6ae9f7aa1e15611728b8c" title="Add an instrument with an optional group number to the voice manager.">addInstrument()</a> function as well (default group = 0). The voice manager does not delete any instrument instances ... it is the responsibility of the user to allocate and deallocate all instruments.</p>
|
||||
<p>The <a class="el" href="classstk_1_1Voicer.html#a3e504b3a6b896772b0f94a12faf0ee70" title="Mix one sample frame of all sounding voices and return the specified channel value...">tick()</a> function returns the mix of all sounding voices. Each noteOn returns a unique tag (credits to the NeXT MusicKit), so you can send control changes to specific voices within an ensemble. Alternately, control changes can be sent to all voices in a given group.</p>
|
||||
<p>by Perry R. Cook and Gary P. Scavone, 1995 - 2010. </p>
|
||||
<p>by Perry R. Cook and Gary P. Scavone, 1995-2011. </p>
|
||||
<hr/><h2>Member Function Documentation</h2>
|
||||
<a class="anchor" id="aff9fc9304ef6ae9f7aa1e15611728b8c"></a><!-- doxytag: member="stk::Voicer::addInstrument" ref="aff9fc9304ef6ae9f7aa1e15611728b8c" args="(Instrmnt *instrument, int group=0)" -->
|
||||
<div class="memitem">
|
||||
@@ -316,6 +316,18 @@ const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & <
|
||||
<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_1Voicer.html#a35230ae97772ae581fb9658a5f4d57b6" title="Return the current number of output channels.">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. </p>
|
||||
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classstk_1_1Voicer.html#a50caec57c6a566e4836181774adf5e7b" title="Return an StkFrames reference to the last output sample frame.">lastFrame()</a> </dd></dl>
|
||||
|
||||
<p><div class="fragment"><pre class="fragment"><a name="l00166"></a>00166 {
|
||||
<a name="l00167"></a>00167 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
||||
<a name="l00168"></a>00168 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel >= lastFrame_.channels() ) {
|
||||
<a name="l00169"></a>00169 oStream_ << <span class="stringliteral">"Voicer::lastOut(): channel argument is invalid!"</span>;
|
||||
<a name="l00170"></a>00170 <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="l00171"></a>00171 }
|
||||
<a name="l00172"></a>00172 <span class="preprocessor">#endif</span>
|
||||
<a name="l00173"></a>00173 <span class="preprocessor"></span>
|
||||
<a name="l00174"></a>00174 <span class="keywordflow">return</span> lastFrame_[channel];
|
||||
<a name="l00175"></a>00175 }
|
||||
</pre></div></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a3e504b3a6b896772b0f94a12faf0ee70"></a><!-- doxytag: member="stk::Voicer::tick" ref="a3e504b3a6b896772b0f94a12faf0ee70" args="(unsigned int channel=0)" -->
|
||||
@@ -337,6 +349,24 @@ const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & <
|
||||
<p>Mix one sample frame of all sounding voices and return the specified <code>channel</code> value. </p>
|
||||
<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_1Voicer.html#a35230ae97772ae581fb9658a5f4d57b6" title="Return the current number of output channels.">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. </p>
|
||||
|
||||
<p><div class="fragment"><pre class="fragment"><a name="l00179"></a>00179 {
|
||||
<a name="l00180"></a>00180 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j;
|
||||
<a name="l00181"></a>00181 <span class="keywordflow">for</span> ( j=0; j<lastFrame_.channels(); j++ ) lastFrame_[j] = 0.0;
|
||||
<a name="l00182"></a>00182 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<voices_.size(); i++ ) {
|
||||
<a name="l00183"></a>00183 <span class="keywordflow">if</span> ( voices_[i].sounding != 0 ) {
|
||||
<a name="l00184"></a>00184 voices_[i].instrument->tick();
|
||||
<a name="l00185"></a>00185 <span class="keywordflow">for</span> ( j=0; j<voices_[i].instrument->channelsOut(); j++ ) lastFrame_[j] += voices_[i].instrument->lastOut( j );
|
||||
<a name="l00186"></a>00186 }
|
||||
<a name="l00187"></a>00187 <span class="keywordflow">if</span> ( voices_[i].sounding < 0 )
|
||||
<a name="l00188"></a>00188 voices_[i].sounding++;
|
||||
<a name="l00189"></a>00189 <span class="keywordflow">if</span> ( voices_[i].sounding == 0 )
|
||||
<a name="l00190"></a>00190 voices_[i].noteNumber = -1;
|
||||
<a name="l00191"></a>00191 }
|
||||
<a name="l00192"></a>00192
|
||||
<a name="l00193"></a>00193 <span class="keywordflow">return</span> lastFrame_[channel];
|
||||
<a name="l00194"></a>00194 }
|
||||
</pre></div></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="a3fd795b0fce684c470484936ef39aa16"></a><!-- doxytag: member="stk::Voicer::tick" ref="a3fd795b0fce684c470484936ef39aa16" args="(StkFrames &frames, unsigned int channel=0)" -->
|
||||
@@ -367,6 +397,27 @@ const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & <
|
||||
<p>Fill the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument with computed frames and return the same reference. </p>
|
||||
<p>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 must equal the number of channels in the file data. However, this is only checked if _STK_DEBUG_ is defined during compilation, in which case an incompatibility will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception. If no file data is loaded, the function does nothing (a warning will be issued if _STK_DEBUG_ is defined during compilation). </p>
|
||||
|
||||
<p><div class="fragment"><pre class="fragment"><a name="l00197"></a>00197 {
|
||||
<a name="l00198"></a>00198 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nChannels = lastFrame_.channels();
|
||||
<a name="l00199"></a>00199 <span class="preprocessor">#if defined(_STK_DEBUG_)</span>
|
||||
<a name="l00200"></a>00200 <span class="preprocessor"></span> <span class="keywordflow">if</span> ( channel > frames.channels() - nChannels ) {
|
||||
<a name="l00201"></a>00201 oStream_ << <span class="stringliteral">"Voicer::tick(): channel and StkFrames arguments are incompatible!"</span>;
|
||||
<a name="l00202"></a>00202 <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="l00203"></a>00203 }
|
||||
<a name="l00204"></a>00204 <span class="preprocessor">#endif</span>
|
||||
<a name="l00205"></a>00205 <span class="preprocessor"></span>
|
||||
<a name="l00206"></a>00206 StkFloat *samples = &frames[channel];
|
||||
<a name="l00207"></a>00207 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j, hop = frames.channels() - nChannels;
|
||||
<a name="l00208"></a>00208 <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="l00209"></a>00209 <a class="code" href="classstk_1_1Voicer.html#a3e504b3a6b896772b0f94a12faf0ee70" title="Mix one sample frame of all sounding voices and return the specified channel value...">tick</a>();
|
||||
<a name="l00210"></a>00210 <span class="keywordflow">for</span> ( j=0; j<nChannels; j++ )
|
||||
<a name="l00211"></a>00211 *samples++ = lastFrame_[j];
|
||||
<a name="l00212"></a>00212 }
|
||||
<a name="l00213"></a>00213
|
||||
<a name="l00214"></a>00214 <span class="keywordflow">return</span> frames;
|
||||
<a name="l00215"></a>00215 }
|
||||
</pre></div></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this class was generated from the following file:<ul>
|
||||
@@ -377,7 +428,7 @@ const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & <
|
||||
|
||||
<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-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995-2011 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user