The Synthesis ToolKit (STK) in C++
Introduction
The Synthesis ToolKit (STK) is a set of audio signal processing C++ classes and instruments for music synthesis. STK can be used for both realtime and non-realtime synthesis and provides a variety of input and output file formats. STK does not provide a refined graphical user interface. Rather, it serves primarily as a set of "tools" for C++ programmers to rapidly prototype audio algorithms.
STK currently runs with realtime support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, but should work with any standard C++ compiler.
- The STK Home Page
- The basic design goals of STK are:
- Cross-platform functionality
- Object-oriented design
- Ease of use
- User extensibility
- Realtime and non-realtime synthesis and control
- Open source C and C++ code
- The STK Class Structure
- Supported Input and Output Formats:
- SND soundfiles
- WAV soundfiles
- AIFF soundfiles
- RAW files (1 channel only)
- Matlab MAT-files
- Realtime audio (RtAudio)
- MIDI input (RtMidi)
Downloading, Unpacking, and Compiling the Source
- Download the revised release 3.2. NOTE: This contains all necessary updates and changes mentioned during the lecture.
- To unpack the tar, gzipped source, type:
tar -xzf workshop-stk3.2.tar.gz
- Go to any project directory (syntmono, effects, ragamatic, examples) and type make to compile.
- There are a number of global parameters than can be specified in the file stk/include/Object.h, such as:
- Linux Sound API (OSS or ALSA 0.5) ... default = ALSA 0.5
- Sample Rate (SRATE) ... default = 22050 Hz
- Realtime Buffer Size (RT_BUFFER_SIZE) ... default = 256 sample frames
A Demo of the Projects
- Syntmono
- Effects
- Ragamatic
- Examples
Example Programs without Control Input
- moogy: an example program for "tooting" the Moog instrument
- playN: an example program for audio output
- recordN: an example program for audio input
- ioN: an example program for simultaneous audio input/output
- sineN: an example program demonstrating multichannel support
A Tutorial is Born (barely)
Control Message Format & Sources
- The SKINI control language
- SKINI scorefiles: an example
- Tcl/Tk GUIs:
- Test the STK Drum GUI by typing (from the syntmono project directory):
wish < tcl/TCLDrums.tcl
- Realtime SKINI messages should have a delta time value (second column) = -1.
- MD2SKINI: a realtime MIDI input to SKINI converter
Parsing Control Messages
- The Controller class can parse simultaneous:
- Piped SKINI input
- Socketed SKINI input
- MIDI input via soundcard (or from Midiator serial port interface ... Linux only)
- The Controller object is instantiated with an integer "input mask", determined by OR'ing the #defined values STK_PIPE, STK_SOCKET, and/or STK_MIDI. Piped input is always read.
- Scorefile input is distinguished by positive delta time values.
- Using the Controller class in syntmono
Suggested Lab Session Tasks
- Experiment with the examples from class
- Change the ioN program to use effects
- Bliss out with ragamatic