mirror of
https://github.com/thestk/stk
synced 2026-01-19 23:51:51 +00:00
Release 4.4.2 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
c37de52787
commit
7fcf920d3e
@@ -8,16 +8,20 @@
|
||||
<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.5.8 -->
|
||||
<!-- Generated by Doxygen 1.6.2 -->
|
||||
<div class="contents">
|
||||
<h1><a class="anchor" name="multichannel">Multi-Channel I/O </a></h1>The ToolKit <a class="el" href="classstk_1_1WvIn.html" title="STK audio input abstract base class.">stk::WvIn</a> and <a class="el" href="classstk_1_1WvOut.html" title="STK audio output abstract base class.">stk::WvOut</a> classes (and their subclasses) support multi-channel audio data input and output. Several other abstract base classes, such as <a class="el" href="classstk_1_1Instrmnt.html" title="STK instrument abstract base class.">stk::Instrmnt</a>, <a class="el" href="classstk_1_1Generator.html" title="STK abstract unit generator parent class.">stk::Generator</a>, and <a class="el" href="classstk_1_1Effect.html" title="STK abstract effects parent class.">stk::Effect</a>, also support multi-channel computations though not all of their subclasses produce or take multi-channel data. A set of interleaved audio samples representing a single time "slice" is referred to as a <em>sample frame</em>. At a sample rate of 44.1 kHz, a four-channel audio stream will have 44100 sample frames per second and a total of 176400 individual samples per second.<p>
|
||||
Most STK classes process single-sample data streams via their <code>tick()</code> function. For classes supporting multi-channel data, one must distinguish the <code>tick()</code> functions taking or producing single <code>StkFloat</code> arguments from those taking <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">stk::StkFrames</a>& arguments. If a single-sample version of the <code>tick()</code> function is called for these classes, a full sample frame is computed but only a single value is either input and/or output. For example, if the single-sample <code>tick()</code> function is called for subclasses of WvOut, the sample argument is written to all channels in the one computed frame. For classes returning values, an optional <code>channel</code> argument specifies which channel value is returned from the computed frame (the default is always channel 0). To input and/or output multichannel data to these classes, the overloaded <code>tick()</code> functions taking StkFrames reference arguments should be used.<p>
|
||||
Multi-channel support for realtime audio input and output is dependent on the audio device(s) available on your system.<p>
|
||||
The following example demonstrates the use of the <a class="el" href="classstk_1_1FileWvOut.html" title="STK audio file output class.">stk::FileWvOut</a> class for creating a four channel, 16-bit AIFF formatted audio file. We will use four sinewaves of different frequencies for the first two seconds and then a single sinewave for the last two seconds.<p>
|
||||
|
||||
|
||||
<h1><a class="anchor" id="multichannel">Multi-Channel I/O </a></h1><p>The ToolKit <a class="el" href="classstk_1_1WvIn.html" title="STK audio input abstract base class.">stk::WvIn</a> and <a class="el" href="classstk_1_1WvOut.html" title="STK audio output abstract base class.">stk::WvOut</a> classes (and their subclasses) support multi-channel audio data input and output. Several other abstract base classes, such as <a class="el" href="classstk_1_1Instrmnt.html" title="STK instrument abstract base class.">stk::Instrmnt</a>, <a class="el" href="classstk_1_1Generator.html" title="STK abstract unit generator parent class.">stk::Generator</a>, and <a class="el" href="classstk_1_1Effect.html" title="STK abstract effects parent class.">stk::Effect</a>, also support multi-channel computations though not all of their subclasses produce or take multi-channel data. A set of interleaved audio samples representing a single time "slice" is referred to as a <em>sample frame</em>. At a sample rate of 44.1 kHz, a four-channel audio stream will have 44100 sample frames per second and a total of 176400 individual samples per second.</p>
|
||||
<p>Most STK classes process single-sample data streams via their <code>tick()</code> function. For classes supporting multi-channel data, one must distinguish the <code>tick()</code> functions taking or producing single <code>StkFloat</code> arguments from those taking <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">stk::StkFrames</a>& arguments. If a single-sample version of the <code>tick()</code> function is called for these classes, a full sample frame is computed but only a single value is either input and/or output. For example, if the single-sample <code>tick()</code> function is called for subclasses of WvOut, the sample argument is written to all channels in the one computed frame. For classes returning values, an optional <code>channel</code> argument specifies which channel value is returned from the computed frame (the default is always channel 0). To input and/or output multichannel data to these classes, the overloaded <code>tick()</code> functions taking StkFrames reference arguments should be used.</p>
|
||||
<p>Multi-channel support for realtime audio input and output is dependent on the audio device(s) available on your system.</p>
|
||||
<p>The following example demonstrates the use of the <a class="el" href="classstk_1_1FileWvOut.html" title="STK audio file output class.">stk::FileWvOut</a> class for creating a four channel, 16-bit AIFF formatted audio file. We will use four sinewaves of different frequencies for the first two seconds and then a single sinewave for the last two seconds.</p>
|
||||
<div class="fragment"><pre class="fragment"><span class="comment">// foursine.cpp STK tutorial program</span>
|
||||
|
||||
<span class="preprocessor">#include "SineWave.h"</span>
|
||||
<span class="preprocessor">#include "FileWvOut.h"</span>
|
||||
<span class="preprocessor">#include "SineWave.h"</span>
|
||||
<span class="preprocessor">#include "FileWvOut.h"</span>
|
||||
<span class="preprocessor">#include <cstdlib></span>
|
||||
|
||||
<span class="keyword">using namespace </span>stk;
|
||||
|
||||
<span class="keywordtype">int</span> main()
|
||||
@@ -35,7 +39,7 @@ The following example demonstrates the use of the <a class="el" href="classstk_1
|
||||
|
||||
<span class="comment">// Define and open a 16-bit, four-channel AIFF formatted output file</span>
|
||||
<span class="keywordflow">try</span> {
|
||||
output.openFile( <span class="stringliteral">"foursine.aif"</span>, 4, FileWrite::FILE_AIF, Stk::STK_SINT16 );
|
||||
output.openFile( <span class="stringliteral">"foursine.aif"</span>, 4, FileWrite::FILE_AIF, Stk::STK_SINT16 );
|
||||
}
|
||||
<span class="keywordflow">catch</span> (StkError &) {
|
||||
exit( 1 );
|
||||
@@ -55,13 +59,13 @@ The following example demonstrates the use of the <a class="el" href="classstk_1
|
||||
|
||||
<span class="keywordflow">return</span> 0;
|
||||
}
|
||||
</pre></div><p>
|
||||
[<a href="tutorial.html">Main tutorial page</a>] [<a href="polyvoices.html">Next tutorial</a>] </div>
|
||||
</pre></div><p>[<a href="tutorial.html">Main tutorial page</a>] [<a href="polyvoices.html">Next tutorial</a>] </p>
|
||||
</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-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
<tr><td>©1995-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
</BODY>
|
||||
|
||||
Reference in New Issue
Block a user