Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
The Synthesis ToolKit is implemented in the C++ programming language. STK does not attempt to provide a new programming environment or paradigm but rather provides a set of objects that can be used within a normal C++ programming framework. Therefore, it is expected that users of STK will have some familiarity with C/C++ programming concepts. That said, the STK classes do have some particular idiosyncrasies that we will mention here. Starting with STK version 4.4, all STK classes except RtAudio and RtMidi are defined within the stk namespace.
Audio and control signals throughout STK use a floating-point data type,
StkFloat, the exact precision of which can be controlled via a typedef statement in Stk.h. By default, an StkFloat is a double-precision floating-point value. Thus, the ToolKit can use any normalization scheme desired. The base instruments and algorithms are implemented with a general audio sample dynamic maximum of +/-1.0.
In general, the computation and/or passing of values is performed on a "single-sample" basis. For example, the stk::Noise class outputs random floating-point numbers in the range +/-1.0. The computation of such values occurs in the stk::Noise::tick() function. The following program will generate 20 random floating-point (
StkFloat) values in the range -1.0 to +1.0:
Nearly all STK classes implement
tick() functions that take and/or return sample values. Within the
tick() function, the fundamental sample calculations are performed for a given class. Most STK classes consume/generate a single sample per operation and their
tick() method takes/returns each sample "by value". In addition, every class implementing a
tick() function also provides one or more overloaded
tick() functions that can be used for vectorized computations, as shown in the next example.
In this way, it might be possible to achieve improved processing efficiency using vectorized computations. The StkFrames class is a relatively new addition to the ToolKit to provide a general "mechanism" for handling and passing vectorized, multi-channel audio data. The StkFrames "type" provides functions to set and/or determine the number of audio channels and sample frames it holds. Further, the StkFrames class provides data interpolation and subscripting functionality by frame/channel values.
Nearly all STK classes inherit from the Stk abstract base class, which provides common functionality related to error reporting, sample rate control, and byte swapping. Several other base classes exist that roughly group many of the classes according to function as follows:
|The Synthesis ToolKit in C++ (STK)|
|©1995--2014 Perry R. Cook and Gary P. Scavone. All Rights Reserved.|