Home

User Manual The Synthesis ToolKit in C++ - CCRMA

image

Contents

1. DelayA STK allpass interpolating delay line class DelayL STK linear interpolating delay line class Drummer STK drum sample player class Echo STK echo effect class o o o o Envelope STK envelope base class o o o Filter STK filter class 2 o ee eee Flute STK flute physical model class o FM STK abstract FM synthesis base class FMVoices STK singing FM synthesis instrument FormSwep STK sweepable formant filter class HevyMetl STK heavy metal FM synthesis instrument Instrmnt STK instrument abstract base class STK Compound Index JCRev John Chowning s reverberator class JetTabl STK jet table class 0 0 ooo o Mandolin STK mandolin instrument model class 67 Mesh2D Two dimensional rectilinear waveguide mesh class 69 Messager STK input control message parser 71 Modal STK resonance model instrument 73 ModalBar STK resonant bar instrument class Modulate STK periodic random modulator Moog STK moog like swept filter sampling synthesis class 79 Noise STK noise generator 2 0 0 0 00 0 000004 81 NRev CCRMA s NRev reverberator class 83 OnePole STK one pole filter class o oo
2. Two string mandolin physical model Rhodes like electric piano FM synthesis model rley Wurlitzer like electric piano FM synthesis model TubeBell synthesis model HevyMetl Distorted synthesizer FM synthesis model ercFlut Percussive flute like FM synthesis model ee Three Cheezy organ FM synthesis model oog Swept filter sampler MVoices Three formant FM voice synthesis Resonate through a filter Drummer Sampling synthesis BandedWG Banded waveguide meta object for bowed bars tibetan bowls etc Various stochastic event models of shaker instruments Various four resonance presets marimba vibraphone etc e Mesh2D Two dimensional rectilinear digital waveguide mesh y gt o al o lt 5 E g3 5 10 Demo Non Realtime Use See the information above with respect to compiling STK for non realtime use In non realtime mode it is assumed that input control messages are provided from a SKINI scorefile and that audio output is written to a soundfile snd wav aif mat raw A number of scorefiles are provided in the scores directory of the demo project Assuming a successful compilation of the demo program typing cat scores bookert ski demo BeeThree w myfile wav or on WindowsXX and or Unix demo BeeThree w myfile wav lt scores bookert ski from the demo directory will play the scorefile bookert ski using the ST K Bee Threelinstrument and write the resulting audio
3. The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 174 STK Class Documentation e virtual void tick const MY_FLOAT sample Output a single sample to all channels in a sample frame e virtual void tick const MY FLOAT vector unsigned int vectorSize Output each sample in vector to all channels in vectorSize sample frames e virtual void const MY_FLOAT xframeVector unsigned int frames 1 Output the frameVector of sample frames of the given length Static Public Attributes e const FILE TYPE WVOUT_RAW e const FILE TYPE WVOUT_ WAV e const FILE TYPE WVOUT_SND e const FILE TYPE WVOUT_ATEF e const FILE TYPE WVOUT_MAT 4 73 1 Detailed Description STK audio data output base class This class provides output support for various audio file formats It also serves as a base class for realtime streaming subclasses WvOut writes samples to an audio file It supports multi channel data in inter leaved format It is important to distinguish the tick methods which output single samples to all channels in a sample frame from the tickFramel method which takes a pointer to multi channel sample frame data WvOut currently supports WAV AIFF AIFC SND AU MAT file Matlab and STK RAW file formats Signed integer 8 16 and 32 bit and floating point 32 and 64 bit data types are supported STK RAW files use 16 bit integers by definition MAT files will always be w
4. e int port const char hostname Class constructor which creates a socket client connection to the specified host and port Sooke The class destructor closes the socket instance breaking any existing con nections e int int port const char hostname localhost Connect a socket client to the specified host and port and returns the resulting socket descriptor e void void Close this socket int socket void const Return the server client socket descriptor e int port void const Return the server client port number e int void The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 134 STK Class Documentation If this is a socket server extract the first pending connection request from the queue and create a new connection returning the descriptor for the accepted socket e int writeBuffer const void xbuffer long bufferSize int flags 0 Write a buffer over the socket connection Returns the number of bytes written or 1 if an error occurs e int void buffer long bufferSize int flags 0 Read a buffer from the socket connection up to length bufferSize Returns the number of bytes read or 1 if an error occurs Static Public Methods e void setBlocking int socket bool enable If enable false the socket is set to non blocking mode When first created sockets are by default in blocking mode void int socket Close the socket with
5. Input vectorSize samples to the filter and return an equal number of outputs in vector 4 69 1 Detailed Description STK two zero filter class This protected subclass implements a two zero digital filter A method is provided for creating a notch in the frequency response while maintaining a constant filter gain by Perry R Cook and Gary P Scavone 1995 2002 4 69 2 Member Function Documentation 4 69 2 1 void TwoZero setNotch MY FLOAT frequency MY FLOAT radius Sets the filter coefficients for a notch at frequency in Hz This method determines the filter coefficients corresponding to two complex conjugate zeros with the given frequency in Hz and radius from the z plane origin The coefficients are then normalized to produce a maximum filter gain of one independent of the filter gain parameter The resulting filter frequency response has a notch or anti resonance at the given frequency The closer the zeros are to the unit circle radius close to or equal to one the narrower the resulting notch width 4 69 2 2 void TwoZero setGain MY_FLOAT theGain virtual Set the filter gain The gain is applied at the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplemented from The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 69 TwoZero Class Reference 163 The documentation for this class was generated from t
6. The documentation for this class was generated from the following file e Reed Tabl h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 102 STK Class Documentation 4 45 Resonate Class Reference STK noise driven formant filter include lt Resonate h gt Inheritance diagram for Resonate Instrmnt Resonate Public Methods Kona Class constructor Resonata Class destructor e void clear Reset and clear all internal state e void MY FLOAT frequency MY FLOAT radius Set the filter for a resonance at the given frequency Hz and radius e void setNotch MY_FLOAT frequency MY_FLOAT radius Set the filter for a notch at the given frequency Hz and radius e void setEqualGainZeroes Set the filter zero coefficients for contant resonance gain e void Initiate the envelope with a key on event e void Signal a key off event to the envelope e void MY_FLOAT frequency MY_FLOAT amplitude The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 45 Resonate Class Reference 103 Start a note with the given frequency and amplitude e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY FLOAT tick Compute one output sample e virtual void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4
7. Control Change Numbers Modulator Index One 2 Crossfade of Outputs 4 LFO Speed 11 LFO Depth 1 e JADSR 2 amp 4 Target 128 The basic Chowning Stanford FM patent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Rhodey h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 108 STK Class Documentation 4 48 RtDuplex Class Reference STK realtime audio input output class include lt RtDuplex h gt Inheritance diagram for RtDuplex RtDuplex Public Methods int nChannels 1 MY_FLOAT sampleRate Stk sample Rate int device 0 int bufferFrames RT_BUFFER_SIZE int n Buffers 2 Default constructor Exa Class destructor void void Start the audio input output stream void void Stop the audio input output stream MY_FLOAT void const Return the average across the last output sample frame MY FLOAT const MY_FLOAT sample Output a single sample to all channels in a sample frame and return the average across one new input sample frame of data MY FLOAT MY FLOAT vector unsigned int vectorSize Output each sample in Y vector to all channels per frame and return averaged input sample frames of new
8. classes audio and MIDI and printout of devices when argument is invalid WvIn classes rewritten to support very big files incremental load from disk Changed WvIn WvOut classes to work with sample frame buffers e Fixed looping and negative rate calculations in WvIn classes e Fixed interpolation bug in RtWvIn The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 182 STK Page Documentation Windoze RtAudio code rewritten thank Dave Simplified byte swapping functions in place swapping Stereo ized RagaMatic Miscellaneous renamings Probably a bunch more fixes that I ve long since forgotten about 5 4 3 Version 3 1 New RagaMatic project very cool Less clipping in the Shakers class Added microphone position to Mandolin in STKdemo Fixed MIDI system message exclusion under Irix Added a few bitmaps for the Shaker instruments Made destructors virtual for Reverb h WvIn h and Simple h Fixed bug setting delay length in DLineA when value too big Fixed bug in WinMM realtime code RTSoundIO Added tick method to and same as lookup Switched to pthread API on SGI platforms e Added some defines to Object h for random number generation FPU overflow checking etc A few minor changes some bug fixes can t remember all of them 5 4 4 Version 3 0 New define flags for OS and realtime dependencies this will probably cause pro
9. is people who e already know how to program in C and C e want to create audio DSP and or synthesis programs e want to save some time by using our unit generators and input output routines e know C but want to learn about synthesis and processing algorithms e wish to teach real time synthesis and processing and wish to use some of our classes and examples Most ToolKit programmers will likely end up writing a class or two for their own particular needs but this task is typically simplified by making use of pre existing STK classes filters oscillators etc 5 18 Getting Started We ll begin our introduction to the Synthesis ToolKit with a simple sine wave oscillator program STK doesn t provide a specific oscillator for sine waves Instead it provides a generic waveform oscillator class which can load a variety of common file types In this example we load a sine table from an STK RAW file The class RtWvOut will send realtime samples to the audio output hardware on your computer sineosc cpp include WaveLoop h include RtWvOut h int main Set the global sample rate before creating class instances The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 194 STK Page Documentation Stk setSampleRate 44100 0 Define and load the sine wave file WaveLoop input new WaveLoop sinewave raw TRUE input gt setFrequency 440 0
10. 137 4 59 StifKarp Class Reference STK plucked stiff string instrument include lt StifKarp h gt Inheritance diagram for StifKarp Instrmnt Public Methods MY FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency EStf Karp 0 Class destructor e void clear Reset and clear all internal state e void MY FLOAT frequency Set instrument parameters for a particular frequency e void setStretch MY_FLOAT stretch Set the stretch factor of the string 0 0 1 0 e void setPickupPosition MY_FLOAT position Set the pluck or excitation position along the string 0 0 1 0 e void setBaseLoopGain MY_FLOAT aGain Set the base loop gain e void MY _FLOAT amplitude Pluck the string with the given amplitude using the current frequency e void MY_FLOAT frequency MY_FLOAT amplitude The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 138 STK Class Documentation Start a note with the given frequency and amplitude e void MY FLOAT amplitude Stop a note with the given amplitude speed of decay e MY_FLOAT tick Compute one output sample e void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 59 1 Detailed Description STK plucked stiff string instrument This class implements a simple plucked string algorithm Karp
11. 4 15 Drummer Class Reference STK drum sample player class include lt Drummer h gt Inheritance diagram for Drummer Instrmnt Drummer Public Methods 0 Class constructor Damme 0 Class destructor e void MY FLOAT instrument MY_FLOAT amplitude Start a note with the given drum type and amplitude e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY FLOAT tick Compute one output sample 4 15 1 Detailed Description STK drum sample player class This class implements a drum sampling synthesizer using objects and one pole filters The drum rawwave files are sampled at 22050 Hz but will be appropriately interpolated for other sample rates You can specify the maxi mum polyphony maximum number of simultaneous voices via a define in the Drummer h by Perry R Cook and Gary P Scavone 1995 2002 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 42 STK Class Documentation 4 15 2 Member Function Documentation 4 15 2 1 void Drummer noteOn MY_FLOAT instrument MY FLOAT amplitude virtual Start a note with the given drum type and amplitude Use general MIDI drum instrument numbers converted to frequency values as if MIDI note numbers to select a particular instrument Reimplemented from The documentation for this class was generated from the following file e Drummer h The Synthesis ToolKit in
12. ESKIN 0 Class destructor long char aString Attempt to parse the given string returning the message type long pexesa 0 Parse the next message if a file is loaded and return the message type long const Return the current message type long getChannel const Return the current message channel value MY FLOAT get Delta const Return the current message delta time value in seconds MY_FLOAT getByteT wo const Return the current message byte two value The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 57 SKINI Class Reference 131 MY FLOAT getByteThree const Return the current message byte three value e long getByteTwolnt const Return the current message byte two value integer e long getByteThreelnt const Return the current message byte three value integer e const charx getRemainderString Return remainder string after parsing e const charx getMessageTypeString Return the message type as a string e const charx whats ThisTypel long type Return the SKINI type string for the given type value e const charx whatsThisController long number Return the SKINI controller string for the given controller number 4 57 1 Detailed Description STK SKINI parsing class This class parses SKINI formatted text messages It can be used to parse individual messages or it can be passed an entire fil
13. OneZero STK one zero filter class o ooo PercFlut STK percussive flute FM synthesis instrument 88 PitShift STK simple pitch shifter effect class 90 Plucked STK plucked string model class 92 PluckTwo STK enhanced plucked string model class 04 PoleZero STK one pole one zero filter class PRCRev Perry s simple reverberator class 99 ReedTabl STK reed table class o 0 ooo o 100 Resonate STK noise driven formant filter 102 Reverb STK abstract reverberator parent class 104 Rhodey STK Fender Rhodes electric piano FM synthesis instrument 106 RtDuplex STK realtime audio input output class 108 RtMidi STK realtime MIDI class oo o I RtWvIn STK realtime audio input class 1113 RtWvOut STK realtime audio output class 116 Sampler STK sampling synthesis abstract base class 119 Saxofony STK faux conical bore reed instrument class 121 Shakers PhISEM and PhOLIES class o o 123 Simple STK wavetable noise instrument 126 Sitar STK sitar string model class o 128 SKINI STK SKINI parsing class 2 2 ee ee ee 1130 Socket STK TCP socket client server class 133 StifKarp STK plucked stiff string instrument 137 Stk
14. The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 22 FormSwep Class Reference 57 4 22 FormSwep Class Reference STK sweepable formant filter class include lt FormSwep h gt Inheritance diagram for FormSwep Stk Public Methods e FormS wep Default constructor creates a second order pass through filter a Class destructor e void MY FLOAT aFrequency MY_FLOAT aRadius Sets the filter coefficients for a resonance at frequency in Hz e void MY_FLOAT aFrequency MY_FLOAT aRadius MY FLOAT aGain 1 0 Set both the current and target resonance parameters e void MY_FLOAT aFrequency MY _ FLOAT aRadius MY FLOAT aGain 1 0 Set target resonance parameters e void setSweepRate MY_FLOAT aRate Set the sweep rate between 0 0 1 0 e void MY_FLOAT aTime Set the sweep rate in terms of a time value in seconds The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 STK Class Documentation e MY FLOAT tick MY_FLOAT sample Input one sample to the filter and return one output e MY FLOAT MY_FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector 4 22 1 Detailed Description STK sweepable formant filter class This public filter subclass implements a formant resonance which can be swept over time from one frequency setting t
15. e A soundcard to use realtime audio input output capabilities In order to use the effects project the soundcard and drivers must support full duplex mode e 0SS or ALSA device drivers for realtime sound output and MIDI input Windows95 98 2000 XP specific e A soundcard to use realtime audio input output capabilities In order to use the effects project the soundcard and drivers must support full duplex mode DirectX 5 0 or higher runtime libraries to use the precompiled binaries e Visual C 6 0 for compiling though a precompiled distribution is avail able e For compiling the source if not already in your system dsound h header file DirectX 6 1 put somewhere in your header search path ldsound 1ib library file DirectX 6 1 put somewhere in your library search path WindowsNT specific e STK is no longer supported under WindowsNT because DirectX support for NT is minimal Unless DirectX 5 0 or higher becomes available for NT STK won t work The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 16 Tutorial 193 5 16 Tutorial e Introduction e Getting Started Oo Realtime vs Non Realtime 5 17 Introduction First and foremost the Synthesis ToolKit is a set of C classes That means you need to know some basics about programming in C to make use of STK beyond the example programs we provide STK s target audience
16. 154 STK Class Documentation 4 66 Thread Class Reference STK thread class include lt Thread h gt Inheritance diagram for Thread Stk Public Methods Thread Default constructor Tirado The class destructor waits indefinitely for the thread to end before returning e bool THREAD_FUNCTION routine void ptr NULL Begin execution of the thread routine Upon success TRUE is returned e bool long milliseconds 1 Wait the specified number of milliseconds for the thread to terminate Return TRUE on success Static Public Methods e void void Test for a thread cancellation request 4 66 1 Detailed Description STK thread class This class provides a uniform interface for cross platform threads On unix systems the pthread library is used Under Windows the C runtime threadex functions are used The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 66 Thread Class Reference 155 by Perry R Cook and Gary P Scavone 1995 2002 4 66 2 Member Function Documentation 4 66 2 1 bool Thread start THREAD FUNCTION routine void ptr NULL Begin execution of the thread routine Upon success TRUE is returned The thread routine can be passed an argument via ptr If the thread cannot be created the return value is FALSE 4 66 2 2 bool Thread wait long milliseconds 1 Wait the specified number of milliseconds for the thread to terminate Retur
17. 59 This method adjusts the sweep rate based on a given time for the formant parameters to reach their target values The documentation for this class was generated from the following file e FomSwepH The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 60 STK Class Documentation 4 23 HevyMetl Class Reference STK heavy metal FM synthesis instrument include lt HevyMetl h gt Inheritance diagram for HevyMetl Instr HevyMetl Public Methods Barao Class constructor Mad Class destructor e void MY_FLOAT frequency MY _FLOAT amplitude Start a note with the given frequency and amplitude e MY_FLOAT tick Compute one output sample 4 23 1 Detailed Description STK heavy metal FM synthesis instrument This class implements 3 cascade operators with feedback modulation also re ferred to as algorithm 3 of the TX81Z Algorithm 3 is 4 3 gt 2 gt 1 gt Qut The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 23 HevyMetl Class Reference 61 Control Change Numbers Total Modulator Index 2 Modulator Crossfade 4 LFO Speed 11 LFO Depth 1 e ADSR 2 amp 4 Target 128 The basic Chowning Stanford FM Jpatent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and G
18. An StkError will be thrown if an error occurs during input Reimplemented from 4 50 3 5 const MY_FLOAT x RtWvlIn tickFrame void virtual Return a pointer to the next sample frame of data An StkError will be thrown if an error occurs during input Reimplemented from 4 50 3 6 MY FLOAT RtWvIn tickFrame MY _FLOAT frame Vector unsigned int frames virtual Read out sample frames of data to frame Vector An StkError will be thrown if an error occurs during input Reimplemented from The documentation for this class was generated from the following file e RtWvlIn h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 116 STK Class Documentation 4 51 RtWvOut Class Reference STK realtime audio output class include lt RtWvOut h gt Inheritance diagram for RtWvOut Stk WvOut RtWvOut Public Methods e unsigned int nChannels 1 MY_FLOAT sample Rate Stk sampleRate int device 0 int bufferFrames RT_BUFFER_ SIZE int nBuffers 4 Default constructor RAW vOut Class destructor e void void Start the audio output stream e void void Stop the audio output stream e unsigned long void const Return the number of sample frames output e MY_FLOAT get Time void const Return the number of seconds of data output e void const MY_FLOAT sample Output a single sample to all channels in a sample frame e void const MY_FLOAT ve
19. Apply breath pressure to instrument with given amplitude and rate of in crease void MY_FLOAT rate Decrease breath pressure with given rate of decrease void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 26 STK Class Documentation e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY FLOAT tick Compute one output sample e void controlChange int number MY FLOAT value Perform the control change specified by number and value 0 0 128 0 4 7 1 Detailed Description STK bowed string instrument class This class implements a bowed string model a la Smith 1986 after McIntyre Schumacher Woodhouse 1983 This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers e Bow Pressure 2 e Bow Position 4 e Vibrato Frequency 11 e Vibrato Gain 1 e Volume 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Bowed h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 8 BowTabl Class Reference 27 4 8 BowTabl Class Reference STK bowed string table class include lt BowTabl h gt Inheritance diagram for BowTa
20. But unlike MIDI 60 5 can cause a 50cent sharp middle C to be played As with MIDI byte values like velocity use of the integer and added fractional parts is up to the implementor of the algorithm The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 24 Why SKINI 199 being controlled by SKINI messages But the extra precision is there to be used or ignored 5 24 Why SKINI SKINI was designed to be extensable and hackable for a number of applications imbedded synthesis in a game or VR simulation scoring and mixing tasks real time and non real time applications which could benefit from controllable sound synthesis JAVA controlled synthesis or eventually maybe JAVA synthesis etc is not intended to be the mother of scorefiles but since the entire system is based on text representations of names floats and ints converters from one scorefile language to SKINI or back should be easily created Tam basically a bottom up designer with an awareness of top down design ideas so above all reflects the needs of my particular research and creative projects as they have arisen and developed 1 1 represents a profound advance beyond versions 0 8 and 0 9 the first versions future SKINI s might reflect some changes Compatibility with prior scorefiles will be attempted but there aren t that many scorefiles out there yet 5 25 SKINI Messages A basic message is a line of text There are
21. Noise Noise lastOut Noise tick normalize Wi 270 177 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 214 INDEX noteOff BandedWG lowBotl lowHole owed rass larinet rummer Flute FM Instrmnt Mesh2D Plucked PluckTwo J awww w Shakers Simple Sitar StifKarp noteOn BandedWG BeeThree larinet rummer Flute FMVoices HevyMetl 60 Instrmnt Mandolin Mesh2D 69 Modal Moog PercFlut Plucked Resonate Rhodey Saxofony Shakers Simple Sitar StifKarp TubeBell Wurley NRev clear tick OnePole OnePole clear getGain lastOut OnePole set Al setBO tick OnePole setGain setPole OneZero OneZero clear getGain lastOut OneZero setBO setB1 tick OneZero setGain setZero openFile Wvh 170 WvOut parseThis SKINI 132 PercFlut PercFlut noteOn PercF lut setFrequency tick PercF lut PitShift The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX 215 PitShift clear lastOut PitShift setEffectMix setShift tick PitShift pluck BandedWG Mandolin Plucked Sitar StifKarp 137 Plucked Plucked clear econ noteOn pluck Plucked setFrequency tick PluckT wo PluckTwo clear noteOff PluckTwo setDetune setFreqAndDetune setFrequency setPl
22. Public Methods void Default constructor e virtual void Class destructor e virtual void void Set target 1 e virtual void key Ofi void Set target 0 e void MY F LOAT aRate Set the rate e void set Time MY_FLOAT aTime Set the rate based on a time duration e virtual void set Target MY FLOAT aTarget Set the target value e virtual void set Value MY _FLOAT aValue Set current and target values to aValue e virtual int getState void const The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 46 STK Class Documentation Return the current envelope state 0 at target 1 otherwise e virtual MY_FLOAT void Return one envelope output value e virtual MY_F LOAT tick MY_FLOAT vector unsigned int vectorSize Return vectorSize envelope outputs in vector e MY_FLOAT void const Return the last computed output value 4 17 1 Detailed Description STK envelope base class This class implements a simple envelope generator which is capable of ramping to a target value by a specified rate It also responds to simple keyOn and keyOff messages ramping to 1 0 on keyOn and to 0 0 on keyOff by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Envelope The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 18 Filter Class
23. Scavone 1995 2002 32 STK Class Documentation e MY FLOAT MY FLOAT input Compute one output sample e MY FLOAT MY_FLOAT vector unsigned int vectorSize Take vectorSize inputs compute the same number of outputs and return them in vector 4 10 1 Detailed Description STK chorus effect class This class implements a chorus effect by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Chorus h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 11 Clarinet Class Reference 33 4 11 Clarinet Class Reference STK clarinet physical model class include lt Clarinet h gt Inheritance diagram for Clarinet Instrmnt Clarinet Public Methods e MY FLOAT lowest Frequency Class constructor taking the lowest desired playing frequency Carina Class destructor e void Tear Reset and clear all internal state e void MY FLOAT frequency Set instrument parameters for a particular frequency e void startBlowing MY FLOAT amplitude MY FLOAT rate Apply breath pressure to instrument with given amplitude and rate of in crease e void stopBlowing MY FLOAT rate Decrease breath pressure with given rate of decrease e void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude e void MY FLOAT amplitude Stop a note with the g
24. The valid range for theDelay is from 0 to the maximum delay line length 4 12 2 2 MY FLOAT Delay contentsAt long tapDelay const Return the value at tapDelay samples from the delay line input The valid range for tapDelay is 1 to the delay line length The documentation for this class was generated from the following file Dery The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 13 DelayA Class Reference 37 4 13 DelayA Class Reference STK allpass interpolating delay line class include lt DelayA h gt Inheritance diagram for DelayA Stk Public Methods Diao Default constructor creates a delay line with maximum length of 4095 sam ples and zero delay e DelayA MY_FLOAT theDelay long maxDelay Overloaded constructor which specifies the current and maximum delay line lengths Dana 0 Class destructor void Tear Clears the internal state of the delay line void MY _FLOAT theDelay Set the delay line length MY FLOAT void Return the current delay line length MY_FLOAT MY _FLOAT sample Input one sample to the delay line and return one output The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 38 STK Class Documentation 4 13 1 Detailed Description STK allpass interpolating delay line class This Delay subclass implements a fractional length digital delay line using a first order allpass f
25. controlChange 120 Sampler setFrequency 119 tick 119 sampleRate Stk e E Saxofony 121 clear 121 controlChange 122 noteOff 122 noteOn 121 Saxofony 121 setBlowPosition 121 setFrequency 121 startBlowing 121 stopBlowing 121 tick setAl OnePole PoleZero 96 TwoPole set A2 BiQuad sie set Allpass PoleZero set AllTimes ADSR set AttackRate ADSR set AttackTime The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX 217 ADSR setBO BiQuad OnePole OneZero 86 PoleZero 96 TwoPole TwoZero 161 setB1 BiQuad OneZero PoleZero TwoZero setB2 BiQuad TwoZero 161 setBaseLoopGain PluckTwo StifKarp 138 set Blocking Socket setBlockZero PoleZero setBlowPosition Saxofony 121 setBodySize Mandolin setCoefficients Filter setControll FM setControl2 FM setDecay Mesh2D setDecayRate ADSR setDecayTime ADSR setDelay Delay set Denominator Filter setDetune PluckTwo setDirectGain Modal setEffect Mix Chorus Echo PitShift Reverb setEndReflection Flute setEqualGainZeroes BiQuad Resonate 102 setFreqAndDetune PluckTwo setFrequency BandedWG BlowBotl BlowHole Bowed B C FM FMVoices Sampler Saxofony 121 Simple Sitar StifKarp WaveLoop 165 Wurley setGain BiQuad Filter FM OnePole OneZer
26. ea Reset and clear all internal state e virtual void MY_FLOAT frequency Set instrument parameters for a particular frequency e void MY FLOAT detune Detune the two strings by the given factor A value of 1 0 produces unison strings e void setFreqAndDetune MY_FLOAT frequency MY_FLOAT detune Efficient combined setting of frequency and detuning e void setPluckPosition MY_ FLOAT position Set the pluck or excitation position along the string 0 0 1 0 e void MY _FLOAT aGain The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 41 PluckTwo Class Reference 95 Set the base loop gain e virtual void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e virtual MY FLOAT tick 0 Virtual abstract tick function is implemented by subclasses 4 41 1 Detailed Description STK enhanced plucked string model class This class implements an enhanced two string plucked physical model a la Jaffe Smith Smith and others PluckTwo is an abstract class with no excitation specified Therefore it can t be directly instantiated This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others by Perry R Cook and Gary P Scavone 1995 2002 4 41 2 Member Function Documentation 4 41 2 1 void PluckTwo setBaseLoopGain MY_FLOAT aGain Set the base loop gain Th
27. equivalent values by Perry R Cook and Gary P Scavone 1995 2002 4 70 2 Member Function Documentation 4 70 2 1 void WaveLoop setFrequency MY_FLOAT aFrequency Set the data interpolation rate based on a looping frequency This function determines the interpolation rate based on the file size and the current Stk sampleRate The aFrequency value corresponds to file cycles per second The frequency can be negative in which case the loop is read in reverse order 4 70 2 2 void WaveLoop addPhase MY_FLOAT anAngle Increment current read pointer by anAngle relative to a looping frequency This function increments the read pointer based on the file size and the current Stk sampleRate The anAngle value is a multiple of file size 4 70 2 3 void WaveLoop addP haseOffset MY_FLOAT anAngle Add a phase offset to the current read pointer This function determines a time offset based on the file size and the current Stk sampleRate The anAngle value is a multiple of file size The documentation for this class was generated from the following file e WaveLoop 1 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 166 STK Class Documentation 4 71 Wurley Class Reference STK Wurlitzer electric piano FM synthesis instrument include lt Wurley h gt Inheritance diagram for Wurley t Instr iHi Wurley Public Methods Mia Class constructor ajo Class d
28. setGain MY FLOAT theGain virtual Set the filter gain The gain is applied at the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplemented from The documentation for this class was generated from the following file e TwoPole h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 69 TwoZero Class Reference 161 4 69 TwoZero Class Reference STK two zero filter class include lt TwoZero h gt Inheritance diagram for TwoZero Stk Public Methods 0 Default constructor creates a second order pass through filter ETwzad 0 Class destructor void void Clears the internal states of the filter void MY FLOAT b0 Set the b 0 coefficient value void MY FLOAT bl Set the b 1 coefficient value void MY _FLOAT b2 Set the b 2 coefficient value void setNotch MY_FLOAT frequency MY_FLOAT radius Sets the filter coefficients for a notch at frequency in Hz void MY_FLOAT theGain Set the filter gain e MY_FLOAT void const The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 162 STK Class Documentation Return the current filter gain e MY FLOAT void const Return the last computed output value e MY FLOAT tick MY FLOAT sample Input one sample to the filter and return one output e MY FLOAT MY_FLOAT vector unsigned int vectorSize
29. 3 void WvOut tick const MY_FLOAT x vector unsigned int vectorSize virtual Output each sample in vector to all channels in vectorSize sample frames An is thrown if a file read error occurs Reimplemented in RtWvOut and TcpWvOut 4 73 3 4 void WvOut tickFrame const MY FLOAT x frame Vector unsigned int frames 1 virtual Output the frame Vector of sample frames of the given length The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 176 STK Class Documentation An is thrown if a file read error occurs Reimplemented in RtWvOut and 4 73 4 Member Data Documentation 4 73 4 1 const FILE_TYPE WvOut WVOUT_RAW static STK RAW file type 4 73 4 2 const FILE_TYPE WvOut WVOUT_WAV static WAV file type 4 73 4 3 const FILE TYPE WvOut WVOUT SND static SND AU file type 4 73 4 4 const FILE_TYPE WvOut WVOUT_AIF static ATFF file type 4 73 4 5 const FILE_TYPE WvOut WVOUT_MAT static Matlab MAT file type The documentation for this class was generated from the following file e WvOut h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Chapter 5 STK Page Documentation 5 1 General Information References e ICMC99 Paper A somewhat recent paper by Perry and Gary about the Synthesis ToolKit in C e SIGGRAPH96 Paper A not so recent paper by Perry about the Synthesis ToolKit in C This is a link
30. 45 1 Detailed Description STK noise driven formant filter This instrument contains a noise source which excites a biquad resonance filter with volume controlled by an Control Change Numbers e Resonance Frequency 0 Nyquist 2 e Pole Radii 4 e Notch Frequency 0 Nyquist 11 e Zero Radii 1 e Envelopa Gain 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Resonate h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 104 STK Class Documentation 4 46 Reverb Class Reference STK abstract reverberator parent class include lt Reverb h gt Inheritance diagram for Reverb Public Methods e Rao Class constructor e virtual 0 Class destructor e virtual void O 0 Reset and clear all internal state e void setEffectMix MY FLOAT mix Set the mixture of input and reverberated levels in the output 0 0 input only 1 0 reverb only e MY_FLOAT const Return the last output value e MY_FLOAT llastOutLeft const Return the last left output value e MY FLOAT llastOutRight const Return the last right output value e virtual MY_FLOAT MY FLOAT input 0 Abstract tick function must be implemented in subclasses The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 46 Reverb Class Reference 105
31. MY FLOAT amplitude Start a note with the given frequency and amplitude e virtual void MY FLOAT amplitude Stop a note with the given amplitude speed of decay e virtual MY _FLOAT tick The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 55 Simple Class Reference 127 Compute one output sample e virtual void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 55 1 Detailed Description STK wavetable noise instrument This class combines a looped wave a noise source a biquad resonance filter a one pole filter and an ADSRlenvelope to create some interesting sounds Control Change Numbers e Filter Pole Position 2 e Pitched Cross Fade 4 e Envelope Rate 11 e Gain 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Simple h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 128 STK Class Documentation 4 56 Sitar Class Reference STK sitar string model class include lt Sitar h gt Inheritance diagram for Sitar Instrmnt Public Methods MY_FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency ESO Class destructor e void lear Reset and clear all internal state e void MY_FLOAT frequency Set ins
32. Reference 47 4 18 Filter Class Reference STK filter class include lt Filter h gt Inheritance diagram for Filter Public Methods void Default constructor creates a zero order pass through filter int nb MY_FLOAT bCoefficients int na MY FLOAT xa Coefficients Overloaded constructor which takes filter coefficients e virtual void Class destructor e void void Clears all internal states of the filter e void int nb MY FLOAT bCoefficients int na MY FLOAT xaCoefficients Set filter coefficients e void int nb MY_FLOAT xbCoefficients Set numerator coefficients e void int na MY_FLOAT xaCoefficients Set denominator coefficients e virtual void setGain MY_FLOAT theGain The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 48 STK Class Documentation Set the filter gain e virtual MY_FLOAT void const Return the current filter gain e virtual MY_FLOAT void const Return the last computed output value e virtual MY _FLOAT tick MY FLOAT sample Input one sample to the filter and return one output e virtual MY F LOAT tick MY _FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector 4 18 1 Detailed Description STK filter class This class implements a generic structure which can be used to create a wide range of fil
33. STK base class eroe Pasig e a E a 139 StkError STK error handling class o 143 SubNoise STK sub sampled noise generator 144 Table STK table lookup class o ooo oo 146 TcpWvlIn STK internet streaming input class 148 TcpWvOut STK internet streaming output class 151 Thread STK thread class o o o 154 TubeBell STK tubular bell orchestral chime synthesis instru MERT wee ep oak a ee a a a Sa ws 156 TwoPole STK two pole filter class o o 158 TwoZero STK two zero filter class o oo 61 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 2 1 STK Compound List WaveLoop STK waveform oscillator class 164 Wurley STK Wurlitzer electric piano FM synthesis instrument 166 WvIn STK audio data input base class 168 WvOut STK audio data output base class The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 STK Compound Index The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Chapter 3 STK Page Index 3 1 STK Related Pages Here is a list of all related documentation pages General Information Er Class Documentation 2 a a ee 180 Download and Release Notes 0 0000 eee eee 181 Usage Documentation
34. Tk graphical user interfaces GUIs provided is the same so it s easy to experiment in real time using either the GUIs or MIDI The Synthesis ToolKit can generate simultaneous SND AU WAV AIFF and MAT file output soundfile formats as well as realtime sound output so you can view your results using one of a large variety of sound signal analysis tools already available e g Cool Edit Matlab What the Synthesis Toolkit is not The Synthesis Toolkit is not one particular program Rather it is a set of C classes that you can use to create your own programs A few example applications are provided to demonstrate some of the ways to use the classes If you have specific needs you will probably have to either modify the example programs or write a new program altogether Further the example programs don t have a fancy GUI wrapper If you feel the need to have a drag and drop graphical patching GUI you probably don t want to use the ToolKit Spending hundreds of hours making platform dependent graphics code would go against one of the fundamental design goals of the ToolKit platform independence For those instances where a simple GUI with sliders and buttons is helpful we use Tc1 Tk which is freely distributed for all the supported Toolkit platforms A number of Tcl Tk GUI scripts are distributed with the ToolKit release For control the Synthesis Toolkit uses raw MIDI on supported platforms and Synthesis ToolKit In
35. a deltaTime and if it s positive we synthesize If it s negative we print an error and pretend this never happened and we hang around hoping to eventually catch up The rest of the code sorts out message types NoteOn NoteOff including Note On with velocity 0 and ControlChange The code implicitly takes into account the integer type of the control number but all other data is treated as double float The last line reads and parses the next message in the file The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Index ADSR ADSR BandedWG BandedWG BeeThree BeeThree BiQuad BiQuad BlowBotl BlowBotl BlowHole BlowHole BowTabl BowTabl Bowed Bowed Brass Brass Chorus Chorus Clarinet Clarinet Delay Delay DelayA DelayA DelayL DelayL Drummer Drummer Echo Echo Envelope Envelope FM FM FM Voices FMVoices Filter Filter Flute Flute FormSwep FormSwep HevyMetl HevyMetl Instrmnt Instrmnt JetTabl JetTabl Mandolin Mandolin Mesh2D Mesh2D Messager Messager Modal Modal ModalBar ModalBar Modulate Modulate Moog Moog Noise Noise OnePole OnePole OneZero OneZero PercFlut PercF lut INDEX 207 PitShift PitShift PluckT wo PluckTwo Plucked Plucked PoleZero PoleZero ReedTabl ReedTabl Resonate Resonate 102 Reve
36. audio drivers installed and you wish to make use of native ALSA API calls a link to the ALSA library must be spec ified in the above compile statement lasound and the preprocessor definition should instead be __LINUX_ALSA_ 5 19 2 Irix The irix SGI and linux operating systems are both flavors of unix and thus be have similarly Making the same assumptions as in the linux case the following compile statement should work CC Wall D__IRIX_AL__ o sineosc Stk cpp WvIn cpp WaveLoop cpp WvOut cpp RtWvOut 5 19 3 Windows I have personally only worked with Visual C when compiling programs under windoze Pll assume you ve become familiar with Visual C and don t need a tutorial on its particular idiosyncrasies In creating the VC project add the and RtAudio class files as well as the sineosc cpp and sinewave raw files You will also need to link to the DirectSound library dsound 1ib select the multithreaded library and provide the _WINDOWS_DS__ and _ LITTLE_ENDIAN__ preprocessor definitions The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 D__LITTLE_ENDIAN__ o sineosc Stk cpp WvIn cpp WaveLoop cpp WvOut cpp RtWvOut cy cpp RtAudio cpp sineosc lt 5 20 Realtime vs Non Realtime 197 5 20 Realtime vs Non Realtime Most of the Synthesis ToolKit classes are platform independent That means that they should compile on any reasonably current C compil
37. changed The Volume spec is a MIDI Extension message which behaves like a Control Change message with the controller number set explicitly to the value for MIDI The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 204 STK Page Documentation Volume 7 Thus the following two lines would accomplish the same changing of MIDI volume on channel 2 ControlChange 0 000000 2 7 64 1 Volume 0 000000 2 64 1 I like the 2nd line better thus my motivation for SKINI in the first place The StringDamping and StringDetune messages behave the same as the Vol ume message but use Control Numbers which aren t specifically nailed down in MIDI Note that these Control Numbers are carried around as long ints so we re not limited to 0 127 If however you want to use a MIDI controller to play an instrument using controller numbers in the 0 127 range might make sense 5 30 Using SKINI Here s a simple example of code which uses the SKINI object to read a SKINI file and control a single instrument instrument new Mandolin 50 0 score new SKINI argv 1 while score gt getType gt 0 4 tempDouble score gt getDelta if tempDouble lt 0 tempDouble tempDouble tempDouble tempDouble output getTime if tempDouble lt 0 printf Bad News Here Backward Absolute Time Required n tempDouble 0 0 tempLong long tempDouble Stk sampleRate for i 0 i
38. internet streaming input class This protected Wvin subclass can read streamed data over a network via a TCP socket connection The data is assumed in big endian or network byte order TcpWvIn supports multi channel data in interleaved format It is important to distinguish the methods which return samples produced by averaging across sample frames from the tickFramel methods which return pointers to multi channel sample frames For single channel data these methods return equivalent values This class starts a socket server which waits for a single remote connection The default data type for the incoming stream is signed 16 bit integers though any of the defined STK_FORMATSs are permissible by Perry R Cook and Gary P Scavone 1995 2002 4 64 2 Constructor Destructor Documentation 4 64 2 1 TcpWvIn TcpWvIn int port 2006 Default constructor starts a socket server If not specified the server is associ ated with port 2006 An StkError will be thrown if an error occurs while initializing the input thread or starting the socket server 4 64 3 Member Function Documentation 4 64 3 1 void TcpWvIn listen unsigned int nChannels 1 Stk STK FORMAT format STK_SINT16 Listen for a new connection with specified data channels and format The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 150 STK Class Documentation An StkError will be thrown a socket error or an in
39. lt tempLong i output tick instrument gt tick tempDouble3 score gt getByteThree if score gt getType __SK_Note0n_ tempDouble3 NORM_MIDI if score gt getByteThree 0 tempDouble3 0 5 instrument gt note0ff tempDouble3 else tempLong int score gt getByteTwo tempDouble2 Midi2Pitch tempLong instrument gt noteOn tempDouble2 tempDouble3 else if score gt getType __SK_NoteOff_ 4 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 30 Using SKINI 205 tempDouble3 NORM_MIDI instrument gt note0ff tempDouble3 else if score gt getType __SK_ControlChange_ tempLong score gt getByteTwolnt instrument gt controlChange tempLong temp3 0 score gt nextMessage When the score SKINI object object is created from the filename in argv 1 the first valid command line is read from the file and parsed The score gt getType retrieves the messageType If this is 1 there are no more valid messages in the file and the synthesis loop terminates Otherwise the message type is returned getDelta retrieves the deltaTime until the current message should occur If this is greater than 0 synthesis occurs until the deltaTime has elapsed If delta Time is less than zero the time is interpreted as absolute time and the output device is queried as to what time it is now That is used to form
40. message and return the message type e void setRtDeltal long nSamples Set the delta time in samples returned between valid realtime messages This setting has no affect for scorefile messages e long getDelta void const Return the current message delta time in samples e long get Type const Return the current message type e MY FLOAT getByteTwol const Return the byte two value for the current message e MY FLOAT getByteThree const Return the byte three value for the current message e long getChannel const Return the channel number for the current message The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 72 STK Class Documentation 4 29 1 Detailed Description STK input control message parser This class reads and parses control messages from a variety of sources such as a MIDI port scorefile socket connection or pipe MIDI messages are retrieved using the RtMidi class All other input sources scorefile socket or pipe are assumed to provide SKINI formatted messages For each call to the active input sources are queried to see if a new control message is available This class is primarily for use in STK main event loops One of the original goals in creating this class was to simplify the message acquisition process by removing all threads If the windoze select function behaved just like the unix one that would have
41. messages to an executable not possible under Windows95 98 3 realtime SKINI input messages to an executable 4 Acquire realtime MIDI messages from a MIDI port on your computer graphical user interfaces GUI are provided with this distribution which can generate realtime SKINI messages Note that the Messager class allows mul tiple simultaneous socket client connections together with MIDI and or piped input The Md2Skini program in the demo directory is mostly obsolete but can be used to create SKINI scorefiles from realtime MIDI input 5 9 Demo STK Instruments The demo project demonstrates the behavior of all the distributed STK instru ments The instruments available with this release include Pretty good physical model of the clarinet e BlowHole A clarinet physical model with one tonehole and one register vent A psuedo conical bore reed instrument which sometimes sounds like a saxophone Pretty good physical model of the flute The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 188 STK Page Documentation El rass Not so bad physical model of a brass instrument lowBotl A basic helmholtz resonator and air jet model owed Not hideous physical model of a bowed string instrument cked Yer basic plucked string physical model p A simple plucked stiff string physical model itar A simple sitar plucked string physical model ABEBE ls 3 21 a 2 5 em O j
42. o 146 bb Pe sad dd 148 Le A A 151 dee eet a A o oa 154 a a ae ee eee ae 156 4 68 TwoPole Class Reference o a 158 4 69 TwoZero Class Reference o o 161 ses la da Ca e ae E AA 164 con a da A 166 4 72 Wvln Class Reference o e 168 4 73 WvOut Class Reference o 173 177 ee DES aa dae ee ee 177 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 iv CONTENTS eh GR ee A 180 5 3 Download and Release Notes o o 181 E eee A A e a das 181 ee ane ee ee a A ae Nig ag 185 cay Ge ORS NAAA Be n A 185 penetra SA eee ree A 186 She eo oot ao ed ee eee Ge ee ee 187 5 9 Demo STK Instruments 2 0 0 0 0 0000004 187 5 10 Demo Non Realtime USel o o 188 5 11 Demo Realtime UsSel o o e 189 189 5 13 Realtime MIDI Control Input 190 5 14 The Mail List 2 2 2 eee 6664 a bbe aa 191 5 15 System Requirements 2 2 2 2 0 0 0 00004 192 5 16 Tutorial ciao aaa eee Se ee GY ee ee 193 See oe ee oa Se ee ee A 193 5 18 Getting Started 2 eee 193 5 19 Compiling 04444544444 e Fane aetti tethys 196 5 20 Realtime vs Non Realtime 000 197 ER AR a ad BA eet aoe 197 5 22 Synthesis toolKit Instrument Network Interface SKINI 198 9 23 MIDI Compatibility o o en 198 5 24 Why
43. o et EEE 8 BEEE S Bam O Sitar StifKarp SubNoise Table TcepWvIn TcpWvOut 153 TubeBell TwoPole 159 Aum WvOut 175 175 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX tickFrame RtDuplex 110 RtWvIn 115 RtWvOut 11 TcpWvIn 149 TcpWvOut WaveLoop 164 Wvin 172 WvOut TubeBell TubeBell noteOn tick TubeBell TubeBell TwoPole TwoPole 158 clear 158 getGain lastOut setAl setA2 set BO tick TwoPole 158 TwoPole 158 set Gain set Resonance 159 TwoZero TwoZero 161 clear 161 getGain lastOut setBO setB1 161 setB2 161 tick TwoZero 161 TwoZero 161 setGain setNotch OO wait Thread WaveLoop WaveLoop 164 addTime tickFrame 164 WaveLoop 164 WaveLoop 164 addPhase 165 addPhaseOffset setFrequency 165 whats ThisController SKINI whatsThisType SKINI writeBuffer Socket Wurley Wurley noteOn setFrequency 166 tick Wurley WvlIn WvyIn addTime closeFile getChannels getSize isFinished lastFrame lastOut reset Wein Wvln 168 getFileRate normalize openFile 170 setInterpolate 171 setRate 171 tick tickFrame 172 WvlIn 170 WvOut pubic E closeFile getFrames i ap 173 WvOut 175 WvOut 173 Ta The Synthesis ToolKit in C by Perry R Cook and Gary P S
44. o oe e a 185 The Mail List e 191 System Requirements 00 ee eee eee ee eee 192 Titonal arpa aa a 193 Synthesis toolKit Instrument Network Interface SKINI 198 10 STK Page Index The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Chapter 4 STK Class Documentation 4 1 ADSR Class Reference STK ADSR envelope class include lt ADSR h gt Inheritance diagram for ADSR Envelope Public Types e enum ATTACK DECAY SUSTAIN RELEASE DONE states Public Methods e void Default constructor 12 STK Class Documentation void Class destructor e void void Set target 1 state ADSR ATTACK e void void Set target 0 state ADSR RELEASE e void setAttackRate MY_FLOAT aRate Set the attack rate e void setDecay Rate MY_FLOAT aRate Set the decay rate e void setSustainLevel MY FLOAT aLevel Set the sustain level e void setReleaseRate MY_FLOAT aRate Set the release rate e void setAttackTime MY FLOAT aTime Set the attack rate based on a time duration e void MY FLOAT aTime Set the decay rate based on a time duration e void setReleaseTime MY FLOAT aTime Set the release rate based on a time duration e void setAllTimes MY_FLOAT aTime MY_FLOAT dTime MY_FLOAT sLevel MY_FLOAT rTime Set sustain level and attack decay and release state rates based
45. on time durations e void MY_FLOAT aTarget Set the target value e int getState void const Return the current envelope state ATTACK DECAY SUSTAIN RE LEASE DONE e void MY _FLOAT aValue The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 1 ADSR Class Reference 13 Set to state ADSR SUSTAIN with current and target values of aValue e MY_FLOAT tick void Return one envelope output value e MY FLOAT MY FLOAT vector unsigned int vectorSize Return vectorSize envelope outputs in vector 4 1 1 Detailed Description STK ADSR envelope class T his Envelope subclass implements a traditional ADSR Attack Decay Sustain Release envelope It responds to simple keyOn and keyOff messages keeping track of its state The state ADSR DONE after the envelope value reaches 0 0 in the ADSR RELEASE state by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e ADSR h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 14 STK Class Documentation 4 2 BandedWG Class Reference Banded waveguide modeling class include lt BandedWG h gt Inheritance diagram for BandedWG Instrmn BandedWG Public Methods BandedWG Class constructor BandedWG Class destructor e void clear Reset and clear all internal state e void
46. osaa tap E BeeT hr e susi aaa AEE ee Sone Be Se aS FPMVo0IC S 63454424 22 Pee AAA de we YS HevyMetl xuxa A DRESS Be a oo 60 P tcP ities sico dra laa ta Rhodeyis E eee 106 TubeBell iron eae eee we rad OO ee ee ee 156 Watley sani g a A a eee 166 Mesh 219 asia ad a a SS a Modal siei ars pedo a we aa A ee oe eS ModalBar s uri Bere e a SS Phiicked are eh ee ee a een al BO ead 92 Pluck TWO aha ca da da a ee eee SO ees Mandolin cs 2 a2 ode ss A o BR ad Resonate 252 42 a wis a A ee ee ea 102 Sampler ect ar nido a Eee A 119 MOE 22442844 5 daa A a a Sed Ro ee eS 79 Saxofony ers hdd db AG ed ee Re eee EES ES 21 o EEEE os oe 8 ae he adade els ra 123 SIMP e a E A A RN AS 126 SIA i de as ds das da 128 DIALED oia a Baan ce AA Rows Bde ods obs os hed eee 137 J tlabl alar SEO eee heh ek as a e E a 65 Messager hiato ac ted GOGO A be de a a 7 Modulate ooa ee 77 O RE 81 SUbDNOISE ciencia o la let a a he ri 144 RISE Dorada aaa a aa 190 RecdTabl 320240000 ua AA ad 100 Reverb cocinas aa a 104 JCREW is ns aa PS le ras Sew bods 64 NREV noria te tea ana A GA a iw S PRCRev oaa aa RARE 09 AS A 464 Gb oe eee a aa 108 RGMidi E e o a E ol ew Ae kG amp amp SS SKINI O hese fa FE Aad 130 SOCkEb acra Dia a QA a Aa 133 Table 4 33 cote ee ea a wee ads 146 Thread session a aca GR Ro Bole 154 Woy Tit x radar aa ae Se Gy be Aa 168 RtW iit acosa OEE DEA Be ee eRe 113 Top Wve
47. setStrikePosition MY FLOAT position Set strike position 0 0 1 0 e void int preset Select a preset void setFrequency MY_FLOAT frequency Set instrument parameters for a particular frequency e void MY_FLOAT amplitude MY FLOAT rate Apply bow velocity pressure to instrument with given amplitude and rate of increase e void MY_FLOAT rate Decrease bow velocity breath pressure with given rate of decrease The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 2 BandedWG Class Reference 15 void MY FLOAT amp Pluck the instrument with given amplitude void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay MY FLOAT Compute one output sample void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 2 1 Detailed Description Banded waveguide modeling class This class uses banded waveguide techniques to model a variety of sounds in cluding bowed bars glasses and bowls For more information see Essl G and Cook P Banded Waveguides Towards Physical Modelling of Bar Per cussion Instruments Proceedings of the 1999 International Computer Music Conference Control Change Numbers Bow Pressure 2 Bow Motion 4 Strike Position 8 not implemente
48. sico gow ack Bk eb owe oe Oa A re 148 WavehLGop eu nanne a a oe Y Soe aes 164 WWVDU 24 ra a te a O od da 173 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 1 1 STK Class Hierarchy RtwyQOut 2 2244 dda aaa rre 116 TepW vOut 64 76 408 gta a aaa dd Bod aR BO ae ode He eae rete ate 151 SERETTOLA 6 4 cere as doa E A i a a ee Se 143 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 STK Hierarchical Index The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Chapter 2 STK Compound Index 2 1 STK Compound List Here are the classes structs unions and interfaces with brief descriptions ADSR STK ADSR envelope class o o o BandedWG Banded waveguide modeling class BeeThree STK Hammond oid organ FM synthesis instrument BiQuad STK biquad two pole two zero filter class BlowBotl STK blown bottle instrument class BlowHole STK clarinet physical model with one register hole and one tonehole 2 0 0 0 0 2 eee ee Bowed STK bowed string instrument class BowTabl STK bowed string table class Brass STK simple brass instrument class Chorus STK chorus effect class o oo Clarinet STK clarinet physical model class Delay STK non interpolating delay line class
49. the given descriptor bool int socket Returns TRUE is the socket descriptor is valid int int socket const void buffer long bufferSize int flags Write a buffer via the specified socket Returns the number of bytes written or 1 if an error occurs int int socket void buffer long bufferSize int flags Read a buffer via the specified socket Returns the number of bytes read or 1 if an error occurs 4 58 1 Detailed Description STK TCP socket client server class This class provides a uniform cross platform TCP socket client or socket server interface Methods are provided for reading or writing data buffers to from connections This class also provides a number of static functions for use with external socket descriptors The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 58 Socket Class Reference 135 The user is responsible for checking the values returned by the read write meth ods Values less than or equal to zero indicate a closed or lost connection or the occurence of an error by Perry R Cook and Gary P Scavone 1995 2002 4 58 2 Constructor amp Destructor Documentation 4 58 2 1 Socket Socket int port 2006 Default constructor which creates a local socket server on port 2006 or the specified port number An StkError will be thrown if a socket error occurs during instantiation 4 58 2 2 Socket Socket int port const char hostname Class con
50. to Perry Cook s STK Web page He has information about the Synthesis toolkit Instrument Network Interface SKINI the protocol used to control STK instruments as well as a lot of other cool stuff What is the Synthesis ToolKit The Synthesis ToolKit in C STK is a set of audio signal processing and synthesis classes and algorithms written in C You can use these classes to create programs that make sounds with a variety of synthesis techniques This is not a terribly novel concept except that the Synthesis ToolKit is extremely portable it s mostly platform independent C and C code and it s com pletely user extensible no libraries no hidden drivers and all source code is included We like to think that this increases the chances that our programs will still work in another 5 10 years In fact the ToolKit has been working continuously for nearly 8 years now STK currently runs with realtime sup port audio and MIDI on SGI Trix Linux and Windows computer platforms 178 STK Page Documentation Generic non realtime support has been tested under NeX TStep Sun and other platforms and should work with any standard C compiler The Synthesis ToolKit is free for non commercial use The only parts of the Syn thesis ToolKit that are platform dependent concern real time audio and MIDI input and output and that is taken care of with a few special classes The in terface for MIDI input and the simple Tcl
51. virtual MY _FLOAT tick MY _F LOAT xvector unsigned int vectorSize Computer vectorSize outputs and return them in vector e virtual void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 24 1 Detailed Description STK instrument abstract base class This class provides a common interface for all STK instruments by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Instrmnt h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 64 STK Class Documentation 4 25 JCRev Class Reference John Chowning s reverberator class include lt JCRev h gt Inheritance diagram for JCRev Public Methods e void O Reset and clear all internal state e MY FLOAT MY_FLOAT input Compute one output sample 4 25 1 Detailed Description John Chowning s reverberator class This class is derived from the CLM JCRev function which is based on the use of networks of simple allpass and comb delay filters This class implements three series allpass units followed by four parallel comb filters and two decorrelation delay lines in parallel at the output by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e JCRev h The Synthesis ToolKit in C by Perry R Cook and Gary P S
52. virtual const MY FLOAT void const Return a pointer to the last output sample frame e virtual const MY FLOAT void Return a pointer to the next sample frame of data e virtual MY_FLOATx MY FLOAT xframeVector unsigned int frames Read out sample frames of data to frameVector The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 170 STK Class Documentation 4 72 1 Detailed Description STK audio data input base class This class provides input support for various audio file formats It also serves as a base class for realtime streaming subclasses WvIn loads the contents of an audio file for subsequent output Linear interpo lation is used for fractional read rates Wvln supports multi channel data in interleaved format It is important to distinguish the tick methods which return samples produced by averaging across sample frames from the tickFramel methods which return pointers to multi channel sample frames For single channel data these methods return equivalent values Small files are completely read into local memory during instantiation Large files are read incrementally from disk The file size threshold and the increment size values are defined in WvIn h WvIn currently supports WAV AIFF SND AU MAT file Matlab and STK RAW file formats Signed integer 8 16 and 32 bit and floating point 32 and 64 bit data types are supported Uncompressed
53. 0 000000 2 71 82 NoteOff 0 000000 2 79 82 5 29 The SKINI tbl File and Message Parsing The SKINI tbl file contains an array of structures which are accessed by the parser object SKINI cpp The struct is struct SKINISpec char messageString 32 long type long data2 long data3 3 so an assignment of one of these structs looks like MessageStr type data2 data3 type is the message type sent back from the SKINI line parser data lt n gt is either The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 29 The SKINI tbl File and Message Parsing 203 e NOPE field not used specifically there aren t going to be any more fields on this line So if there is is NOPE in data2 data3 won t even be checked e SK_INT byte actually scanned as 32 bit signed long int If it s a MIDI data field which is required to be an integer like a controller number it s 0 127 Otherwise get creative with SK_INTs e SK_DBL double precision floating point SKINI uses these in the MIDI context for note numbers with micro tuning velocities controller values etc e SK_STR only valid in final field This allows nearly arbitrary mes sage types to be supported by simply scanning the string to EndOfLine and then passing it to a more intellegent handler For example MIDI SYSEX system exclusive messages of up to 256 bytes can be read as space delimited integers into the 1K SK_STR buff
54. Botl BlowBotl clear controlChange noteOff noteOn setFrequency startBlowing stopBlowing tick BlowBotl BlowHole BlowHole BlowHole clear controlChange noteOff noteOn setFrequency setTonehole set Vent start Blowing stopBlowing tick BlowHole Bowed Bowed clear controlChange noteOff noteOn setFrequency set Vibrato startBowing stopBowing tick BowTabl BowTabl BowTabl lastOut tick Rees setOffset setSlope tick Brass Brass Brass The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX 209 clear controlChange noteOff noteOn setFrequency setLip startBlowing stopBlowing tick Chorus Chorus Chorus clear lastOut lastOutLeft lastOutRight setEffect Mix setModDepth set ModFrequency tick Clarinet Clarinet Clarinet clear controlChange noteOff noteOn setFrequency startBlowing stopBlowing tick clear BandedWG Clarinet Delay DelayA Echo Filter Flute FM JCRev Mesh2D 69 Modal NRev OnePole OneZero 86 PitShift Plucked 92 PluckTwo PoleZero 96 PRCRev 99 Resonate 102 Reverb Sampler Saxofony 121 Simple Sitar StifKarp 137 TwoPole 158 TwoZero 161 close Socket closeFile Wvin 168 WvOut connect Socket TcpWvOut contentsAt Delay controlChange BandedWG Bl
55. C by Perry R Cook and Gary P Scavone 1995 2002 4 16 Echo Class Reference 43 4 16 Echo Class Reference STK echo effect class include lt Echo h gt Inheritance diagram for Echo Stk Public Methods e MY_FLOAT longestDelay Class constructor taking the longest desired delay length FRG Class destructor void elear Reset and clear all internal state void MY FLOAT delay Set the delay line length in samples void MY FLOAT mix Set the mixture of input and processed levels in the output 0 0 input only 1 0 processed only MY FLOAT const Return the last output value MY FLOAT MY FLOAT input Compute one output sample MY_FLOAT MY_FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 44 STK Class Documentation 4 16 1 Detailed Description STK echo effect class This class implements a echo effect by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Echo h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 17 Envelope Class Reference 45 4 17 Envelope Class Reference STK envelope base class include lt Envelope h gt Inheritance diagram for Envelope Envelope
56. Define and open the default realtime output device for one channel playback RtWvOut output new RtWvOut 1 Play the oscillator for 40000 samples for int i 0 i lt 40000 i 4 output gt tick input gt tick Clean up delete input delete output return 0 is a subclass of which supports WAV SND AU AIFF MAT file Matlab and RAW file formats with 8 16 and 32 bit integer and 32 and 64 bit floating point data types WvIn provides interpolating read once oneshot functionality as well as methods for setting the read rate and read position Nearly all STK classes implement tick methods which take and or return sample values Within the tick method 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 method also provides an overloaded tick function taking pointer and size arguments which can be used for vectorized computations The and classes support multi channel sample frames To dis tinguish single sample frame operations from multi channel frame operations these classes also implement tickFrame functions When a tick method is called for multi channel data frame averages are returned or the input sample is distributed across all channels of a sample frame Nearly all STK classes inherit fr
57. Frame RtDuplex 108 RtWvIn 113 TcpWvIn WvlIn 169 lastOut BiQuad BowTabl Chorus Delay Echo Envelope Filter Instrmnt JetTabl Modulate Noise OnePole OneZero PitShift 90 PoleZero ReedTabl Reverb RtDuplex RtWvin Table TcpWvIn TwoPole TwoZero 162 Wvh 169 lastOutLeft Chorus Reverb lastOutRight The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX Chorus Reverb listen TcpWvIn load Waves FM Mandolin Mandolin controlChange Mandolin noteOn pluck setBodySize tick Mesh2D Mesh2D clear controlChange energy Mesh2D 69 noteOff noteOn setDecay setInputPosition setNX setNY tick Messager Messager getByteThree getByteTwo getChannel getDelta getType Messager nextMessage setRtDelta Modal Modal clear controlChange damp Modal noteOff noteOn setDirectGain setFrequency set MasterGain setModeGain setRatioAndRadius strike tick ModalBar ModalBar controlChange ModalBar setModulationDepth setPreset setStickHardness setStrikePosition ModalBar Modulate Modulate lastOut Modulate reset setRandomGain set VibratoGain set VibratoRate tick Moog Moog controlChange Moog noteOn setFrequency setModulationDepth setModulationSpeed tick nextMessage Messager RtMidi SKINI
58. Hole h gt Inheritance diagram for BlowHole Instrmn BlowHole Public Methods e BlowHole MY_FLOAT lowestFrequency Class constructor EE o Class destructor e void Tear Reset and clear all internal state e void MY FLOAT frequency Set instrument parameters for a particular frequency e void setTonehole MY FLOAT newValue Set the tonehole state 0 0 closed 1 0 fully open e void setVent MY FLOAT newValue Set the register hole state 0 0 closed 1 0 fully open e void startBlowing MY FLOAT amplitude MY FLOAT rate Apply breath pressure to instrument with given amplitude and rate of in crease e void stopBlowing MY FLOAT rate Decrease breath pressure with given rate of decrease The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 24 STK Class Documentation e void fnoteOn MY FLOAT frequency MY FLOAT amplitude Start a note with the given frequency and amplitude e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY _FLOAT tick Compute one output sample e void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 6 1 Detailed Description STK clarinet physical model with one register hole and one tonehole This class is based on the clarinet model with the addition of a two port register hole and a three
59. MY FLOAT shift Set the pitch shift factor 1 0 produces no shift e void MY_FLOAT mix Set the mixture of input and processed levels in the output 0 0 input only 1 0 processed only e MY FLOAT flastOut const Return the last output value e MY FLOAT MY FLOAT input Compute one output sample e MY_FLOATx MY_FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 39 PitShift Class Reference 91 4 39 1 Detailed Description STK simple pitch shifter effect class This class implements a simple pitch shifter using delay lines by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e PitShift h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 92 STK Class Documentation 4 40 Plucked Class Reference STK plucked string model class include lt Plucked h gt Inheritance diagram for Plucked Instrmnt Public Methods e Plucked MY_FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency Phicked Class destructor e void lear Reset and clear all internal state e virtual void MY_FLOAT frequency Set instrument parameters for a particular frequency e void MY_FLOAT amplitud
60. Name bool raw FALSE Overloaded constructor for file input e virtual 0 Class destructor e void const char fileName bool raw FALSE Open the specified file and load its data e void void If a file is open close it e void void Clear outputs and reset time file pointer to zero e void void Normalize data to a maximum of 1 0 e void MY _FLOAT peak Normalize data to a maximum of peak e unsigned long getSize void const The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 72 WvIn Class Reference 169 Return the file size in sample frames e unsigned int getChannels void const Return the number of audio channels in the file e MY FLOAT getFileRate void const Return the input file sample rate in Hz not the data read rate e bool void const Query whether reading is complete e void setRate MY FLOAT aRate Set the data read rate in samples The rate can be negative e virtual void MY _FLOAT aTime Increment the read pointer by aTime samples e void bool doInterpolate Turn linear interpolation on off e virtual MY FLOAT void const Return the average across the last output sample frame e virtual MY FLOAT tick void Read out the average across one sample frame of data e virtual MY FLOAT MY _FLOAT vector unsigned int vector Size Read out vectorSize averaged sample frames of data in vector e
61. O n 69 Y 71 SESTE EEEE enanas anes 73 Ae a ae dr an 75 Li REA AE a de 77 epbaneeetAs SETITE PTEE 79 Be Av ay ee a Ses oh a ee Ae ee Gee S ats 81 SS he ge ORS ERG So ee a A 83 NETTER A bhiad oe eed 84 4 37 OneZero Class Referencel o o 86 4 38 PercFlut Class Reference o 88 4 39 PitShift Class Reference o 90 4 40 Plucked Class Reference o 92 o Ge Gece AAA NO os 94 4 42 PoleZero Class Reference o 96 4 43 PRCRev Class Reference o 00000 99 O a AAA Ge ee a 100 4 45 Resonate Class Reference o ooo 102 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 CONTENTS 4 46 Reverb Class Reference o 104 CERERE oh ave ee oe eee 106 RIPE Stes ae aes ee ae hs ge ee 108 Le et Bea ae A ees 111 4 50 RtWvln Class Reference 2 0 2 20 0 2 0000 000 113 4 51 RtWvOut Class Reference o 116 fo abi e a a a eS 119 adi A A 121 4 54 Shakers Class Reference o 123 idos e be eed 126 4 56 Sitar Class Reference o a 128 4 57 SKINI Class Reference o a 130 A ee r A 133 o AA OEE ee 137 4 60 Stk Class Reference o e 139 4 61 StkError Class Reference o a 143 AAA O AA ee 144 4 63 Table Class Reference
62. OAT MY_FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector 4 68 1 Detailed Description STK two pole filter class This protected subclass implements a two pole digital filter A method is provided for creating a resonance in the frequency response while maintaining a nearly constant filter gain by Perry R Cook and Gary P Scavone 1995 2002 4 68 2 Member Function Documentation 4 68 2 1 void TwoPole setResonance MY_FLOAT frequency MY_FLOAT radius bool normalize FALSE Sets the filter coefficients for a resonance at frequency in Hz This method determines the filter coefficients corresponding to two complex conjugate poles with the given frequency in Hz and radius from the z plane origin If normalize is true the coefficients are then normalized to produce unity gain at frequency the actual maximum filter gain tends to be slightly greater than unity when radius is not close to one The resulting filter frequency response has a resonance at the given frequency The closer the poles are to the unit circle radius close to one the narrower the resulting resonance width An unstable filter will result for radius gt 1 0 For a better resonance filter use a filter See also BiQuad filter class The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 160 STK Class Documentation 4 68 2 2 void TwoPole
63. OAT WvIn getFileRate void const Return the input file sample rate in Hz not the data read rate WAV SND and AIF formatted files specify a sample rate in their headers STK RAW files have a sample rate of 22050 Hz by definition MAT files are assumed to have a rate of 44100 Hz 4 72 3 5 void WvIn setRate MY FLOAT aRate Set the data read rate in samples The rate can be negative If the rate value is negative the data is read in reverse order 4 72 3 6 void WvlIn setInterpolate bool doInterpolate Turn linear interpolation on off Interpolation is automatically off when the read rate is an integer value If interpolation is turned off for a fractional rate the time index is truncated to an integer value 4 72 3 7 MY_FLOAT WvIn tick void virtual Read out the average across one sample frame of data An StkError will be thrown if a file is read incrementally and a read error occurs Reimplemented in RtWvIn and The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 172 STK Class Documentation 4 72 3 8 MY FLOAT WvIn tick MY_FLOAT x vector unsigned int vectorSize virtual Read out vectorSize averaged sample frames of data in vector An StkError will be thrown if a file is read incrementally and a read error occurs Reimplemented in RtWvIn and TcpWvIn 4 72 3 9 const MY_FLOAT x WvlIn tickFrame void virtual Return a pointer to the next sample frame of data An
64. Rate Stk sampleRate int device 0 int bufferFrames RT BUFFER SIZE int nBuffers 2 Default constructor The device argument is passed to RtAudio during instantiation The default value zero will select the default device on your system or the first device found meeting the specified parameters On systems with multiple sound cards devices values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API The de fault buffer size of RT_BUFFER SIZE is defined in Stk h An will be thrown if an error occurs duing instantiation 4 50 3 Member Function Documentation 4 50 3 1 void RtWvlIn start void Start the audio input stream The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 50 RtWvIn Class Reference 115 The stream is started automatically if necessary when a tick or tickFrame method is called 4 50 3 2 void RtWvlIn stop void Stop the audio input stream It may be necessary to use this method to avoid audio underflow problems if you wish to temporarily stop audio input 4 50 3 3 MY FLOAT RtWvIn tick void virtual Read out the average across one sample frame of data An StkError will be thrown if an error occurs during input Reimplemented from 4 50 3 4 MY FLOAT x RtWvIn tick MY FLOAT x vector unsigned int vectorSize virtual Read out vectorSize averaged sample frames of data in vector
65. SKRIN ee baa o eRe eS oS a A ee o 199 5 25 SKINI Messages 2 2 02 ee ee ee 199 5 26 C Files Used To Implement SKINI 200 eh ib ORES EE 200 bce Soi ee yk A ees 201 Sy hr Be eta E 202 5 30 Using SKINE cuecen ee ee EE os 204 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Chapter 1 STK Hierarchical Index 1 1 STK Class Hierarchy This inheritance list is sorted roughly but not completely alphabetically Stk trae 4 ete al eee ee ae BO ee RAS See oe 139 Bowlabl 24400 aii ide e ed Be ad 27 CHOTUS aros aa ee Echo t ae a a aiaiai a bees Envelope 444 saga 4 gagat 8 E a A ADS as Sg Gab DIA Eilte eo AE He be Be hm A e a e aa a A BiQuad oases aos ob ek Bee eee PSG RES eh Forms wep a4 o doe A a Delay 6 4 4 a09 rl a A a a A 35 DelayA eee 37 Delay 22 4 4 sid a aaa e dc e 39 OnePole 2 a 84 Oer tne ek Se Se aa ai al al eG eS eae eS ee a a 86 Pole Zero ee senos ee A da a 96 TwoPol e 0002 4 l do be ote e a a a da Sele ake 4 158 TWOL O et aa ae A A AAA 161 TASTE a aa A A AA a Banded WG tanda Soe de de Re a AA A s BlowBotl se ias aoaaa add aaan aad Sti bee da hs 21 BlowHole es aaa aana eres hh a A ta e 23 Bowed o guea cara a AI Sede 25 Brass ayas a a A a Glarinet 2 4 644 4 yea Ge aa daa DriimMmer aaa o Gace be Ea a a dA Dede es 41 STK Hierarchical Index Flutes 3 2448 44248444408 o be eee eee dE bE ES EM
66. Sand Paper 11 Coke Can 12 Next Mug 13 Penny Mug 14 Nickle Mug 15 Dime Mug 16 Quarter Mug 17 Franc Mug 18 Peso Mug 19 Big Rocks 20 Little Rocks 21 Tuned Bamboo Chimes 22 by Perry R Cook 1996 1999 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 54 Shakers Class Reference 125 4 54 2 Member Function Documentation 4 54 2 1 void Shakers noteOn MY_FLOAT instrument MY FLOAT amplitude virtual Start a note with the given instrument and amplitude Use the instrument numbers above converted to frequency values as if MIDI note numbers to select a particular instrument Reimplemented from The documentation for this class was generated from the following file e Shakers h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 126 STK Class Documentation 4 55 Simple Class Reference STK wavetable noise instrument include lt Simple h gt Inheritance diagram for Simple Instrmnt Public Methods Simp Class constructor e virtual 0 Class destructor e void clear Clear internal states e virtual void MY FLOAT frequency Set instrument parameters for a particular frequency e void 0 Start envelope toward on target e void 0 Start envelope toward off target e virtual void MY_FLOAT frequency
67. Saxofony Class Reference 121 4 53 Saxofony Class Reference STK faux conical bore reed instrument class include lt Saxofony h gt Inheritance diagram for Saxofony Instrmn Saxofony Public Methods MY FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency Saxofony Class destructor e void Tear Reset and clear all internal state e void MY FLOAT frequency Set instrument parameters for a particular frequency e void setBlowPosition MY FLOAT aPosition Set the blowing position between the air column terminations 0 0 1 0 e void startBlowing MY FLOAT amplitude MY FLOAT rate Apply breath pressure to instrument with given amplitude and rate of in crease e void MY FLOAT rate Decrease breath pressure with given rate of decrease e void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 122 STK Class Documentation e void fnoteOf MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY FLOAT tick Compute one output sample e void controlChange int number MY FLOAT value Perform the control change specified by number and value 0 0 128 0 4 53 1 Detailed Description STK faux conical bore reed instrument class This class implements a hybrid d
68. User Manual The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 Contents 1 STK Hierarchical Index 1 1 STK Class Hierarchy o 0000 2 STK Compound Index 2 1 STK Compound List o e 2020002 3 STK Page Index 3 1 STK Related Pages o 4 1 ADSR Class Reference o OPERE EEEE EEEL LIRE ee ee ee eee a ene less rra ee ee ee bis Hak h amp AA 4 6 BlowHole Class Reference o NAAA A 4 8 BowTabl Class Reference o bet Eee oan a BAAR EEA SA an a eee ee eee 4 11 Clarinet Class Reference o 2 0 00 4 12 Delay Class Reference o o a 4 13 DelayA Class Reference o o 4 14 DelayL Class Reference o ii CONTENTS 4 15 Drummer Class Reference o 41 A ee ah eee ee 43 Ge a a Sd a Gh Aad sae aed IRS Ph ede eet a 45 4 18 Filter Class Reference 0 00 00 00 000 AT 4 19 Flute Class Referencel o 50 E e Ca ae ES Ag a 52 4 21 FMVoices Class Reference o 55 MERRE E REE ee E E E E EA 57 Ks a ADA Se eee eas 60 4 24 Instrmnt Class Reference o o 62 4 25 JCRev Class Reference 0 02 2 ee 64 4 26 JetTabl Class Reference o o 65 dsd 67 A o
69. Y_FLOAT amplitude Start a note with the given instrument and amplitude virtual void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY_FLOAT tick Compute one output sample e virtual void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 54 1 Detailed Description PhISEM and PhOLIES class The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 124 STK Class Documentation PhISEM Physically Informed Stochastic Event Modeling is an algorithmic approach for simulating collisions of multiple independent sound producing ob jects This class is a meta model that can simulate a Maraca Sekere Cabasa Bamboo Wind Chimes Water Drops Tambourine Sleighbells and a Guiro PhOLIES Physically Oriented Library of Imitated Environmental Sounds is a similar approach for the synthesis of environmental sounds This class imple ments simulations of breaking sticks crunchy snow or not a wrench sandpa per and more Control Change Numbers e Shake Energy 2 e System Decay 4 e Number Of Objects 11 e Resonance Frequency 1 e Shake Energy 128 e Instrument Selection 1071 Maraca 0 Cabasa 1 Sekere 2 Guiro 3 Water Drops 4 Bamboo Chimes 5 Tambourine 6 Sleigh Bells 7 Sticks 8 Crunch 9 Wrench 10
70. ain Set the filter gain e MY FLOAT getGain void const Return the current filter gain e MY FLOAT void const Return the last computed output value e MY_FLOAT tick MY FLOAT sample Input one sample to the filter and return one output e MY FLOAT MY_FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector 4 4 1 Detailed Description STK biquad two pole two zero filter class This protected subclass implements a two pole two zero digital filter A method is provided for creating a resonance in the frequency response while maintaining a constant filter gain by Perry R Cook and Gary P Scavone 1995 2002 4 4 2 Member Function Documentation 4 4 2 1 void BiQuad setResonance MY_FLOAT frequency MY FLOAT radius bool normalize FALSE Sets the filter coefficients for a resonance at frequency in Hz The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 20 STK Class Documentation This method determines the filter coefficients corresponding to two complex conjugate poles with the given frequency in Hz and radius from the z plane origin If normalize is true the filter zeros are placed at z 1 z 1 and the coefficients are then normalized to produce a constant unity peak gain indepen dent of the filter gain parameter The resulting filter frequency response has a resonance at t
71. al human modulation function by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Modulate h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 33 Moog Class Reference 79 4 33 Moog Class Reference STK moog like swept filter sampling synthesis class include lt Moog h gt Inheritance diagram for Moog Stk Instrmnt Sampler Moog Public Methods e Moog Class constructor e Moog Class destructor e virtual void MY FLOAT frequency Set instrument parameters for a particular frequency e virtual void noteOn MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude e void setModulationSpeed MY_FLOAT mSpeed Set the modulation vibrato speed in Hz e void setModulationDepth MY_FLOAT mDepth Set the modulation vibrato depth e virtual MY FLOAT tick Compute one output sample e virtual void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 80 STK Class Documentation 4 33 1 Detailed Description STK moog like swept filter sampling synthesis class This instrument uses one attack wave one looped wave and an envelope inherited from the class and adds two swee
72. and MIDI has been provided by Tim Stilson Bill Putnam and Gabriel Mal donado Legal and Ethical Notes This software was designed and created to be made publicly available for free primarily for academic purposes so if you use it pass it on with this documen tation and for free If you make a million dollars with it give us some If you make compositions with it put us in the program notes Some of the concepts are covered by various patents some known to us and likely others which are unknown Many of the ones known to us are administered by the Stanford Office of Technology and Licensing The good news is that large hunks of the techniques used here are public domain To avoid subtle legal issues we will not state what s freely useable here but we will try to note within the various classes where certain things are likely to be protected by patents Disclaimer STK is free and we do not guarantee anything We ve been hacking on this code for a while now and most of it seems to work pretty well But there surely are some bugs floating around Sometimes things work fine on one computer platform but not so fine on another FPU overflows and underflows cause very weird behavior which also depends on the particular CPU and OS Let us know about bugs you find and we ll do our best to correct them The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 180 STK Page Documentation 5 2 Class Doc
73. ary P Scavone 1995 2002 The documentation for this class was generated from the following file e HevyMetl h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 62 STK Class Documentation 4 24 Instrmnt Class Reference STK instrument abstract base class include lt Instrmnt h gt Inheritance diagram for Instrmnt Stk Instrmnt BandedWG BlowBotl BlowHole Bowed Brass Clarinet Drummer Flute FM Ld Mesh2D Modal Plucked PluckTwo ee Resonate Sampler Saxofony Shakers Simple Sitar StifKarp Public Methods e stom 0 Default constructor e virtual Class destructor The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 24 Instrmnt Class Reference e virtual void noteOn MY_FLOAT frequency MY_ FLOAT amplitude 0 Start a note with the given frequency and amplitude e virtual void MY_FLOAT amplitude 0 Stop a note with the given amplitude speed of decay e virtual void set Frequency MY FLOAT frequency Set instrument parameters for a particular frequency e MY FLOAT lastOut const Return the last output value e virtual MY FLOAT tick 0 Compute one output sample e
74. been possible Since it does not it can t be used to poll STDIN I am using a thread to acquire messages from STDIN which sends these messages via a socket connection to the message socket server Perhaps in the future it will be possible to simplify things by Perry R Cook and Gary P Scavone 1995 2002 4 29 2 Constructor amp Destructor Documentation 4 29 2 1 Messager Messager int inputMask 0 Constructor performs initialization based on an input mask The default constructor is set to read input from a SKINI scorefile The flags STK_MIDI STK_PIPE and STK_SOCKET can be OR ed together in any com bination for multiple realtime input source parsing For realtime input types an StkError can be thrown during instantiation 4 29 3 Member Function Documentation 4 29 3 1 long Messager nextMessage void Check for a new input message and return the message type Return type values greater than zero represent valid messages If an input scorefile has been completely read or all realtime input sources have closed a negative value is returned If the return type is zero no valid messages are present The documentation for this class was generated from the following file e Messager The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 30 Modal Class Reference 73 4 30 Modal Class Reference STK resonance model instrument include lt Modal h gt Inheritance diagra
75. bl Stk Public Methods 0 Default constructor e BowTab Class destructor void MY_FLOAT aValue Set the table offset value e void MY_FLOAT aValue Set the table slope value e MY FLOAT lastOut void const Return the last output value e MY FLOAT tick const MY FLOAT input Return the function value for input e MY FLOAT MY_FLOAT vector unsigned int vectorSize Take vectorSize inputs and return the corresponding function values in vec tor 4 8 1 Detailed Description STK bowed string table class The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 28 STK Class Documentation This class implements a simple bowed string non linear function as described by Smith 1986 by Perry R Cook and Gary P Scavone 1995 2002 4 8 2 Member Function Documentation 4 8 2 1 void BowTabl setOffset MY_FLOAT aValue Set the table offset value The table offset is a bias which controls the symmetry of the friction If you want the friction to vary with direction use a non zero value for the offset The default value is zero 4 8 2 2 void BowTabl setSlope MY FLOAT aValue Set the table slope value The table slope controls the width of the friction pulse which is related to bow force 4 8 2 3 MY FLOAT BowTabl tick const MY FLOAT input Return the function value for input The function input represents differential string to bow velocity Th
76. blems for old personal STK code but it was necessary to make future ports easier Expanded and cleaned the Shakers class New BowedBar algorithm class Fixed Linux MIDI input bug Fixed MIDI status masking problem in Windows OS type defines now in Makefile New RAWWAVE_PATH define in Object h Syntmono project pulled out to separate directory and cleaned up Socketing capabilities under Unix as well as Windoze Multiple simultaneous socket client connections to STK servers now pos sible MD2SKINI now can merge MIDI and piped messages under Irix and Linux for TCL gt MD2SKINI gt syntmono control Defined INT16 and INT32 types and fixed various and classes The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 4 Release Notes 183 Updated Mat WvIn and MatWvOut for new MAT file documentation from Matlab New demo Tcl Tk GUI TclDemo tcl Minor fixes to FM behavior Added record duplex capabilities to RTSoundIO Linux SGI and Win doze Fixed bugs in WavWvOut and MatWvOut header specifications Added RawWvOut class New WvlIn class with RawWvIn SndWvIn WavWvIn MatWvIn and RTWvIn subclasses Removed RawWave RawShot RawInterp and RawLoop classes sup planted by RawWvIn Multi channel data support in and classes using MY_ MULTI data type pointer to MY_FLOAT and the methods mtick and mlastOutput Now writing to primary buffer under Windoze when allow
77. cavone 1995 2002 4 26 JetTabl Class Reference 65 4 26 JetTabl Class Reference STK jet table class include lt JetTabl h gt Inheritance diagram for Jet Tabl Stk JetTabl Public Methods paT 0 Default constructor e JT O Class destructor e MY FLOAT lastOut const Return the last output value e MY FLOAT MY_FLOAT input Return the function value for input e MY FLOAT MY_FLOAT vector unsigned int vectorSize Take vectorSize inputs and return the corresponding function values in vec tor 4 26 1 Detailed Description STK jet table class This class implements a flue jet non linear function computed by a polynomial calculation Contrary to the name this is not a table Consult Fletcher and Rossing Karjalainen Cook and others for more informa tion by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 66 STK Class Documentation e JetTabl h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 27 Mandolin Class Reference 67 4 27 Mandolin Class Reference STK mandolin instrument model class include lt Mandolin h gt Inheritance diagram for Mandolin St Instr PluckTwo Mandolin Public Methods e MY FLOAT lowestFrequency Class c
78. cavone 1995 2002 INDEX 223 openFile 175 tick E tickFrame 175 WvOut 175 WVOUT_AIF 176 WVOUT MAT 17 WVOUT RAW 17 WVOUT SND 17 WVOUT WAV 17 WVOUT_AIF WvOut WVOUT_MAT WvOut WVOUT_RAW WvOut WVOUT_SND WvOut WVOUT_WAV WvOut E OLD E Ee The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002
79. class implements a simple brass instrument waveguide model a la Cook TBone HosePlayer This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers e Lip Tension 2 Slide Length 4 Vibrato Frequency 11 Vibrato Gain 1 Volume 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Brass h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 10 Chorus Class Reference 31 4 10 Chorus Class Reference STK chorus effect class include lt Chorus h gt Inheritance diagram for Chorus Stk Public Methods MY_FLOAT baseDelay Class constructor taking the longest desired delay length Chon Class destructor e void clear Reset and clear all internal state e void setModDepth MY _FLOAT depth Set modulation depth e void setModFrequency MY FLOAT frequency Set modulation frequency e void MY FLOAT mix Set the mixture of input and processed levels in the output 0 0 input only 1 0 processed only e MY FLOAT lastOut const Return the last output value e MY FLOAT JlastOutLeft const Return the last left output value e MY FLOAT JlastOutRight const Return the last right output value The Synthesis ToolKit in C by Perry R Cook and Gary P
80. ctor e void void Start the audio input stream e void void Stop the audio input stream MY FLOAT lastOut void const Return the average across the last output sample frame e MY FLOAT tick void Read out the average across one sample frame of data e MY FLOAT MY_FLOAT vector unsigned int vectorSize Read out vectorSize averaged sample frames of data in vector e const MY_FLOAT void const Return a pointer to the last output sample frame The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 114 STK Class Documentation e const MY FLOAT void Return a pointer to the next sample frame of data e MY_FLOAT MY_FLOAT xframeVector unsigned int frames Read out sample frames of data to frameVector 4 50 1 Detailed Description STK realtime audio input class This class provides a simplified interface to RtAudio for realtime audio input It is a protected subclass of RtWvln supports multi channel data in interleaved format It is important to distinguish the tick methods which return samples produced by averaging across sample frames from the tickFramel methods which return pointers to multi channel sample frames For single channel data these methods return equivalent values by Perry R Cook and Gary P Scavone 1995 2002 4 50 2 Constructor Destructor Documentation 4 50 2 1 RtWvIn RtWvIn int nChannels 1 MY_FLOAT sample
81. ctor unsigned int vectorSize Output each sample in vector to all channels in vectorSize sample frames The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 51 RtWvOut Class Reference 117 e void const MY FLOAT xframeVector unsigned int frames 1 Output the frameVector of sample frames of the given length 4 51 1 Detailed Description STK realtime audio output class This class provides a simplified interface to RtAudio for realtime audio output It is a protected subclass of RtWvOut supports multi channel data in interleaved format It is important to distinguish the tick methods which output single samples to all channels in a sample frame from the method which takes a pointer to multi channel sample frame data by Perry R Cook and Gary P Scavone 1995 2002 4 51 2 Constructor Destructor Documentation 4 51 2 1 RtWvOut RtWvOut unsigned int nChannels 1 MY_FLOAT sampleRate Stk sampleRate int device 0 int bufferFrames RT_BUFFER SIZE int nBuffers 4 Default constructor The device argument is passed to RtAudio during instantiation The default value zero will select the default device on your system or the first device found meeting the specified parameters On systems with multiple sound cards devices values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API The de fau
82. d Vibrato Frequency 11 Gain 1 Bow Velocity 128 Set Striking 64 Instrument Presets 16 Uniform Bar 0 Tuned Bar 1 Glass Harmonica 2 Tibetan Bowl 3 by Georg Essl 1999 2002 Modified for Stk 4 0 by Gary Scavone The documentation for this class was generated from the following file e BandedWG h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 16 STK Class Documentation 4 3 BeeThree Class Reference STK Hammond oid organ FM synthesis instrument include lt BeeThree h gt Inheritance diagram for BeeThree t Instr BeeThree PHH Public Methods BeeT 0 Class constructor ra Class destructor e void MY FLOAT frequency MY FLOAT amplitude Start a note with the given frequency and amplitude e MY _FLOAT tick Compute one output sample 4 3 1 Detailed Description STK Hammond oid organ FM synthesis instrument This class implements a simple 4 operator topology also referred to as algorithm 8 of the TX81Z Algorithm 8 is Ts 2 AM gt Out The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 3 BeeThree Class Reference 17 Control Change Numbers Operator 4 feedback Gain 2 Operator 3 Gain 4 LFO Speed 11 LFO Depth 1 e ADSR 2 amp 4 Target 128 The basic Chowning Stanford FM patent expired in 1995 but there exist follow on
83. d depart 5 23 MIDI Compatibility SKINI was designed to be MIDI compatible wherever possible and extend MIDI in incremental then maybe profound ways Differences from MIDI and motivations include e Text based messages are used with meaningful names wherever possi ble This allows any language or system capable of formatted printing to generate SKINI Similarly any system capable of reading in a string and turning delimited fields into strings floats and ints can consume for control More importantly humans can actually read and even write if they want SKIN files and streams Use an editor and search replace or macros to change a channel or control number Load a SKIN score into a spread sheet to apply transformations to time control parameters MIDI velocities etc Put a monkey on a special typewriter and get your next great work Life s too short to debug bit nybble packed variable length mumble messages Disk space gets cheaper available bandwidth increases music takes up so little space and bandwidth compared to video and grapics Live a little Floating point numbers are used wherever possible Note Numbers Veloc ities Controller Values and Delta and Absolute Times are all represented and scanned as ASCII double precision floats MIDI byte values are pre served so that incoming MIDI bytes from an interface can be put directly into SKIN messages 60 0 or 60 is middle C 127 0 or 127 is maximum velocity etc
84. d values which instruct the parser as to what the message types are and what the fields mean for those message types This table is compiled and linked into applications using SKINI but could be dynamically loaded and changed in a future version of SKINI 5 27 SKINI Messages and the SKINI Parser The parser isn t all that smart but neither am I Here are the basic rules governing a valid SKINI message e If the first non delimiter see below character in a SKINI string is that line is treated as a comment and echoed to stdout e If there are no characters on a line that line is treated as blank and echoed to stdout Tabs and spaces are treated as non characters e Spaces commas and tabs delimit the fields in aJSKINI message line We might allow for multiple messages per line later using the semicolon but probably not A series of lines with deltaTimes of 0 0 denotes simultaneous The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 28 A Short SKINI File 201 events For read ability multiple messages per line doesn t help much so it s unlikely to be supported later e The first field must be a message name like NoteOn These might become case insensitive in future versions so don t plan on exciting clever overloading of names like noTeOn being different from NoTeON There can be a number of leading spaces or tabs but don t exceed 32 or so e The second f
85. data in vector const MY FLOAT void const Return a pointer to the last output sample frame The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 48 RtDuplex Class Reference 109 e MY FLOAT MY FLOAT xframeVector unsigned int frames 1 Output sample frames from frameVector and return new input frames in frameVector 4 48 1 Detailed Description STK realtime audio input output class This class provides a simplified interface to RtAudio for realtime audio in put output It is also possible to achieve duplex operation using separate and Rt WvOut classes but this class ensures better input output syn cronization RtDuplex supports multi channel data in interleaved format It is important to distinguish the tick methods which output single samples to all channels in a sample frame and return samples produced by averaging across sample frames from the tickFrame methods which take return pointers to multi channel sample frames by Perry R Cook and Gary P Scavone 1995 2002 4 48 2 Constructor amp Destructor Documentation 4 48 2 1 RtDuplex RtDuplex int nChannels 1 MY_FLOAT sampleRate Stk sampleRate int device 0 int bufferFrames RT_BUFFER_SIZE int nBuffers 2 Default constructor The device argument is passed to RtAudio during instantiation The default value zero will select the default device on your system or the first device found meet
86. data to a WAV formatted sound file called myfile wav Typing demo without any arguments will provide a full program usage description The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 11 Demo Realtime Use 189 5 11 Demo Realtime Use STK realtime audio and MIDI input output and realtime SKINI control input via socketing support is provided for Linux SGI and Windows95 98 2000 XP operating systems STK realtime control input via piping is possible under Linux SGI and Windows2000 XP only Control input and audio output options are typically specified as command line arguments to STK programs For example the demo program is invoked as demo instrument flags where instruments include those described above and flags can be any or all of or for realtime audio output ow lt file name gt for WAV soundfile output os lt file name gt for SND AU soundfile output om lt file name gt for MAT file output ip or is for realtime SKINI control input via piping or socketing respec tively e im lt file name gt for MIDI control input The lt ip gt and lt is gt flags must be used when piping or socketing realtime control data to an STK program The lt im gt flag must be used to read MIDI control input from your MIDI port Note that you can use all three input types simultaneously Assuming a successful compilation of the demo program typing cat scores bookert
87. data types are not sup ported If using MAT files data should be saved in an array with each data channel filling a matrix row by Perry R Cook and Gary P Scavone 1995 2002 4 72 2 Constructor amp Destructor Documentation 4 72 2 1 WvIn WvIn const char x fileName bool raw FALSE Overloaded constructor for file input An StkError will be thrown if the file is not found its format is unknown or a read error occurs 4 72 3 Member Function Documentation 4 72 3 1 void WvIn openFile const char fileName bool raw FALSE Open the specified file and load its data An StkError will be thrown if the file is not found its format is unknown or a read error occurs The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 72 WvIn Class Reference 171 4 72 3 2 void WvIn normalize void Normalize data to a maximum of 1 0 For large incrementally loaded files with integer data types normalization is computed relative to the data type maximum No normalization is performed for incrementally loaded files with floating point data types 4 72 3 3 void WvIn normalize MY_FLOAT peak Normalize data to a maximum of peak For large incrementally loaded files with integer data types normalization is computed relative to the data type maximum peak marimum For incre mentally loaded files with floating point data types direct scaling by peak is performed 4 72 3 4 MY FL
88. delay line length e MY FLOAT void const Return the current delay line length e MY_FLOAT tick MY_FLOAT sample Input one sample to the delay line and return one output The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 40 STK Class Documentation 4 14 1 Detailed Description STK linear interpolating delay line class This Delay subclass implements a fractional length digital delay line using first order linear interpolation A fixed maximum length of 4095 and a delay of zero is set using the default constructor Alternatively the delay and maximum length can be set during instantiation with an overloaded constructor Linear interpolation is an efficient technique for achieving fractional delay lengths though it does introduce high frequency signal attenuation to vary ing degrees depending on the fractional delay setting The use of higher order Lagrange interpolators can typically improve minimize this attenuation char acteristic by Perry R Cook and Gary P Scavone 1995 2002 4 14 2 Member Function Documentation 4 14 2 1 void DelayL setDelay MY_FLOAT theDelay Set the delay line length The valid range for theDelay is from 0 to the maximum delay line length The documentation for this class was generated from the following file e DelayL h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 15 Drummer Class Reference 41
89. e Pluck the string with the given amplitude using the current frequency e virtual void MY_FLOAT frequency MY _FLOAT amplitude Start a note with the given frequency and amplitude e virtual void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e virtual MY_FLOAT tick Compute one output sample The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 40 Plucked Class Reference 93 4 40 1 Detailed Description STK plucked string model class This class implements a simple plucked string physical model based on the Karplus Strong algorithm This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others There exist at least two patents assigned to Stanford bearing the names of Karplus and or Strong by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Plucked h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 94 STK Class Documentation 4 41 PluckTwo Class Reference STK enhanced plucked string model class include lt PluckTwo h gt Inheritance diagram for PluckTwo S Instr PluckTwo Mandolin Public Methods e PluckT wo MY FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency e virtual 0 Class destructor e void
90. e The file specification is Perry s and his alone but it s all text so it shouldn t be to hard to figure out SKINI Synthesis toolKit Instrument Network Interface is like MIDI but allows for floating point control changes note numbers etc The following example causes a sharp middle C to be played with a velocity of 111 132 noteOn 60 01 111 13 See also Synthesis toolkit Instrument Network Interface SKINI by Perry R Cook and Gary P Scavone 1995 2002 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 132 STK Class Documentation 4 57 2 Member Function Documentation 4 57 2 1 long SKINI parseThis char aString Attempt to parse the given string returning the message type A type value equal to zero indicates an invalid message 4 57 2 2 long SKINI nextMessage void Parse the next message if a file is loaded and return the message type A negative value is returned when the file end is reached The documentation for this class was generated from the following file e SKINI h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 58 Socket Class Reference 133 4 58 Socket Class Reference STK TCP socket client server class include lt Socket h gt Inheritance diagram for Socket Stk Public Methods e int port 2006 Default constructor which creates a local socket server on port 2006 or the specified port number
91. e actual loop gain is set according to the frequency Because of high frequency loop filter roll off higher frequency settings have greater loop gains The documentation for this class was generated from the following file e PluckTwo h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 96 STK Class Documentation 4 42 PoleZero Class Reference STK one pole one zero filter class include lt PoleZero h gt Inheritance diagram for PoleZero Stk Filter Fite Public Methods Pez Default constructor creates a first order pass through filter Potze 0 Class destructor e void void Clears the internal states of the filter e void MY_FLOAT b0 Set the b 0 coefficient value e void MY_FLOAT bl Set the b 1 coefficient value e void MY FLOAT al Set the a 1 coefficient value e void MY_FLOAT coefficient Set the filter for allpass behavior using coefficient e void setBlockZero MY_FLOAT thePole 0 99 Create a DC blocking filter with the given pole position in the z plane e void MY FLOAT theGain The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 42 PoleZero Class Reference 97 Set the filter gain MY FLOAT void const Return the current filter gain MY FLOAT void const Return the last computed output value MY_FLOAT MY_FLOAT sample Input one sample to the filter and return one outpu
92. e documentation for this class was generated from the following file e BowTabl h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 9 Brass Class Reference 29 4 9 STK Brass Class Reference simple brass instrument class include lt Brass h gt Inheritance diagram for Brass Instrmnt Public Methods MY_FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency EBs 0 Class destructor void Tear Reset and clear all internal state void MY FLOAT frequency Set instrument parameters for a particular frequency void MY FLOAT frequency Set the lips frequency void start Blowing MY FLOAT amplitude MY FLOAT rate Apply breath pressure to instrument with given amplitude and rate of in crease void MY FLOAT rate Decrease breath pressure with given rate of decrease void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 30 STK Class Documentation e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY FLOAT tick Compute one output sample e void controlChange int number MY FLOAT value Perform the control change specified by number and value 0 0 128 0 4 9 1 Detailed Description STK simple brass instrument class This
93. e mesh MY_FLOAT Compute one output sample without adding energy to the mesh MY_FLOAT MY_FLOAT input Input a sample to the mesh and compute one output sample void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 28 1 Detailed Description Two dimensional rectilinear waveguide mesh class This class implements a rectilinear two dimensional digital waveguide mesh structure For details see Van Duyne and Smith Physical Modeling with the 2 D Digital Waveguide Mesh Proceedings of the 1993 International Computer Music Conference This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers X Dimension 2 Y Dimension 4 Mesh Decay 11 X Y Input Position 1 by Julius Smith 2000 2002 Revised by Gary Scavone for STK 2002 The documentation for this class was generated from the following file e Mesh2D h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 29 Messager Class Reference 71 4 29 Messager Class Reference STK input control message parser include lt Messager h gt Inheritance diagram for Messager Messager Public Methods int inputMask 0 Constructor performs initialization based on an input mask Ex Class destructor long pere void Check for a new input
94. e virtual MY FLOAT tick MY F LOAT xvector unsigned int vectorSize Take vectorSize inputs compute the same number of outputs and return them in vector 4 46 1 Detailed Description STK abstract reverberator parent class This class provides common functionality for STK reverberator subclasses by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Reverb h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 106 STK Class Documentation 4 47 Rhodey Class Reference STK Fender Rhodes electric piano FM synthesis instrument include lt Rhodey h gt Inheritance diagram for Rhodey Instrmn E 2 e e A lt er Public Methods Rhodey Class constructor Rhodey Class destructor e void MY_FLOAT frequency Set instrument parameters for a particular frequency e void MY_FLOAT frequency MY _FLOAT amplitude Start a note with the given frequency and amplitude e MY _FLOAT tick Compute one output sample 4 47 1 Detailed Description STK Fender Rhodes electric piano FM synthesis instrument This class implements two simple FM Pairs summed together also referred to as algorithm 5 of the TX81Z The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 47 Rhodey Class Reference 107 Algorithm 5 is 4 gt 3 gt Out 2 gt 1
95. ed by hardware Cleaned up Object h a bit Pulled various utility and thread functions out of syntmono cpp to aid readability of the code 5 4 5 Version 2 02 Created RawWave abstract class with subclasses of RawLoop looping rawwave oscillator RawShot non looping non interpolating rawwave player used to be RawWvIn and RawInterp looping or non looping interpolating rawwave player used to be RawWave Modified DrumSynt to correctly handle sample rates different than 22050 Hz Modified syntmono parsing vs tick routine so that some ticking occurs between each message When multiple messages are waiting to be pro cessed the time between message updates is inversely proportional to the number of messages in the buffer Fixed DirectSound playback bug in WinXX distribution Sound was being played at 8 bit 22 kHz in all cases Playback is now 16 bit and dependent on SRATE Fixed bug in MD2SKINI which prevented some NoteOff statements from being output This distribution includes an example STK project musl51 which demonstrates a means for keeping a user s personal projects separate from the main distribution This is highly recommended in order to simplify upgrades to future STK releases The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 184 STK Page Documentation 5 4 6 Version 2 Unification of the capabilities of STK across the various platforms All of the previous SGI
96. ed from The documentation for this class was generated from the following file e PoleZero h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 43 PRCRev Class Reference 99 4 43 PRCRev Class Reference Perry s simple reverberator class include lt PRCRev h gt Inheritance diagram for PRCRev Public Methods e void O Reset and clear all internal state e MY FLOAT MY_FLOAT input Compute one output sample 4 43 1 Detailed Description Perry s simple reverberator class This class is based on some of the famous Stanford CCRMA reverbs KipRev which were based on the Chowning Moorer Schroeder reverberators using networks of simple allpass and comb delay filters This class implements two series allpass units and two parallel comb filters by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e PRCRev h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 100 STK Class Documentation 4 44 ReedTabl Class Reference STK reed table class include lt ReedTabl h gt Inheritance diagram for ReedTabl Stk ReedTabl Public Methods Recan 0 Default constructor e ReedTabl Class destructor void MY_FLOAT aValue Set the table offset value e void MY FLOAT aValue Set the table slope value e MY FLOAT lastOut const Retu
97. efinition is necessary for all Windows systems A distribution of the release is available with precompiled binaries for all the projects In order for these binaries to function properly your system must have the DirectX 5 0 or higher runtime libraries installed available from Microsoft Further the effects project requires that your sound The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 8 Control Data 187 card and drivers provide full duplex mode capabilities Visual C 6 0 project file are provided in each project directory as well should you wish to compile your own binaries It is important to link with the non debug libraries when compiling release program versions and debug libraries when compiling debug program versions e WindowsNT I ve given up trying to make things work under NT You ll have to switch to Windows 2000 which does seem to work 5 8 Control Data All STK programs in this distribution take input control data in the form of SKINI or MIDI messages only The Messager class unifies the various means of acquiring control data under a single easy to use set of functions The way that SKTNT messages can be sent to the programs is dependent upon the operating system in use as well as whether the program is running in realtime or not In general it is possible to 1 Redirect or pipe SKINI scorefiles to an executable 2 Pipe realtime SKINI input
98. ence 55 4 21 FMVoices Class Reference STK singing FM synthesis instrument include lt FMVoices h gt Inheritance diagram for FMVoices S Instr exl FMVoices Public Methods 0 Class constructor ENV 0 Class destructor virtual void MY FLOAT frequency Set instrument parameters for a particular frequency void MY FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude MY FLOAT Compute one output sample virtual void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 21 1 Detailed Description STK singing synthesis instrument The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 56 STK Class Documentation This class implements 3 carriers and a common modulator also referred to as algorithm 6 of the TX81Z Algorithm 6 is gt 1 4 gt 2 gt Out gt 3 Control Change Numbers e Vowel 2 e Spectral Tilt 4 e LFO Speed 11 e LFO Depth 1 e ADSR 2 amp 4 Target 128 The basic Chowning Stanford FM patent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e FMVoices h
99. ent value e void MY_FLOAT thePole Set the pole position in the z plane e void MY_FLOAT theGain Set the filter gain e MY_FLOAT void const The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 36 OnePole Class Reference 85 Return the current filter gain e MY FLOAT lastOut void const Return the last computed output value e MY_FLOAT tick MY FLOAT sample Input one sample to the filter and return one output e MY FLOAT MY FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector 4 36 1 Detailed Description STK one pole filter class This protected subclass implements a one pole digital filter A method is provided for setting the pole position along the real axis of the z plane while maintaining a constant peak filter gain by Perry R Cook and Gary P Scavone 1995 2002 4 36 2 Member Function Documentation 4 36 2 1 void OnePole setPole MY FLOAT thePole Set the pole position in the z plane This method sets the pole position along the real axis of the z plane and normal izes the coefficients for a maximum gain of one A positive pole value produces a low pass filter while a negative pole value produces a high pass filter This method does not affect the filter gain value 4 36 2 2 void OnePole setGain MY_FLOAT theGain virtual Set the filter gain The gain is applied a
100. er Longer bulk dumps soundfiles etc should be handled as a new message type pointing to a FileName or something else stored in the SK_STR field or as a new type of multi line message Here s a couple of lines from the SKINI tbl file Note0ff __SK_Note0ff_ SK_DBL SK_DBL NoteOn A __SK_NoteOn_ SK_DBL SK_DBL ControlChange gt __SK_ControlChange_ SK_INT SK_DBL g g Volume __8K_ControlChange_ __SK_Volume_ SK_DBL g StringDamping gt __SK_ControlChange_ __SK_StringDamping_ SK_DBL StringDetune A __SK_ControlChange_ SK_StringDetune_ SK_DBL gt o The first three are basic MIDI messages The first two would cause the parser after recognizing a match of the string NoteOff or NoteOn to set the mes sage type to 128 or 144 __SK_NoteOff and _SK_NoteOn_ are defined in the file SKINI msg to be the MIDI byte value without channel of the actual MIDI messages for NoteOn and NoteOff The parser would then set the time or delta time this is always done and is therefore not described in the SKINI Message Struct The next two fields would be scanned as double precision floats and assigned to the byte Two and byteThree variables of the parser The remainder of the line is stashed in the remainderString variable The ControlChange spec is basically the same as NoteOn and NoteOff but the second data byte is set to an integer for checking later as to what MIDI control is being
101. er The func tionality needed for realtime audio and MIDI input output as well as realtime control message acquistion is inherently platform and operating system OS dependent STK classes which require specific platform OS support include Rt Audio FREW vOut REWeIn RiDuplex REMA Top Wein TepWvOut Socket and Thread These classes currently can only be compiled on Linux Irix and Windows except Windows NT systems using the __LINUX_0SS__ __LINUX_ ALSA__ _IRIX_AL__ or _WINDOWS_DS__ preprocessor definitions Without the realtime classes it is still possible to read scorefiles for control input and to read and write to from a variety of audio file formats WAV SND AIFF MAT file and RAW If compiling for a little endian host processor the _LITTLE_ENDIAN__ preprocessor definition should be provided 5 21 To Be Continued The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 198 STK Page Documentation 5 22 Synthesis toolKit Instrument Network In terface SKINI This describes the latest version 1 1 implementation of SKINI for the Synthesis Toolkit in C STK by Perry R Cook Too good to be true Have control and read it too A SKINI haiku Profound thanks to Dan Trueman Brad Garton and Gary Scavone for input on this revision Thanks also to MIDI the NeXT MusicKit ZIPI and all the creators and modifiers of these for good bases upon from which to build an
102. er setNumerator int nb MY FLOAT bCoefficients Set numerator coefficients An StkError can be thrown if nb is less than one Any previously set denomi nator coefficients are left unaffected Note that the default constructor sets the single denominator coefficient a 0 to 1 0 4 18 3 3 void Filter setDenominator int na MY_FLOAT aCoefficients Set denominator coefficients An StkError can be thrown if na is less than one or if the a0 coefficient is equal to zero Previously set numerator coefficients are unaffected unless a 0 is not equal to 1 in which case all coeffcients are normalized by a 0 Note that the default constructor sets the single numerator coefficient b 0 to 1 0 4 18 3 4 void Filter setGain MY FLOAT theGain virtual Set the filter gain The gain is applied at the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplemented in and Two The documentation for this class was generated from the following file e Filter hl The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 50 STK Class Documentation 4 19 Flute Class Reference STK flute physical model class include lt Flute h gt Inheritance diagram for Flute Instrmnt Public Methods MY_FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency EFI Class destructor void ear Reset and clear all i
103. estructor e void MY_FLOAT frequency Set instrument parameters for a particular frequency e void MY_FLOAT frequency MY _FLOAT amplitude Start a note with the given frequency and amplitude e MY _FLOAT tick Compute one output sample 4 71 1 Detailed Description STK Wurlitzer electric piano FM synthesis instrument This class implements two simple FM Pairs summed together also referred to as algorithm 5 of the TX81Z The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 71 Wurley Class Reference 167 Algorithm 5 is 4 gt 3 gt Out 2 gt 1 Control Change Numbers Modulator Index One 2 Crossfade of Outputs 4 LFO Speed 11 LFO Depth 1 e ADSR 2 amp 4 Target 128 The basic Chowning Stanford FM patent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file Marey The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 168 STK Class Documentation 4 72 WvIn Class Reference STK audio data input base class include lt WvIn h gt Inheritance diagram for WvIn Stk RtWvIn TcpWvIn WaveLoop Public Methods e We Default constructor const char file
104. functionality has been ported to Linux and Windows including realtime sound output and MIDI input MIDI input with optional time stamping supported on SGI Linux OSS device drivers only and Windows operating systems Time stamping under IRIX and Windows is quantized to milliseconds and under Linux to hundredths of a second Various Sound Output Options wav snd and mat Matlab MAT file soundfile outputs are supported on all operating systems I hacked out the MAT file structure so you don t have to include any platform specific libraries Realtime sound output is provided as well except under Ne XTStep Multiple Reverberator Implementations Reverb subclasses of and popular reverberator implementations from CCRMA have been written Perry s original reverb implementation still exists as All reverberators now take a T60 initializer argument MD2SKINI A program which parses a MIDI input stream and spits out code The output of MD2SKINI is typically piped into an STK instrument executable eg lt FONT FACE Geneva gt MD2SKINI syntmono Clarinet r i lt FONT gt In addition you can supply a file name argument to MD2SKINI and have it simultaneously record a SKIN score file for future reuse Modifications to Object h for OS_ TYPE compilation dependencies Make file automatically determines OS TYPE when invoked if you have the GNU makefile utilities installed on your system A single distribution for all platf
105. he following file e TwoZero h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 164 STK Class Documentation 4 70 WaveLoop Class Reference STK waveform oscillator class include lt WaveLoop h gt Inheritance diagram for WaveLoop WaveLoop Public Methods const char fileName bool raw FALSE Class constructor e virtual 0 Class destructor e void MY _FLOAT aFrequency Set the data interpolation rate based on a looping frequency e void MY FLOAT aTime Increment the read pointer by aTime samples modulo file size e void laddPhase MY FLOAT anAngle Increment current read pointer by anAngle relative to a looping frequency e void laddPhaseOftset MY FLOAT anAngle Add a phase offset to the current read pointer e const MY FLOATx void Return a pointer to the next sample frame of data The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 70 WaveLoop Class Reference 165 4 70 1 Detailed Description STK waveform oscillator class This class inherits from WvIn and provides audio file looping functionality WaveLoop supports multi channel data in interleaved format It is important to distinguish the tick methods which return samples produced by averaging across sample frames from the tickFramel methods which return pointers to multi channel sample frames For single channel data these methods return
106. he given frequency The closer the poles are to the unit circle radius close to one the narrower the resulting resonance width 4 4 2 2 void BiQuad setNotch MY_FLOAT frequency MY_FLOAT radius Set the filter coefficients for a notch at frequency in Hz This method determines the filter coefficients corresponding to two complex conjugate zeros with the given frequency in Hz and radius from the z plane origin No filter normalization is attempted 4 4 2 3 void BiQuad setEqualGainZeroes Sets the filter zeroes for equal resonance gain When using the filter as a resonator zeroes places at z 1 z 1 will result in a constant gain at resonance of 1 1 R where R is the pole radius setting 4 4 2 4 void BiQuad setGain MY FLOAT theGain virtual Set the filter gain The gain is applied at the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplemented from The documentation for this class was generated from the following file e BiQuad h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 5 BlowBotl Class Reference 21 4 5 BlowBotl Class Reference STK blown bottle instrument class include lt BlowBotl h gt Inheritance diagram for BlowBotl Stk l Instrmnt BlowBotl Public Methods 0 Class constructor e BlowBotl Class destructor e void clear Reset and clear all in
107. ial numbers or even unique tags for each event in a synthesis A 1 channel can be used as don t care omni or other functions depending on your needs and taste e All remaining fields are specified in the SKINI tbl file In general there are maximum two more fields which are either SK_INT long SK_DBL double float or SK_STR string The latter is the mechanism by which more arguments can be specified on the line but the object using SKINI must take that string apart retrived by using getRemainderString and scan it Any excess fields are stashed in remainderString 5 28 A Short SKINI File Howdy Welcome to SKINI by P Cook 1999 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 202 STK Page Documentation NoteOn 0 000082 2 55 82 NoteOff 1 000000 2 55 0 NoteOn 0 000082 2 69 82 StringDetune 0 100000 2 10 StringDetune 0 100000 2 30 StringDetune 0 100000 2 50 NoteOn 0 000000 2 69 82 StringDetune 0 100000 2 40 StringDetune 0 100000 2 22 StringDetune 0 100000 2 12 StringDamping 0 000100 2 0 0 NoteOn 0 000082 2 55 82 NoteOn 0 200000 2 62 82 NoteOn 0 100000 2 71 82 NoteOn 0 200000 2 79 82 NoteOff 1 000000 2 55 82 NoteOff 0 000000 2 62 82 NoteOff 0 000000 2 71 82 NoteOff 0 000000 2 79 82 StringDamping 4 000000 2 0 0 NoteOn 0 000082 2 55 82 NoteOn 0 200000 2 62 82 NoteOn 0 100000 2 71 82 NoteOn 0 200000 2 79 82 NoteOff 1 000000 2 55 82 NoteOff 0 000000 2 62 82 NoteOff
108. ic Methods e MY FLOAT sampleRate void Static method which returns the current STK sample rate e void setSampleRate MY_FLOAT newRate Static method which sets the STK sample rate The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 140 STK Class Documentation void unsigned char ptr Static method which byte swaps a 16 bit data type void unsigned char xptr Static method which byte swaps a 32 bit data type void unsigned char ptr Static method which byte swaps a 64 bit data type void unsigned long milliseconds Static cross platform method to sleep for a number of milliseconds Static Public Attributes const STK FORMAT const STK_FORMAT const STK_FORMAT const STK FORMAT const STK FORMAT Protected Methods e Stk void Default constructor e virtual void Class destructor Static Protected Methods e void handleError const char xmessage StkError TYPE type Function for error reporting and handling The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 60 Stk Class Reference 141 4 60 1 Detailed Description STK base class Nearly all STK classes inherit from this class The global sample rate can be queried and modified via Stk In addition this class provides error handling and byte swapping functions by Perry R Cook and Gary P Scavone 1995 2002 4 60 2 Member Function Documentation 4 60 2 1
109. ield must be a time specification in seconds A time field can be either delta time most common and the only one supported in version 0 8 or absolute time Absolute time messages have an appended to the beginning of the floating point number with no space So 0 10000 means delta time of 100 ms while 0 10000 means absolute time of 100 ms Absolute time messages make most sense in score files but could also be used for loose synchronization in a real time context Real time messages should be time ordered AND time correct That is if you ve sent 100 total delta time messages of 1 0 seconds and then send an absolute time message of 90 0 seconds or if you send two absolute time messages of 100 0 and 90 0 in that order things will get really fouled up The SKINI parser doesn t know about time however The WvOut device is the master time keeper in the Synthesis Toolkit so it should be queried to see if absolute time messages are making sense There s an example of how to do that later in this document Absolute times are returned by the parser as negative numbers since negative deltaTimes are not allowed e The third field must be an integer channel number Don t go crazy and think that this is just MIDI channel 0 15 which is supported The chan nel number is scanned as a long int Channels 0 15 are in general to be treated as MIDI channels After that it s wide open Channels could be socket numbers machine IDs ser
110. igital waveguide instrument that can generate a variety of wind like sounds It has also been referred to as the blowed string model The waveguide section is essentially that of a string with one rigid and one lossy termination The non linear function is a reed table The string can be blown at any point between the terminations though just as with strings it is impossible to excite the system at either end If the excitation is placed at the string mid point the sound is that of a clarinet At points closer to the bridge the sound is closer to that of a saxophone See Scavone 2002 for more details This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers Reed Stiffness 2 Reed Aperture 26 Noise Gain 4 Blow Position 11 Vibrato Frequency 29 Vibrato Gain 1 Breath Pressure 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Saxofony h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 54 Shakers Class Reference 123 4 54 Shakers Class Reference PhISEM and PhOLIES class include lt Shakers h gt Inheritance diagram for Shakers Instrmnt Public Methods e Shaker Class constructor e Shaker Class destructor virtual void fnoteOn MY_FLOAT instrument M
111. ilter A fixed maximum length of 4095 and a delay of 0 5 is set using the default constructor Alternatively the delay and maximum length can be set during instantiation with an overloaded constructor An allpass filter has unity magnitude gain but variable phase delay properties making it useful in achieving fractional delays without affecting a signal s fre quency magnitude response In order to achieve a maximally flat phase delay response the minimum delay possible in this implementation is limited to a value of 0 5 by Perry R Cook and Gary P Scavone 1995 2002 4 13 2 Member Function Documentation 4 13 2 1 void DelayA setDelay MY_FLOAT theDelay Set the delay line length The valid range for theDelay is from 0 5 to the maximum delay line length The documentation for this class was generated from the following file e DelayA h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 14 DelayL Class Reference 39 4 14 DelayL Class Reference STK linear interpolating delay line class include lt DelayL h gt Inheritance diagram for DelayL Stk Public Methods e DelayL Default constructor creates a delay line with maximum length of 4095 sam ples and zero delay e DelayL MY FLOAT theDelay long maxDelay Overloaded constructor which specifies the current and maximum delay line lengths EDO Class destructor e void MY FLOAT theDelay Set the
112. in 11 e Vibrato Frequency 7 e Volume 128 e Modal Presets 16 Marimba 0 Vibraphone 1 Agogo 2 Woodl 3 Reso 4 Wood2 5 Beats 6 Two Fixed 7 Clump 8 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e ModalBar h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 32 Modulate Class Reference 77 4 32 Modulate Class Reference STK periodic random modulator include lt Modulate h gt Inheritance diagram for Modulate Modulate Public Methods 0 Class constructor Mora Class destructor e void reset Reset internal state e void MY FLOAT aRate Set the periodic vibrato rate or frequency in Hz e void setVibratoGain MY FLOAT aGain Set the periodic vibrato gain e void MY FLOAT aGain Set the random modulation gain e MY FLOAT tick Compute one output sample e virtual MY _FLOAT tick MY F LOAT xvector unsigned int vectorSize Return vectorSize outputs in vector MY FLOAT lastOut const Return the last computed output value The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 78 STK Class Documentation 4 32 1 Detailed Description STK periodic random modulator This class combines random and periodic modulations to give a nice natur
113. ine wave file input new WaveLoop sinewave raw TRUE Define and open the default realtime output device for one channel playback output new RtWvOut 1 catch StkError goto cleanup F input gt setFrequency 440 0 Play the oscillator for 40000 samples for int i 0 i lt 40000 i 4 try output gt tick input gt tick catch StkError amp goto cleanup cleanup delete input delete output return 0 In this particular case we simply exit the program if an error occurs an error message is automatically printed to stderr A more refined program might The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 196 STK Page Documentation attempt to recover from or fix a particular problem and if successful continue processing 5 19 Compiling 5 19 1 Linux In general you will probably want to use a Makefile for your STK programs and projects For this particular program however the following will suffice on a linux system g Wall D__LINUX_OSS_ This assumes you ve set up a directory that includes the files sineosc cpp the rawwave file sinewave raw and the header and source files for the classes Stk and RtAudio There are other more convenient means for structuring projects that will be discussed later Most linux systems currently come installed with the OSS audio hardware drivers If your system instead has ALSA
114. ing the specified parameters On systems with multiple sound cards devices values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API The de fault buffer size of RT _BUFFER SIZE is defined in Stk h An will be thrown if an error occurs duing instantiation 4 48 3 Member Function Documentation 4 48 3 1 void RtDuplex start void Start the audio input output stream The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 110 STK Class Documentation The stream is started automatically if necessary when a tick or tickFrame method is called 4 48 3 2 void RtDuplex stop void Stop the audio input output stream It may be necessary to use this method to avoid audio overflow underflow prob lems if you wish to temporarily stop the audio stream 4 48 3 3 MY FLOAT RtDuplex tick const MY_FLOAT sample Output a single sample to all channels in a sample frame and return the average across one new input sample frame of data An StkError will be thrown if an error occurs during input output 4 48 3 4 MY FLOAT RtDuplex tick MY_FLOAT x vector unsigned int vectorSize Output each sample in vector to all channels per frame and return averaged input sample frames of new data in vector An StkError will be thrown if an error occurs during input output 4 48 3 5 MY FLOAT RtDuplex tickFrame MY FLOAT frame Vecto
115. ionDepth MY_FLOAT mDepth Set the modulation depth e void MY FLOAT cVal Set the value of controll e void setControl2 MY_FLOAT cVal Set the value of controll e void Start envelopes toward on targets e void Start envelopes toward off targets e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e virtual MY FLOAT tick 0 Pure virtual function must be defined in subclasses e virtual void controlChange int number MY FLOAT value Perform the control change specified by number and value 0 0 128 0 4 20 1 Detailed Description STK abstract FM synthesis base class This class controls an arbitrary number of waves and envelopes determined via a constructor argument Control Change Numbers e Control One 2 e Control Two 4 e LFO Speed 11 e LFO Depth 1 e JADSR 2 amp 4 Target 128 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 54 STK Class Documentation The basic Chowning Stanford FM patent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e FM h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 21 FMVoices Class Refer
116. iven amplitude speed of decay The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 34 STK Class Documentation e MY FLOAT tick Compute one output sample e void controlChange int number MY FLOAT value Perform the control change specified by number and value 0 0 128 0 4 11 1 Detailed Description STK clarinet physical model class This class implements a simple clarinet physical model as discussed by Smith 1986 McIntyre Schumacher Woodhouse 1983 and others This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers Reed Stiffness 2 Noise Gain 4 Vibrato Frequency 11 Vibrato Gain 1 Breath Pressure 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Clarinet The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 12 Delay Class Reference 35 4 12 Delay Class Reference STK non interpolating delay line class include lt Delay h gt Inheritance diagram for Delay Stk Public Methods Pao Default constructor creates a delay line with maximum length of 4095 sam ples and zero delay long theDelay long maxDelay Overloaded constructor which specifies the current and maximum delay line lengths virtual Class destruc
117. ket connection by selecting Socket under the Communi cations menu item in the Tcl Tk GUI Note that it is possible to specify a hostname when establishing the socket connection from the socket client Thus the STK socket server program and the Tcl Tk GUI need not necessarily reside on the same computer 5 13 Realtime MIDI Control Input On all supported realtime platforms you can direct realtime MIDI input to the STK by typing demo Clarinet or im The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 14 The Mail List 191 5 14 The Mail List An mailing list has been set up to facilitate communication among STK users Subscribing to this list is your best way of keeping on top of new releases bug fixes and various user developments To join send a message to lt stk request ccrma stanford edu gt with the con tents subscribe To be removed from the list send a message to lt stk request ccrma stanford edu gt with the contents unsubscribe The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 192 STK Page Documentation 5 15 System Requirements General e A MIDI interface to use MIDI input controls NOTE This may be built into the soundcard on your computer version 8 0 or higher to use the simple Tcl Tk GUIs provided with the STK distribution available free over the WWW for all supported realtime platforms Linux specific
118. lass contains an excitation wavetable an envelope an oscillator and N resonances non sweeping filters where N is set during instantiation by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Modal h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 31 ModalBar Class Reference 75 4 31 ModalBar Class Reference STK resonant bar instrument class include lt ModalBar h gt Inheritance diagram for ModalBar S Instr Modal ModalBar Public Methods 0 Class constructor Moda o Class destructor e void setStickHardness MY_FLOAT hardness Set stick hardness 0 0 1 0 e void setStrikePosition MY FLOAT position Set stick position 0 0 1 0 e void int preset Select a bar preset currently modulo 9 e void setModulationDepth MY_FLOAT mDepth Set the modulation vibrato depth e void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 76 STK Class Documentation 4 31 1 Detailed Description STK resonant bar instrument class This class implements a number of different struck bar instruments It inherits from the class Control Change Numbers e Stick Hardness 2 e Stick Position 4 e Vibrato Ga
119. lay line based effects algorithms 3 The ragamatic project is just cool Fire it up and be enlightened 4 The examples project contains several simple programs which demon strate audio input output as well as the use of the audio internet stream ing classes The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 186 STK Page Documentation 5 7 Compiling e Generic non realtime Most STK classes are operating system in dependent and can be compiled using any current C compiler STK assumes big endian host byte order by default so if your system is little endian i e Intel processor you must provide the _LITTLE_ENDIAN__ preprocessor definition to your compiler The demo project will compile without realtime support allowing the use of SKTNI scorefiles for input control and output to a variety of soundfile formats The following classes cannot be used without realtime support RtAudio Because of this it is not possible to compile the effects ragamatic and most of the examples projects for non realtime use e Linux Realtime support is enabled with either the _LINUX_OSS__ or _ LINUX_ALSA__ preprocessor definitions which are used to select the under lying audio MIDI system API Realtime programs must also link with the pthread library When using the ALSA API it is also necessary to link with the asound library In addition the _LITTLE_ENDIAN__ preprocessor definition is necessary if co
120. le set Vibrato Bowed set VibratoGain Modulate set VibratoRate Modulate setZero OneZero Shakers Shakers controlChange 123 noteOff noteOn es tick Simple Simple clear controlChange 127 keyOff keyOn noteOff noteOn setFrequency 126 Simple tick Sitar Sitar noteOn pluck setFrequency 128 Sitar tick SKINI 130 SKINI 130 getByteThree 131 getByteThreelnt getByteT wo 130 getByteTwolnt get Channel getDelta getMessageTypeString 131 getRemainderString 131 get Type 130 nextMessage parseThis SKINI whatsThisController 131 whats ThisType 131 sleep Stk Socket Socket accept close connect 135 isValid port read Buffer 134 setBlocking 134 Socket socket writeBufter 134 socket Socket start RtDuplex 109 RtWvin o Thread startBlowing BlowBotl BlowHote Ba Brass Clarinet The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 220 INDEX Flute Saxofony 121 start Bowing BandedWG Bowed StifKarp StifKarp 137 clear 137 controlChange 138 noteOff noteOn pluck set Frequency 137 set PickupPosition 137 setStretch StifKarp tick StifKarp setBaseLoopGain Stk Stk handleError sampleRate setSampleRate sleep 140 Stk STK FLOAT32 STK_FLOAT64 STK SINT16 STK_SINT32 141 STK_SINTS s
121. lt buffer size of RT_BUFFER SIZE is defined in Stk h An will be thrown if an error occurs duing instantiation 4 51 3 Member Function Documentation 4 51 3 1 void RtWvOut start void Start the audio output stream The stream is started automatically if necessary when a tick or tickFrame method is called The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 118 STK Class Documentation 4 51 3 2 void RtWvOut stop void Stop the audio output stream It may be necessary to use this method to avoid undesireable audio buffer cycling if you wish to temporarily stop audio output 4 51 3 3 void RtWvOut tick const MY FLOAT sample virtual Output a single sample to all channels in a sample frame An StkError will be thrown if an error occurs during output Reimplemented from 4 51 3 4 void RtWvOut tick const MY_FLOAT x vector unsigned int vectorSize virtual Output each sample in vector to all channels in vectorSize sample frames An StkError will be thrown if an error occurs during output Reimplemented from 4 51 3 5 void RtWvOut tickFrame const MY FLOAT frame Vector unsigned int frames 1 virtual Output the frame Vector of sample frames of the given length An StkError will be thrown if an error occurs during output Reimplemented from The documentation for this class was generated from the following file e RtWvOut h The Synthesis ToolKit in C by Pe
122. lus Strong with enhancements Jaffe Smith Smith and others including string stiffness and pluck position controls The stiffness is modeled with allpass filters This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers e Pickup Position 4 e String Sustain 11 e String Stretch 1 by Perry R Cook and Gary P Scavone 1995 2002 4 59 2 Member Function Documentation 4 59 2 1 void StifKarp setBaseLoopGain MY_FLOAT aGain Set the base loop gain The actual loop gain is set according to the frequency Because of high frequency loop filter roll off higher frequency settings have greater loop gains The documentation for this class was generated from the following file e StifKarp h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 60 Stk Class Reference 139 4 60 Stk Class Reference STK base class include lt Stk h gt Inheritance diagram for Stk Stk BowTabl Chorus Echo Envelope LAT Filter Instrmnt JetTabl Messager Modulate Noise PitShift ReedTabl Reverb nd RtDuplex RtMidi SKINI Socket Table Thread Wvin WvOut lat Static Publ
123. m for Modal S Instr Modal ModalBar Public Methods int modes 4 Class constructor taking the desired number of modes to create e virtual 0 Class destructor e void Tear Reset and clear all internal state e virtual void set Frequency MY FLOAT frequency Set instrument parameters for a particular frequency e void setRatioAndRadius int modeIndex MY_FLOAT ratio MY_FLOAT radius Set the ratio and radius for a specified mode filter e void MY_FLOAT aGain Set the master gain e void setDirectGain MY_FLOAT aGain Set the direct gain e void int modeIndex MY_FLOAT gain The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 74 STK Class Documentation Set the gain for a specified mode filter e virtual void strike MY_FLOAT amplitude Initiate a strike with the given amplitude 0 0 1 0 e void damp MY_FLOAT amplitude Damp modes with a given decay factor 0 0 1 0 e void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e virtual MY_FLOAT tick Compute one output sample e virtual void controlChange int number MY FLOAT value 0 Perform the control change specified by number and value 0 0 128 0 4 30 1 Detailed Description STK resonance model instrument This c
124. mbers Body Size 2 Pluck Position 4 String Sustain 11 String Detuning 1 Microphone Position 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Mandolin h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 28 Mesh2D Class Reference 69 4 28 Mesh2D Class Reference Two dimensional rectilinear waveguide mesh class include lt Mesh2D h gt Inheritance diagram for Mesh2D Instrmnt Mesh2D Public Methods e Mesh2D short nX short nY Class constructor taking the x and y dimensions in samples O Class destructor e void clear Reset and clear all internal state e void short lenX Set the x dimension size in samples e void short lenY Set the y dimension size in samples e void setInputPosition MY_FLOAT xFactor MY_FLOAT yFactor Set the x y input position on a 0 0 1 0 scale e void MY_FLOAT decayFactor Set the loss filters gains 0 0 1 0 e void noteOn MY FLOAT frequency MY_FLOAT amplitude Impulse the mesh with the given amplitude frequency ignored e void MY_FLOAT amplitude The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 STK Class Documentation Stop a note with the given amplitude speed of decay currently ignored MY_FLOAT Calculate and return the signal energy stored in th
125. mpiling on a little endian system Assuming your system has the GNU Makefile utilities installed typing make within a particular project directory will initiate the compilation process The Makefile will have to be modified to change the default audio MIDI sys tem API and for big endian processors Special support exists under Linux for the MIDlIator serial MIDI device enabled using the _MIDIATOR_ _ preprocessor definition together with either the _LINUX_ALSA_ or LINUX_OSS definitions See the README Linux file for further sys tem configuration information e SGI Realtime support is enabled with the _IRIX_AL__ preprocessor def inition and linkage with the audio md and pthread libraries If your system has the Makefile utilities installed typing make or gmake within a particular project directory will initiate the compilation process If your system does not have the GNU Makefile utilities you should first try to download and install them If this is not possible a generic Makefile is provided with the demo project Makefile sgi It can be invoked by typing make f Makefile sgi within that project directory STK 4 0 is confirmed to compile using CC version 7 30 There may be problems with old compiler versions e Windows95 98 2000 XP Realtime support is enabled with the _ WINDOWS_DS__ preprocessor definition and linkage with the dsound lib winmm lib and Wsock32 1ib libraries In addition the _LITTLE_ ENDIAN__ preprocessor d
126. n TRUE on success If the specified time value is negative the function will block indefinitely Oth erwise the function will block up to a maximum of the specified time A return value of FALSE indicates the thread did not terminate within the specified time limit The documentation for this class was generated from the following file e Thread h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 156 STK Class Documentation 4 67 TubeBell Class Reference STK tubular bell orchestral chime FM synthesis instrument include lt TubeBell h gt Inheritance diagram for TubeBell Stk Instrmn Intl TubeBell Public Methods TubsBal 0 Class constructor e EMB Class destructor e void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude e MY_FLOAT tick Compute one output sample 4 67 1 Detailed Description STK tubular bell orchestral chime FM synthesis instrument This class implements two simple FM Pairs summed together also referred to as algorithm 5 of the TX81Z Algorithm 5 is 4 gt 3 gt Out 2 gt 1 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 67 TubeBell Class Reference Control Change Numbers Modulator Index One 2 Crossfade of Outputs 4 LFO Speed 11 LFO Depth 1 e ADSR 2 amp 4 Target 128 The basic Chow
127. nge FMVoices noteOn setFrequency tick FormSwep FormSwep FormSwep setStates setTargets tick FormSwep setResonance setSweepRate setSweepTime getByteThree Messager RtMidi SKINI 131 getByteThreeInt SKINI 131 getByte Two Messager RtMidi SKINI 130 getByteTwolnt SKINI getChannel Messager RtMidi SKINI 130 getChannels Wvln 169 getDelay getDelta Messager SKINI 130 getDeltaTime RtMidi getFileRate Wvh 111 getFrames RtWvOut TcpWvOut WvOut getGain BiQuad Filter seed OneZero 86 Sr os TwoPole 159 TwoZero getLength Table getMessage StkError 143 getMessageTypeString SKINI getRemainderString SKINI 131 getSize Wvln 168 getState ADSR Envelope getTime RtWvOut The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 212 INDEX TcpWvOut WvOut getType Messager RtMidi SKINI StkError handleError Stk HevyMetl HevyMetl HevyMetl noteOn tick HevyMetl Instrmnt Instrmnt controlChange Instrmnt lastOut noteOff noteOn set Frequency tick isConnected TcpWvIn 150 isFinished Wvln 169 isValid Socket JCRev clear tick JetTabl Jet Tabl Jet Tabl lastOut tick JetTabl key Off ADSR Envelope FM Resonate Sampler Simple keyOn ADSR Envelope FM Resonate 102 Sampler Simple last
128. ning Stanford FM patent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e TubeBell h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 158 STK Class Documentation 4 68 TwoPole Class Reference STK two pole filter class include lt TwoPole h gt Inheritance diagram for TwoPole Stk Public Methods oP Default constructor creates a second order pass through filter Erro Class destructor void void Clears the internal states of the filter void MY FLOAT b0 Set the b 0 coefficient value void MY FLOAT al Set the a 1 coefficient value void MY FLOAT a2 Set the a 2 coefficient value void setResonance MY FLOAT frequency MY _FLOAT radius bool nor malize FALSE Sets the filter coefficients for a resonance at frequency in Hz void MY_FLOAT theGain Set the filter gain The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 68 TwoPole Class Reference 159 MY FLOAT void const Return the current filter gain MY FLOAT void const Return the last computed output value MY_FLOAT MY_FLOAT sample Input one sample to the filter and return one output MY FL
129. nstantiation An StkErrorlis thrown if a socket error occurs or an invalid argument is specified The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 65 TcpWvOut Class Reference 153 4 65 3 Member Function Documentation 4 65 3 1 void TcpWvOut connect int port const char hostname localhost unsigned int nChannels 1 Stk STK_ FORMAT format STK_SINT16 Connect to the specified host and port and prepare to stream nChannels of data in the given data format An StkErrorlis thrown if a socket error occurs or an invalid argument is specified 4 65 3 2 void TcpWvOut tick MY_FLOAT sample virtual Output a single sample to all channels in a sample frame An StkError is thrown if a socket write error occurs Reimplemented from 4 65 3 3 void TcpWvOut tick const MY_FLOAT x vector unsigned int vectorSize virtual Output each sample in vector to all channels in vectorSize sample frames An StkError is thrown if a socket write error occurs Reimplemented from 4 65 3 4 void TcpWvOut tickFrame const MY_FLOAT x frame Vector unsigned int frames 1 virtual Output the frame Vector of sample frames of the given length An StkError is thrown if a socket write error occurs Reimplemented from The documentation for this class was generated from the following file e fcpWvOut h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002
130. ntMessage void Prints thrown error message to stdout e virtual const TYPE amp getType void Returns the thrown error message TYPE e virtual const char getMessage void const Returns the thrown error message string 4 61 1 Detailed Description STK error handling class This is a fairly abstract exception handling class There could be sub classes to take care of more specific error conditions or not The documentation for this class was generated from the following file e Stk h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 144 STK Class Documentation 4 62 SubNoise Class Reference STK sub sampled noise generator include lt SubNoise h gt Inheritance diagram for SubNoise SubNoise Public Methods int subRate 16 Default constructor sets sub sample rate to 16 Edo Class destructor e int void const Return the current sub sampling rate e void int subRate Set the sub sampling rate e MY _FLOAT tick Return a sub sampled random number between 1 0 and 1 0 4 62 1 Detailed Description STK sub sampled noise generator Generates a new random number every rate ticks using the C rand function The quality of the rand function varies from one OS to another by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file The Syn
131. nternal state void MY FLOAT frequency Set instrument parameters for a particular frequency void setJetReflection MY FLOAT coefficient Set the reflection coefficient for the jet delay 1 0 1 0 void setEndReflection MY FLOAT coefficient Set the reflection coefficient for the air column delay 1 0 1 0 void setJetDelay MY FLOAT aRatio Set the length of the jet delay in terms of a ratio of jet delay to air column delay lengths void start Blowing MY_FLOAT amplitude MY_FLOAT rate Apply breath velocity to instrument with given amplitude and rate of increase The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 19 Flute Class Reference 51 void stopBlowing MY FLOAT rate Decrease breath velocity with given rate of decrease void noteOn MY FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay MY_FLOAT Compute one output sample void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 19 1 Detailed Description STK flute physical model class This class implements a simple flute physical model as discussed by Karjalainen Smith Waryznyk etc The jet model uses a polynomial a la Cook This is a digital waveguide model making its use possibly subject to
132. o The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 218 INDEX PoleZero TwoPole TwoZero 162 setInputPosition Mesh2D setInterpolate Wvln 171 setJetDelay Flute setJetReflection Flute setLip Brass setMasterGain Modal setModDepth Chorus setModeGain Modal setModFrequency Chorus setModulationDepth FM ModalBar Moog setModulationSpeed FM Moog setNotch BiQuad Resonate TwoZero 162 setNumerator Filter setNX Mesh2D setNY Mesh2D setOffset BowTabl ReedTabl setPickupPosition StifKarp 137 setPluckPosition Pluck Two setPole OnePole setPreset BandedWG ModalBar setRandomGain Modulate setRate Envelope SubNoise 144 Wvln 171 setRatio FM setRatioAndRadius Modal setReleaseRate ADSR setReleaseTime ADSR setResonance BiQuad FormSwep Resonate 102 TwoPole 159 setRtDelta Messager setSampleRate Stk setShift PitShift setSlope BowTabl ReedTabl setStates FormSwep setStickHardness ModalBar setStretch StifKarp 137 setStrikePosition BandedWG ModalBar setSustainLevel ADSR setSweepRate FormSwep setSweepTime The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX 219 FormSwep set Target ADSR Envelope set Targets FormSwep set Time Envelope set Tonehole BlowHole setValue ADSR san set Vent BlowHo
133. o another It provides methods for controlling the sweep rate and target frequency by Perry R Cook and Gary P Scavone 1995 2002 4 22 2 Member Function Documentation 4 22 2 1 void FormSwep setResonance MY_FLOAT aFrequency MY FLOAT aRadius Sets the filter coefficients for a resonance at frequency in Hz This method determines the filter coefficients corresponding to two complex conjugate poles with the given frequency in Hz and radius from the z plane origin The filter zeros are placed at z 1 z 1 and the coefficients are then normalized to produce a constant unity gain independent of the filter gain parameter The resulting filter frequency response has a resonance at the given frequency The closer the poles are to the unit circle radius close to one the narrower the resulting resonance width 4 22 2 2 void FormSwep setSweepRate MY FLOAT aRate Set the sweep rate between 0 0 1 0 The formant parameters are varied in increments of the sweep rate between their current and target values A sweep rate of 1 0 will produce an immediate change in resonance parameters from their current values to the target values A sweep rate of 0 0 will produce no change in resonance parameters 4 22 2 3 void FormSwep setSweepTime MY_FLOAT aTime Set the sweep rate in terms of a time value in seconds The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 22 FormSwep Class Reference
134. om the base class Stk provides a static sample rate which is queried by subclasses as needed Because many classes use the current sample rate value during instantiation it is important that the desired value be set at the beginning of a program The default STK sample rate is 22050 Hz Another primary concept that is somewhat obscurred in this example concerns the data format in which sample values are passed and received Audio and control signals throughout STK use a floating point data type the exact preci sion of which can be controlled via the MY_FLOAT define statement in Stk h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 18 Getting Started 195 Thus the ToolKit can use any normalization scheme desired The base instru ments and algorithms are implemented with a general audio sample dynamic maximum of 1 0 and the and classes and subclasses scale appropriately for DAC or soundfile input and output Finally STK has some basic C error handling functionality built in Classes which access files and or hardware are most prone to runtime errors To prop erly catch such errors the above example should be rewritten as shown below sineosc cpp include WaveLoop h include RtWv0ut h int main E Set the global sample rate before creating class instances Stk setSampleRate 44100 0 WaveLoop input RtWvOut output 0 0 try Define and load the s
135. one decides they need it and writes it This object opens a MIDI input device and parses MIDI messages into a MIDI buffer Time stamp info is converted to a delta time value MIDI data is stored as MY_FLOAT to conform with SKINI System exclusive messages are currently ignored An optional argument to the constructor can be used to specify a device or card When no argument is given a default device is opened If a device argument fails a list of available devices is printed to allow selection by the user This code is based in part on work of Perry Cook SGI Paul Leonard Linux the RoseGarden team Linux and Bill Putnam Windows by Perry R Cook and Gary P Scavone 1995 2002 4 49 2 Member Function Documentation 4 49 2 1 int RtMidi nextMessage void Check for and parse a new MIDI message in the queue returning its type If a new message is found the return value is greater than zero The documentation for this class was generated from the following file e RtMidi h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 50 RtWvIn Class Reference 113 4 50 RtWvIn Class Reference STK realtime audio input class include lt RtWvIn h gt Inheritance diagram for RtWvIn Stk Public Methods int nChannels 1 MY FLOAT sampleRate Stk sampleRate int device 0 int bufferFrames RT BUFFER SIZE int nBuffers 2 Default constructor e RtWvIn Class destru
136. only three required fields the message type an ASCIT name the time either delta or absolute and the channel number Don t freak out and think that this is MIDI channel 0 15 which is supported because the channel number is scanned as a long int Channels could be socket numbers machine IDs serial numbers or even unique tags for each event in a synthesis Other fields might be used as specified in the SKINI tbl file This is described in more detail later Fields in a SKINI line are delimited by spaces commas or tabs The SKINI parser only operates on a line at a time so a newline means the message is over Multiple messages are NOT allowed directly on a single line by use of the for example in C This could be supported but it isn t in version 1 1 Message types include standard MIDI types like NoteOn NoteOff Control Change etc MIDI extension message types messages which look better than MIDI but actually get turned into MIDE like messages include LipTension StringDamping etc Non MIDI message types include SetPath sets a path for file use later and OpenReadFile for streaming mixing and applying effects to soundfiles along with synthesis for example Other non MIDI message types include Trilling HammerOn etc these translate to gestures behaviors and contexts for use by intellegent players and instruments using SKINI Where possible I will still use these as MIDI extension messages so foot switches e
137. onstructor taking the lowest desired playing frequency e virtual 0 Class destructor e void MY _FLOAT amplitude Pluck the strings with the given amplitude 0 0 1 0 using the current fre quency e void MY_FLOAT amplitude MY_FLOAT position Pluck the strings with the given amplitude 0 0 1 0 and position 0 0 1 0 e virtual void noteOn MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude 0 0 1 0 e void setBodySize MY FLOAT size Set the body size a value of 1 0 produces the default size e virtual MY FLOAT tick Compute one output sample The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 68 STK Class Documentation e virtual void controlChange int number MY FLOAT value Perform the control change specified by number and value 0 0 128 0 4 27 1 Detailed Description STK mandolin instrument model class This class inherits from Pluck Two and uses commuted synthesis techniques to model a mandolin instrument This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Commuted Synthesis in particular is covered by patents granted pending and or applied for All are assigned to the Board of Trustees Stanford University For information contact the Office of Technology Licensing Stanford University Control Change Nu
138. orms The Unix and Windows versions have been merged into a single set of classes Makefiles and Visual C workspace project files are provided for compiling The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 5 Usage Documentation 185 5 5 Usage Documentation e Compiling e e e e Realtime Control Input using Tcl Tk Graphical User Interfaces e Realtime MIDI Control Input 5 6 Directory Structure The top level distribution contains the following directories e The src directory contains the source cpp files for almost all the STK unit generator and algorithm classes e The include directory contains the header files for almost all the STK unit generator and algorithm classes e The rawwaves directory contains various raw monophonic 16 bit big endian soundfiles used with the STK classes e The doc directory contains documentation about STK e The projects directory contains various demo and example STK pro grams This release of STK comes with four separate project directories 1 The demo project is used to demonstrate nearly all of the STK instru ments The demo program has been written to allow a variety of control input and sound data output options Simple graphical user interfaces GUIs are also provided 2 The effects project demonstrates realtime duplex mode simultaneous audio input and output operation when available as well as various de
139. owBotl BlowHole Bowed B ta A ES w BE 18 E ModalBar The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 210 INDEX Moog Resonate Sampler Saxofony Shakers Simple StifKarp damp Modal Delay Delay clear contentsAt Delay energy 35 getDelay lastOut set Delay tick DelayA DelayA clear DelayA getDelay tick DelayA set Delay DelayL DelayL DelayL getDelay tick DelayL set Delay disconnect TcpWvOut Drummer Drummer Drummer noteOff noteOn tick Echo Echo setEffect Mix tick energy Delay Mesh2D Envelope Envelope Envelope getState keyOff keyOn lastOut setRate setTarge setTime set Value tick EG EE ot E Filter Filter clear Filter getGain lastOut setCoefficients setDenominator setGain setNumerator tick Flute Flute clear controlChange Flute noteOff noteOn setEndReflection setFrequency setJet Delay setJetReflection startBlowing stopBlowing The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX 211 tick FM NEM clear controlChange FM keyOff keyOn load Waves noteOfF setControll setControl2 setFrequency setGain setModulationDepth setModulationSpeed setRatio tick FMVoices FMVoices controlCha
140. pable formant FormSwep filters Control Change Numbers Filter Q 2 Sweep Rate 4 e Vibrato Frequency 11 e Vibrato Gain 1 e Gain 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Moog h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 34 Noise Class Reference 81 4 34 Noise Class Reference STK noise generator include lt Noise h gt Inheritance diagram for Noise SubNoise Public Methods Faro Default constructor virtual 0 Class destructor virtual MY_FLOAT Return a random number between 1 0 and 1 0 using rand virtual MY _FLOAT tick MY _FLOAT vector unsigned int vectorSize Return vectorSize random numbers between 1 0 and 1 0 in vector MY_FLOAT const Return the last computed value 4 34 1 Detailed Description STK noise generator Generic random number generation using the C rand function The quality of the rand function varies from one OS to another by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 82 STK Class Documentation The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 35 NRev Class Reference 83 4 35 NRe
141. patents held by Stanford University Yamaha and others Control Change Numbers e Jet Dalay 2 e Noise Gain 4 e Vibrato Frequency 11 e Vibrato Gain 1 e Breath Pressure 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Flute h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 52 STK Class Documentation 4 20 FM Class Reference STK abstract FM synthesis base class include lt FM h gt Inheritance diagram for FM Stk Instrmnt FM BeeThree FMVoices HevyMetl PercFlut Rhodey TubeBell Wurley Public Methods int operators 4 Class constructor taking the number of wave envelope operators to control e virtual Class destructor e void clear Reset and clear all wave and envelope states e void load Waves const char filenames Load the rawwave filenames in waves e virtual void MY_FLOAT frequency Set instrument parameters for a particular frequency e void int waveIndex MY FLOAT ratio Set the frequency ratio for the specified wave e void int waveIndex MY FLOAT gain Set the gain for the specified wave e void setModulationSpeed MY FLOAT mSpeed The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 20 FM Class Reference 53 Set the modulation speed in Hz e void setModulat
142. patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e BeeThree h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 18 STK Class Documentation 4 4 BiQuad Class Reference STK biquad two pole two zero filter class include lt BiQuad h gt Inheritance diagram for BiQuad Public Methods Budo Default constructor creates a second order pass through filter virtual 0 Class destructor void void Clears all internal states of the filter void MY _FLOAT b0 Set the b 0 coefficient value void MY _FLOAT b1 Set the b 1 coefficient value void MY FLOAT b2 Set the b 2 coefficient value void MY FLOAT al Set the a 1 coefficient value e void MY _FLOAT a2 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 4 BiQuad Class Reference 19 Set the a 2 coefficient value e void setResonance MY_FLOAT frequency MY_FLOAT radius bool nor malize FALSE Sets the filter coefficients for a resonance at frequency in Hz e void MY_FLOAT frequency MY_FLOAT radius Set the filter coefficients for a notch at frequency in Hz e void setEqualGainZeroes Sets the filter zeroes for equal resonance gain e void MY_FLOAT theG
143. port dynamic tonehole implementation as discussed by Scavone and Cook 1998 In this implementation the distances between the reed register hole and tone hole bell are fixed As a result both the tonehole and register hole will have variable influence on the playing frequency which is dependent on the length of the air column In addition the highest playing freqeuency is limited by these fixed lengths This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others Control Change Numbers e Reed Stiffness 2 e Noise Gain 4 e Tonehole State 11 e Register State 1 e Breath Pressure 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e BlowHole h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 7 Bowed Class Reference 25 4 7 Bowed Class Reference STK bowed string instrument class include lt Bowed h gt Inheritance diagram for Bowed Instrmnt Public Methods MY_FLOAT lowestFrequency Class constructor taking the lowest desired playing frequency Bowed Class destructor void Tear Reset and clear all internal state void MY_FLOAT frequency Set instrument parameters for a particular frequency void MY_FLOAT gain Set vibrato gain void MY FLOAT amplitude MY_FLOAT rate
144. puts in vector 4 37 1 Detailed Description STK one zero filter class This protected subclass implements a one zero digital filter A method is provided for setting the zero position along the real axis of the z plane while maintaining a constant filter gain by Perry R Cook and Gary P Scavone 1995 2002 4 37 2 Member Function Documentation 4 37 2 1 void OneZero setZero MY FLOAT theZero Set the zero position in the z plane This method sets the zero position along the real axis of the z plane and normal izes the coefficients for a maximum gain of one A positive zero value produces a high pass filter while a negative zero value produces a low pass filter This method does not affect the filter gain value 4 37 2 2 void OneZero setGain MY FLOAT theGain virtual Set the filter gain The gain is applied at the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplemented from The documentation for this class was generated from the following file e OneZero h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 88 STK Class Documentation 4 38 PercFlut Class Reference STK percussive flute FM synthesis instrument include lt PercFlut h gt Inheritance diagram for PercFlut S E Instrmnt PercFlut es E lt Public Methods Par 0 Class constructor gt Pao Class destructor void set Fre
145. quency MY_FLOAT frequency Set instrument parameters for a particular frequency e void MY FLOAT frequency MY FLOAT amplitude Start a note with the given frequency and amplitude e MY FLOAT tick Compute one output sample 4 38 1 Detailed Description STK percussive flute FM synthesis instrument This class implements algorithm 4 of the TX81Z Algorithm 4 is 4 gt 3 2 gt 1 gt 0ut The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 38 PercFlut Class Reference 89 Control Change Numbers Total Modulator Index 2 Modulator Crossfade 4 LFO Speed 11 LFO Depth 1 e ADSR 2 amp 4 Target 128 The basic Chowning Stanford FM patent expired in 1995 but there exist follow on patents mostly assigned to Yamaha If you are of the type who should worry about this making money worry away by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e PercFlut h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 90 STK Class Documentation 4 39 PitShift Class Reference STK simple pitch shifter effect class include lt PitShift h gt Inheritance diagram for PitShift PitShift Public Methods PRS O Class constructor m PESH Class destructor e void clear Reset and clear all internal state e void setShift
146. r unsigned int frames 1 Output sample frames from frame Vector and return new input frames in frame Vector An StkError will be thrown if an error occurs during input output The documentation for this class was generated from the following file e RtDuplex h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 49 RtMidi Class Reference 111 4 49 RtMidi Class Reference STK realtime MIDI class include lt RtMidi h gt Inheritance diagram for RtMidi RtMidi Public Methods int device 0 Default constructor with optional device argument Rima O Class destructor void print Message void const Print out the current message values int void Check for and parse a new MIDI message in the queue returning its type int getType const Return the current message type int getChannel const Return the current message channel value MY_FLOAT const Return the current message byte two value MY FLOAT getByteThree const Return the current message byte three value MY FLOAT getDeltaTime const Return the current message delta time value in seconds The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 112 STK Class Documentation 4 49 1 Detailed Description STK realtime MIDI class At the moment this object only handles MIDI input though MIDI output code can go here when some
147. rb Reverb Rhodey Rhodey 106 Rt Duplex RtDuplex LOS Rt Midi RtMidi RtWvIn RtWvlIn RtWvOut RtWvOut SKINI SKINI 130 Sampler Sampler Saxofony Saxofony 121 Shakers Shakers Simple Simple Sitar Sitar Socket Socket StifKarp StifKarp 137 Stk Stk StkError StkError 143 SubNoise SubNoise 144 Table Table TcpWvIn TcpWvIn TcpWvOut TcpWvOut Thread Thread TubeBell TubeBell TwoPole TwoPole 158 TwoZero TwoZero 161 WaveLoop WaveLoop 164 Wurley Wurley 166 WvIn Wvh 168 WvOut WvOut accept Socket 135 addPhase WaveLoop 165 addPhaseOffset WaveLoop 165 addTime WaveLoop 164 WviIn ADSR 11 ADSR 12 ADSR getState setAllTimes setAttackRate setAttackTime setDecayRate setDecayTime setReleaseRate setReleaseTime setSustainLevel The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 208 INDEX set Target set Value tick BandedWG BandedWG BandedWG clear controlChange noteOff noteOn pluck setFrequency setPreset set StrikePosition start Bowing stopBowing tick BandedWG BeeThree BeeThree BeeThree noteOn tick BeeThree BiQuad BiQuad BiQuad clear getGain lastOut set A1 18 setA2 18 setBO setBl setEqualGainZeroes setGain CNO setResonance BlowBotl Blow
148. ritten as 64 bit floats If a data type specification does not match the specified file type the data type will automatically be modified Uncompressed data types are not supported Currently WvOut is non interpolating and the output rate is always Stk sampleRate by Perry R Cook and Gary P Scavone 1995 2002 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 73 WvOut Class Reference 175 4 73 2 Constructor amp Destructor Documentation 4 73 2 1 WvOut WvOut const char x fileName unsigned int nChannels 1 FILE_TYPE type WVOUT_WAV Stk STK_FORMAT format STK_SINT16 Overloaded constructor used to specify a file name type and data format with this object An StkError is thrown for invalid argument values or if an error occurs when initializing the output file 4 73 3 Member Function Documentation 4 73 3 1 void WvOut openFile const char fileName unsigned int nChannels 1 WvOut FILE_TYPE type WVOUT_WAV Stk STK FORMAT format STK_SINT16 Create a file of the specified type and name and output samples to it in the given data format An StkError is thrown for invalid argument values or if an error occurs when initializing the output file 4 73 3 2 void WvOut tick const MY_FLOAT sample virtual Output a single sample to all channels in a sample frame An is thrown if a file read error occurs Reimplemented in RtWvOut and TcpWvOut 4 73 3
149. rn the last output value e MY FLOAT MY FLOAT input Return the function value for input e MY FLOAT MY_FLOAT vector unsigned int vectorSize Take vectorSize inputs and return the corresponding function values in vec tor 4 44 1 Detailed Description STK reed table class The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 44 ReedTabl Class Reference 101 This class implements a simple one breakpoint non linear reed function as described by Smith 1986 This function is based on a memoryless non linear spring model of the reed the reed mass is ignored which saturates when the reed collides with the mouthpiece facing See McIntyre Schumacher amp Woodhouse 1983 Smith 1986 Hirschman Cook Scavone and others for more information by Perry R Cook and Gary P Scavone 1995 2002 4 44 2 Member Function Documentation 4 44 2 1 void ReedTabl setOffset MY_FLOAT aValue Set the table offset value The table offset roughly corresponds to the size of the initial reed tip opening a greater offset represents a smaller opening 4 44 2 2 void ReedTabl setSlope MY_FLOAT aValue Set the table slope value The table slope roughly corresponds to the reed stiffness a greater slope repre sents a harder reed 4 44 2 3 MY FLOAT ReedTabl tick MY_FLOAT input Return the function value for input The function input represents the differential pressure across the reeds
150. rry R Cook and Gary P Scavone 1995 2002 4 52 Sampler Class Reference 119 4 52 Sampler Class Reference STK sampling synthesis abstract base class include lt Sampler h gt Inheritance diagram for Sampler S Instr Sampler Moog HHH Public Methods Samai Default constructor e virtual Class destructor e void clear Reset and clear all internal state e virtual void MY FLOAT frequency 0 Set instrument parameters for a particular frequency e void keyOn Initiate the envelopes with a key on event and reset the attack waves void KyO 0 Signal a key off event to the envelopes e virtual void MY FLOAT amplitude Stop a note with the given amplitude speed of decay e virtual MY_FLOAT tick The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 120 STK Class Documentation Compute one output sample e virtual void controlChange int number MY_FLOAT value 0 Perform the control change specified by number and value 0 0 128 0 4 52 1 Detailed Description STK sampling synthesis abstract base class This instrument contains up to 5 attack waves 5 looped waves and an ADSR envelope by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Sampler h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 53
151. ski demo BeeThree or or on WindowsXX and or Unix demo BeeThree or lt scores bookert ski from the demo directory will play the scorefile bookert ski using the STK Bee Three instrument and stream the resulting audio data in realtime to the audio output channel of your computer Typing demo without any arguments will provide a full program usage description 5 12 Realtime Control Input using Tcl Tk Graphical User Interfaces There are a number of GUIs supplied with the STK projects These scripts require Tcl Tk version 8 0 or later which can be downloaded for free The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 190 STK Page Documentation over the WWW On Unix and Windows2000 XP platforms you can run the various executable scripts e g StkDemo bat provided with each project to start everything up you may need to symbolically link the wish80 executable to the name wish The PhysicalDemo script just implements the following command line sequence wish lt tcl Physical tcl demo Clarinet or ip On WindowsXX and Unix platforms the following operations are necessary to establish a socket connection between the Tcl Tk GUI and the STK program 1 Open a DOS shell and start the STK program with the is flag ex demo or is 2 Open the Tcl Tk GUI e g tcl Physical tcl by double clicking on it or type wish lt tcl Physical tcl in another DOS shell 3 Establish the soc
152. structor which creates a socket client connection to the specified host and port An StkError will be thrown if a socket error occurs during instantiation 4 58 3 Member Function Documentation 4 58 3 1 int Socket connect int port const char hostname localhost Connect a socket client to the specified host and port and returns the resulting socket descriptor This method is valid for socket clients only If it is called for a socket server 1 is returned If the socket client is already connected that connection is terminated and a new connection is attempted Server connections are made using the method An StkError will be thrown if a socket error occurs during instantiation See falso accept 4 58 3 2 int Socket accept void If this is a socket server extract the first pending connection request from the queue and create a new connection returning the descriptor for the accepted socket The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 136 STK Class Documentation If no connection requests are pending and the socket has not been set non blocking this function will block until a connection is present If an error occurs or this is a socket client 1 is returned The documentation for this class was generated from the following file e Socket h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 59 StifKarp Class Reference
153. strument Network Interface a MIDI like text mes sage synthesis control format A brief history of the Synthesis Toolkit in C Perry Cook began developing a pre cursor to the Synthesis ToolKit also called STK under NeXTStep at the Center for Computer Research in Music and Acoustics CCRMA at Stanford University in the early 1990s With his move to Princeton University in 1996 he ported everything to C on SGI hard ware added real time capabilities and greatly expanded the synthesis tech niques available With the help of Bill Putnam Perry also made a port of STK to Windows95 Gary Scavone began using STK extensively in the summer of 1997 and completed a full port of STK to Linux early in 1998 He finished the fully compatable Windows port using Direct Sound API in June 1998 Numerous improvements and extensions have been made since then The Toolkit has been distributed continuously since 1996 via the The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 1 General Information 179 Sound Kitchen Perry Cook s home page at Princeton at Stanford s Center for Computer Research in Music and Acoustics CCRMA and the Synthesis ToolKit home page The ToolKit has been in included in various collections of software Much of it has also been ported to MAX MSP on Macintosh computers by Dan Trueman and Luke Dubois of Columbia University and is distributed as PeRColate Help on real time sound
154. t MY FLOAT MY FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of outputs in vector 4 42 1 Detailed Description STK one pole one zero filter class This protected subclass implements a one pole one zero digital filter A method is provided for creating an allpass filter with a given coefficient Another method is provided to create a DC blocking filter by Perry R Cook and Gary P Scavone 1995 2002 4 42 2 Member Function Documentation 4 42 2 1 void PoleZero setAllpass MY FLOAT coefficient Set the filter for allpass behavior using coefficient This method uses coefficient to create an allpass filter which has unity gain at all frequencies Note that the coefficient magnitude must be less than one to maintain stability 4 42 2 2 void PoleZero setBlockZero MY_FLOAT thePole 0 99 Create a DC blocking filter with the given pole position in the z plane This method sets the given pole position together with a zero at z 1 to create a DC blocking filter thePole should be close to one to minimize low frequency attenuation The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 98 STK Class Documentation 4 42 2 3 void PoleZero setGain MY FLOAT theGain virtual Set the filter gain The gain is applied at the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplement
155. t the filter input and does not affect the coefficient values The default gain value is 1 0 Reimplemented from The documentation for this class was generated from the following file e OnePole h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 86 STK Class Documentation 4 37 OneZero Class Reference STK one zero filter class include lt OneZero h gt Inheritance diagram for OneZero Stk Filter rite Public Methods Daza Default constructor creates a first order low pass filter MY_FLOAT theZero Overloaded constructor which sets the zero position during instantiation ova Class destructor e void void Clears the internal state of the filter e void MY FLOAT b0 Set the b 0 coefficient value e void MY_FLOAT b1 Set the b 1 coefficient value e void MY_FLOAT theZero Set the zero position in the z plane e void MY FLOAT theGain Set the filter gain e MY_FLOAT void const The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 37 OneZero Class Reference 87 Return the current filter gain e MY FLOAT lastOut void const Return the last computed output value e MY _FLOAT tick MY FLOAT sample Input one sample to the filter and return one output e MY FLOAT MY FLOAT vector unsigned int vectorSize Input vectorSize samples to the filter and return an equal number of out
156. tc The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 200 STK Page Documentation can be used to control them in real time All fields other than type time and channel are optional and the types and useage of the additional fields is defined in the file SKINI tbl The other important file used by SKINI is SKINI msg which is a set of defines to make C code more readable and to allow reasonably quick re mapping of control numbers etc All of these defined symbols are assigned integer values For Java the defines could be replaced by declaration and assignment statements preserving the look and behavior of the rest of the code 5 26 C Files Used To Implement SKINI SKINI cpp is an object which can either open a SKINI file and successively read and parse lines of text as SKINI strings or accept strings from another object and parse them The latter functionality would be used by a socket pipe or other connection receiving SKINT messages a line at a time usually in real time but not restricted to real time SKINI msg should be included by anything wanting to use the SKINI cpp object This is not mandatory but use of the _SK_blah_ symbols which are defined in the msg file will help to ensure clarity and consistency when messages are added and changed SKINI tbl is used only by the SKINI parser object SKINI cpp In the file SKINI tbl an array of structures is declared and assigne
157. ternal state e void MY FLOAT frequency Set instrument parameters for a particular frequency e void MY FLOAT amplitude MY FLOAT rate Apply breath velocity to instrument with given amplitude and rate of increase e void stopBlowing MY FLOAT rate Decrease breath velocity with given rate of decrease e void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude e void fnoteOff MY_FLOAT amplitude Stop a note with the given amplitude speed of decay MY_FLOAT The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 STK Class Documentation Compute one output sample e void controlChange int number MY_FLOAT value Perform the control change specified by number and value 0 0 128 0 4 5 1 Detailed Description STK blown bottle instrument class This class implements a helmholtz resonator biquad filter with a polynomial jet excitation a la Cook Control Change Numbers e Noise Gain 4 e Vibrato Frequency 11 e Vibrato Gain 1 e Volume 128 by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e BlowBotl h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 6 BlowHole Class Reference 23 4 6 BlowHole Class Reference STK clarinet physical model with one register hole and one tonehole include lt Blow
158. ters It can function independently or be subclassed to provide more specific controls based on a particular filter type In particular this class implements the standard difference equation a 0 y n b 0 J x n b nb x n nb a 1 x y n 1 a na y n na If a 0 is not equal to 1 the filter coeffcients are normalized by al0 The gain parameter is applied at the filter input and does not affect the coeffi cient values The default gain value is 1 0 This structure results in one extra multiply per computed sample but allows easy control of the overall filter gain by Perry R Cook and Gary P Scavone 1995 2002 4 18 2 Constructor Destructor Documentation 4 18 2 1 Filter Filter int nb MY FLOAT bCoefficients int na MY_FLOAT aCoefficients Overloaded constructor which takes filter coefficients An StkError can be thrown if either nb or na is less than one or if the a 0 coefficient is equal to zero The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 18 Filter Class Reference 49 4 18 3 Member Function Documentation 4 18 3 1 void Filter setCoefficients int nb MY_FLOAT x bCoefficients int na MY FLOAT aCoefficients Set filter coefficients An StkError can be thrown if either nb or na is less than one or if the al0 coefficient is equal to zero If a 0 is not equal to 1 the filter coeffcients are normalized by al0 4 18 3 2 void Filt
159. thesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 62 SubNoise Class Reference 145 e Sub The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 146 STK Class Documentation 4 63 Table Class Reference STK table lookup class include lt Table h gt Inheritance diagram for Table Stk Public Methods char fileName Constructor loads the data from fileName Eno Class destructor long getLength const Return the number of elements in the table MY FLOAT const Return the last output value MY FLOAT MY FLOAT index Return the table value at position index MY FLOAT MY FLOAT vector unsigned int vectorSize Take vectorSize index positions and return the corresponding table values in vector 4 63 1 Detailed Description STK table lookup class This class loads a table of floating point doubles which are assumed to be in big endian format Linear interpolation is performed for fractional lookup indexes The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 63 Table Class Reference 147 An will be thrown if the table file is not found by Perry R Cook and Gary P Scavone 1995 2002 4 63 2 Member Function Documentation 4 63 2 1 MY_FLOAT Table tick MY FLOAT indez Return the table value at position indez Linear interpolation is performed if index is fractional The doc
160. tor void Tear Clears the internal state of the delay line void setDelay long theDelay Set the delay line length long get Delay void const Return the current delay line length MY_FLOAT void const Calculate and return the signal energy in the delay line The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 36 STK Class Documentation MY_FLOAT long tapDelay const Return the value at tapDelay samples from the delay line input MY_FLOAT void const Return the last computed output value virtual MY_FLOAT MY_FLOAT sample Input one sample to the delay line and return one output virtual MY FLOAT tick MY_FLOAT vector unsigned int vectorSize Input vectorSize samples to the delay line and return an equal number of outputs in vector 4 12 1 Detailed Description STK non interpolating delay line class This protected Filter subclass implements a non interpolating digital delay line A fixed maximum length of 4095 and a delay of zero is set using the default constructor Alternatively the delay and maximum length can be set during instantiation with an overloaded constructor A non interpolating delay line is typically used in fixed delay length applications such as for reverberation by Perry R Cook and Gary P Scavone 1995 2002 4 12 2 Member Function Documentation 4 12 2 1 void Delay setDelay long theDelay Set the delay line length
161. trument parameters for a particular frequency e void MY_FLOAT amplitude Pluck the string with the given amplitude using the current frequency e void MY_FLOAT frequency MY_FLOAT amplitude Start a note with the given frequency and amplitude e void MY_FLOAT amplitude Stop a note with the given amplitude speed of decay e MY_FLOAT tick Compute one output sample The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 56 Sitar Class Reference 129 4 56 1 Detailed Description STK sitar string model class This class implements a sitar plucked string physical model based on the Karplus Strong algorithm This is a digital waveguide model making its use possibly subject to patents held by Stanford University Yamaha and others There exist at least two patents assigned to Stanford bearing the names of Karplus and or Strong by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e Sitar h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 130 STK Class Documentation 4 57 SKINI Class Reference STK SKINI parsing class include lt SKINI h gt Inheritance diagram for SKINI Public Methods SKIN Default constructor used for parsing messages received externally e SKINI char fileName Overloaded constructor taking a SKINI formatted scorefile
162. uckPosition tick PluckT EL setBaseLoopGain PoleZero PoleZero clear getGain lastOut PoleZero setAl setBO setB1 96 tick PoleZero set Allpass setBlockZero setGain port Socket PRCRev clear tick print Message RtMidi StkError readBuffer Socket ReedTabl ReedTabl setSlope 101 tick reset Modulate Wvh 168 Resonate 102 Resonate 102 clear 102 controlChange 103 key Off keyOn oiT noteOn Resonate 102 setEqualGainZeroes 102 setNotch setResonance 102 tick Reverb Reverb clear 104 lastOut lastOutLeft 104 lastOutRight Reverb The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 216 INDEX set Effect Mix tick Rhodey Rhodey 106 noteOn Red setFrequency 106 tick RtDuplex RtDuplex lastFrame lastOut RtDuplex RtDuplex 105 RtDuplex 109 start 109 stop 110 tick tickFrame 110 RtMidi RtMidi getByteThree getByteTwo 111 getChannel getDeltaTime 111 get Type 111 print Message RtMidi RtMidi nextMessage 112 RtWvIn RtWvIn lastFrame lastOut RtWvln RtWvlIn RtWvln start 114 stop 115 tick tickFrame 115 RtWvOut RtWvOut getFrames getTime RtWvOut RtWvOut RtWvOut start stop 117 tick tickFrame 118 Sampler Sampler clear 119
163. umentation Q lass Hierarchy lass Enum List File List ompound Members Q The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 5 3 Download and Release Notes 181 5 3 Download and Release Notes Version 4 0 30 April 2002 STK Version 4 0 Source distribution 1 64 MB tar gzipped STK Version 4 0 Source distribution with precompiled windows 2 26 MB tar gzipped 5 4 Release Notes 5 4 1 Version 4 0 New documentation and tutorial Several new instruments including Saxofony and New Stk base class replacing Object class New Filter class structure and methods Extensive modifications to Wvln and WvOut class structures and meth ods Looping functionality moved to subclass of WvIn e Automatic file type detection in hosed WavWvIn AifWvIn RawWavIn SndWavIn and MatWvIn subclasses e New file type specifier argument in WvOut hosed WavWvOut AifWv Out RawWavOut SndWavOut and MatWvOut subclasses e Some simplifications of class was Controller e New independent RtAudio class e Extensive revisions in code and a significant number of API changes 5 4 2 Version 3 2 New input control handling class Controller Added AIFF file input output support New C error handling capabilities New input output internet streaming support StrmWvIn StrmWvOut Added native ALSA support for linux Added optional device argument to all Rt
164. umentation for this class was generated from the following file e Table h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 148 STK Class Documentation 4 64 TcpWvIn Class Reference STK internet streaming input class include lt TcpWvIn h gt Inheritance diagram for TcpWvIn Stk TcpWvIn Public Methods int port 2006 Default constructor starts a socket server If not specified the server is associated with port 2006 Era O Class destructor void unsigned int nChannels 1 Stk STK_FORMAT for mat STK_SIN T16 Listen for a new connection with specified data channels and format bool void Returns TRUE is an input connection exists or input data remains in the queue MY FLOAT void const Return the average across the last output sample frame MY FLOAT void Read out the average across one sample frame of data MY FLOAT MY_FLOAT vector unsigned int vectorSize Read out vectorSize averaged sample frames of data in vector e const MY_FLOATx void const The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 64 TcpWvIn Class Reference 149 Return a pointer to the last output sample frame e const MY_FLOAT void Return a pointer to the next sample frame of data e MY FLOAT MY_FLOAT frameVector unsigned int frames Read out sample frames of data to frameVector 4 64 1 Detailed Description STK
165. v Class Reference CCRMA s NRev reverberator class include lt NRev h gt Inheritance diagram for NRev Public Methods e void clear O Reset and clear all internal state e MY FLOAT MY_FLOAT input Compute one output sample 4 35 1 Detailed Description CCRMA s NRev reverberator class This class is derived from the CLM NRev function which is based on the use of networks of simple allpass and comb delay filters This particular arrangement consists of 6 comb filters in parallel followed by 3 allpass filters a lowpass filter and another allpass in series followed by two allpass filters in parallel with corresponding right and left outputs by Perry R Cook and Gary P Scavone 1995 2002 The documentation for this class was generated from the following file e NRev h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 84 STK Class Documentation 4 36 OnePole Class Reference STK one pole filter class include lt OnePole h gt Inheritance diagram for OnePole Stk Filter Fier Public Methods PaPa 0 Default constructor creates a first order low pass filter MY_FLOAT thePole Overloaded constructor which sets the pole position during instantiation Onera Class destructor e void void Clears the internal state of the filter e void MY_FLOAT b0 Set the b 0 coefficient value e void MY_FLOAT al Set the a 1 coeffici
166. valid function argument 4 64 3 2 bool TcpWvIn isConnected void Returns TRUE is an input connection exists or input data remains in the queue This method will not return FALSE after an input connection has been closed until all buffered input data has been read out The documentation for this class was generated from the following file e TcpWvIn h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 65 TcpWvOut Class Reference 151 4 65 TcpWvOut Class Reference STK internet streaming output class include lt TcpWvOut h gt Inheritance diagram for TepWvOut Stk Public Methods oWO 0 Default constructor the socket is not instantiated int port const char hostname localhost unsigned int nChannels 1 Stk STK_FORMAT format3STK_SINT16 Overloaded constructor which opens a network connection during instantia tion STepwrOui Class destructor void int port const char xhostname localhost unsigned int nChannels 1 Stk STK_FORMAT formatSTK_SINT16 Connect to the specified host and port and prepare to stream nChannels of data in the given data format void void If a connection is open write out remaining samples in the queue and then disconnect unsigned long void const Return the number of sample frames output MY FLOAT void const Return the number of seconds of data output The Synthesis ToolKit in C by Perr
167. void Stk setSampleRate MY_FLOAT newRate static Static method which sets the STK sample rate The sample rate set using this method is queried by all STK classes which depend on its value It is initialized to the default SRATE set in Stk h Many STK classes use the sample rate during instantiation Therefore if you wish to use a rate which is different from the default rate it is imperative that it be set BEFORE STK objects are instantiated 4 60 3 Member Data Documentation 4 60 3 1 const STK FORMAT Stk STK_SINT8 static 128 to 127 4 60 3 2 const STK FORMAT Stk STK_SINT16 static 32768 to 32767 4 60 3 3 const STK FORMAT Stk STK_SINT32 static 2147483648 to 2147483647 4 60 3 4 const STK FORMAT Stk STK_FLOAT32 static Normalized between plus minus 1 0 4 60 3 5 const STK FORMAT Stk STK_FLOAT64 static Normalized between plus minus 1 0 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 142 STK Class Documentation The documentation for this class was generated from the following file e Stk h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 61 StkError Class Reference 143 4 61 StkError Class Reference STK error handling class include lt Stk h gt Public Methods e StkError const char xp TYPE tipe StkError UNSPECIFIED The constructor e virtual void The destructor e virtual void pri
168. wap 16 140 swap32 swap64 STK_FLOAT32 Stk STK_FLOAT64 Stk STK_SINT16 Stk STK _SINT32 Stk STK_SINTS8 Stk StkError StkError 143 getMessage 143 get Type 143 print Message 143 StkError 143 StkError 143 stop RtDuplex RtWvln RtWvOut stopBlowing BlowBotl BlowHole Brass Clarinet Flute Saxofony stopBowing BandedWG Bowed strike Modal SubNoise SubNoise 144 setRate SubNoise 144 subRate tick SubNoise 144 subRate SubNoise 144 swap16 Stk swap32 Stk swap64 Stk Table Table getLength lastOut Table tick LAO TcpWvIn TcpWvlIn lastFrame 148 The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 INDEX 221 lastOut TcpWvIn tick tickFrame 149 TcpWvIn isConnected listen 149 TcpWvIn TcpWvOut TcpWvOut disconnect getFrames getTime TcpWvOut TcpWvOut connect TcpWvOut tick tickFrame 153 test Thread Thread Thread start test Thread wait tick ADSR BandedWG Bee Three Bowed 2 sa 127 a 28 36 DelayA DelayL Drummer Echo Envelope Filter Flute FM FMVoices 55 FormSwep HevyMetl Instrmnt JCRev JetTabl Mandolin Mesh2D 7 Modal Modulate Moog Noise NRev OnePole 85 OneZero 8 A PercF lut 8 PitShift 90 Plucked 92 Pee PoleZero PRCRev 99 ReedTabl 100
169. will be thrown if a file is read incrementally and a read error occurs Reimplemented in TepWvIn and WaveLoop 4 72 3 10 MY FLOAT x WvIn tickFrame MY FLOAT frame Vector unsigned int frames virtual Read out sample frames of data to frame Vector An StkError will be thrown if a file is read incrementally and a read error occurs Reimplemented in RtWvIn and cp WvIn The documentation for this class was generated from the following file e Wvln h The Synthesis ToolKit in C by Perry R Cook and Gary P Scavone 1995 2002 4 73 WvOut Class Reference 173 4 73 WvOut Class Reference STK audio data output base class include lt WvOut h gt Inheritance diagram for WvOut Public Methods 000 Default constructor const char fileName unsigned int nChannels 1 FILETYPE typeSWVOUT_WAV Stk STK_ FORMAT formatHSTK SINT16 Overloaded constructor used to specify a file name type and data format with this object e virtual O Class destructor e void const char fileName unsigned int nChannels 1 WvOut FILE _ TYPE type3WVOUT_WAV Stk STK FORMAT for mat STK_SINT16 Create a file of the specified type and name and output samples to it in the given data format e void void If a file is open write out samples in the queue and then close it e unsigned long void const Return the number of sample frames output e MY FLOAT void const Return the number of seconds of data output
170. y R Cook and Gary P Scavone 1995 2002 152 STK Class Documentation e void tick MY_FLOAT sample Output a single sample to all channels in a sample frame e void const MY FLOAT vector unsigned int vectorSize Output each sample in vector to all channels in vectorSize sample frames e void const MY FLOAT frameVector unsigned int frames 1 Output the frameVector of sample frames of the given length 4 65 1 Detailed Description STK internet streaming output class This protected subclass can stream data over a network via a TCP socket connection The data is converted to big endian byte order if necessary before being transmitted TcpWvOut supports multi channel data in interleaved format It is important to distinguish the methods which output single samples to all channels in a sample frame from the tickFramel method which takes a pointer to multi channel sample frame data This class connects to a socket server the port and IP address of which must be specified as constructor arguments The default data type is signed 16 bit integers but any of the defined STK_FORMAT s are permissible by Perry R Cook and Gary P Scavone 1995 2002 4 65 2 Constructor amp Destructor Documentation 4 65 2 1 TcpWvOut TcpWvOut int port const char x hostname localhost unsigned int nChannels 1 Stk STK_FORMAT format STK_SINT16 Overloaded constructor which opens a network connection during i

Download Pdf Manuals

image

Related Search

Related Contents

Manual Veterinário de Colheita e Envio de  BMAF Athletes Registration System – Website User Guide  G A S W A TE R /A G U A  ROSSELLA Plus / NICOLETTA / GISELLA Rossella Plus FORNO  Standard Horizon GX3000E User's Manual  EA#65 - laccei  DESCRIZIONE TECNICA  Home Decorators Collection 1844020270 Use and Care Manual    Samsung SP-L201 Uživatelská přiručka  

Copyright © All rights reserved.
Failed to retrieve file