mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
73 lines
5.5 KiB
Plaintext
73 lines
5.5 KiB
Plaintext
/*! \page faq Frequently Asked Questions
|
|
|
|
- \ref license
|
|
- \ref filerate
|
|
- \ref computesample
|
|
- \ref tickframe
|
|
- \ref endianness
|
|
- \ref xwindows
|
|
|
|
\section license Does STK have a license?
|
|
|
|
Yes, we finally made something official for release 4.3.0. It is listed in the Stk class and a few other places in the distribution, but I'll repeat it here for clarity:
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
a copy of this software and associated documentation files (the
|
|
"Software"), to deal in the Software without restriction, including
|
|
without limitation the rights to use, copy, modify, merge, publish,
|
|
distribute, sublicense, and/or sell copies of the Software, and to
|
|
permit persons to whom the Software is furnished to do so, subject to
|
|
the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be
|
|
included in all copies or substantial portions of the Software.
|
|
|
|
Any person wishing to distribute modifications to the Software is
|
|
asked to send the modifications to the original developer so that they
|
|
can be incorporated into the canonical version. This is, however, not
|
|
a binding provision of this license.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
\section filerate Why is my file sample rate wrong?
|
|
|
|
When the FileWvIn class loads a soundfile, it automatically sets its internal read increment based on the soundfile rate and the current STK sample rate. For example, if the current STK sample rate is 44100 Hz and the soundfile rate is 22050 Hz, the read increment, or rate, will be set to 0.5 and the file will be interpolated so that is sounds correct at 44100 Hz. For most cases, this works fine. However, consider the following example:
|
|
|
|
\code
|
|
FileWvIn input( "infile" ); // read an input soundfile
|
|
StkFloat sampleRate = input.getFileRate();
|
|
Stk::setSampleRate( sampleRate ); // set a new STK sample rate based on the file rate
|
|
\endcode
|
|
|
|
With version 4.3 and higher of STK, the FileWvIn class will be notified of a sample rate change and it will automatically adjust its read rate accordingly. Previous versions of STK did not perform this change and thus, the read rate could end up being incorrect. If you do not want FileWvIn to perform this automatic adjustment, you can call the \c ignoreSampleRateChange() function for a given class instance.
|
|
|
|
\section tickframe What is the difference between the tick() and tickFrame() functions?
|
|
|
|
\e tickFrame() functions are provided in classes that can handle multi-channel data. A <i>sample frame</i> of audio data represents a single "slice" in time across many audio channels. The WvIn and WvOut subclasses are the primary classes in STK that currently implement the \e tickFrame() functions. \e tick() functions are used for monophonic classes. Note, however, that the WvIn and WvOut classes also implement \e tick() functions though their behavior is dependent on the number of channels you are working with. For example, if using the FileWvIn class with a monophonic soundfile, then there is no difference between the \e tick() and \e tickFrame() functions (aside from the format of their arguments). But if you have a multi-channel file open, then the single value returned from the tick() function is an average of all the samples in the multi-channel sample frame.
|
|
|
|
\section computesample Hey, why was the tick() function replaced by computeSample() in various STK classes?
|
|
|
|
C++ doesn't like overloaded virtual functions. All STK classes that implement a single-sample \e tick() function also provide an overloaded version that takes an StkFrames argument (for vectorized computations). Further, many STK classes inherit from abstract base classes (Instrmnt, Generator, ...) and it is most convenient to define functionality common to all subclasses (like the \e tick() function that takes an StkFrames argument) in only the base class. So, to get around the overloaded virtual function problem, STK now uses the \e computeSample() function as a non-overloaded virtual function that is implemented in all subclasses (it essentially replaces the \e tick() function). Note, however, that the overloaded \e tick() functions are still available to the user ... they are implemented in the base classes.
|
|
|
|
\section endianness Why does the sound I generated with STK sound like *&#@!?
|
|
|
|
If the resultant sound generated by an STK program sounds like noise (and you're not doing an MLS experiment), the problem is likely related to the byte "endianness" of your computer. By default, STK assumes "big endian" byte order. If you are working with STK classes on a PC (Windows or Linux), you \e must define the <TT>__LITTLE_ENDIAN__</TT> preprocessor definition \e before compiling. If after reading this you realize you need to make this change, do not forget to recompile all STK classes from scratch.
|
|
|
|
\section xwindows Why do I get a Tk display error message?
|
|
|
|
The following error will be printed to your terminal window if you attempt to start an STK tcl/tk interface without the X Server first running:
|
|
|
|
\code
|
|
Application initialization failed: this isn't a Tk applicationcouldn't connect to display ":0.0"
|
|
\endcode
|
|
|
|
Simply start your X server and then try the command again.
|
|
|
|
*/
|