diff --git a/doc/html/ADSR_8h-source.html b/doc/html/ADSR_8h-source.html new file mode 100644 index 0000000..fb0caf7 --- /dev/null +++ b/doc/html/ADSR_8h-source.html @@ -0,0 +1,76 @@ + +
+

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00016 /***************************************************/ +00017 +00018 #if !defined(__ADSR_H) +00019 #define __ADSR_H +00020 +00021 #include "Envelope.h" +00022 +00023 class ADSR : public Envelope +00024 { +00025 public: +00026 +00028 enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE }; +00029 +00031 ADSR(void); +00032 +00034 ~ADSR(void); +00035 +00037 void keyOn(void); +00038 +00040 void keyOff(void); +00041 +00043 void setAttackRate(MY_FLOAT aRate); +00044 +00046 void setDecayRate(MY_FLOAT aRate); +00047 +00049 void setSustainLevel(MY_FLOAT aLevel); +00050 +00052 void setReleaseRate(MY_FLOAT aRate); +00053 +00055 void setAttackTime(MY_FLOAT aTime); +00056 +00058 void setDecayTime(MY_FLOAT aTime); +00059 +00061 void setReleaseTime(MY_FLOAT aTime); +00062 +00064 void setAllTimes(MY_FLOAT aTime, MY_FLOAT dTime, MY_FLOAT sLevel, MY_FLOAT rTime); +00065 +00067 void setTarget(MY_FLOAT aTarget); +00068 +00070 int getState(void) const; +00071 +00073 void setValue(MY_FLOAT aValue); +00074 +00076 MY_FLOAT tick(void); +00077 +00079 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00080 +00081 protected: +00082 MY_FLOAT attackRate; +00083 MY_FLOAT decayRate; +00084 MY_FLOAT sustainLevel; +00085 MY_FLOAT releaseRate; +00086 }; +00087 +00088 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00030 /***************************************************/ +00031 +00032 #if !defined(__BANDEDWG_H) +00033 #define __BANDEDWG_H +00034 +00035 #define MAX_BANDED_MODES 17 +00036 +00037 #include "Instrmnt.h" +00038 #include "Delay.h" +00039 #include "BowTabl.h" +00040 #include "ADSR.h" +00041 #include "BiQuad.h" +00042 +00043 class BandedWG : public Instrmnt +00044 { +00045 public: +00047 BandedWG(); +00048 +00050 ~BandedWG(); +00051 +00053 void clear(); +00054 +00056 void setStrikePosition(MY_FLOAT position); +00057 +00059 void setPreset(int preset); +00060 +00062 void setFrequency(MY_FLOAT frequency); +00063 +00065 void startBowing(MY_FLOAT amplitude, MY_FLOAT rate); +00066 +00068 void stopBowing(MY_FLOAT rate); +00069 +00071 void pluck(MY_FLOAT amp); +00072 +00074 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00075 +00077 void noteOff(MY_FLOAT amplitude); +00078 +00080 MY_FLOAT tick(); +00081 +00083 void controlChange(int number, MY_FLOAT value); +00084 +00085 protected: +00086 +00087 bool doPluck; +00088 bool trackVelocity; +00089 int nModes; +00090 int presetModes; +00091 BowTabl *bowTabl; +00092 ADSR *adsr; +00093 BiQuad *bandpass; +00094 Delay *delay; +00095 MY_FLOAT maxVelocity; +00096 MY_FLOAT modes[MAX_BANDED_MODES]; +00097 MY_FLOAT freakency; +00098 MY_FLOAT baseGain; +00099 MY_FLOAT gains[MAX_BANDED_MODES]; +00100 MY_FLOAT integrationConstant; +00101 MY_FLOAT bowVelocity; +00102 MY_FLOAT bowTarget; +00103 MY_FLOAT bowPosition; +00104 int strikePosition; +00105 +00106 }; +00107 +00108 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00033 /***************************************************/ +00034 +00035 #if !defined(__BEETHREE_H) +00036 #define __BEETHREE_H +00037 +00038 #include "FM.h" +00039 +00040 class BeeThree : public FM +00041 { +00042 public: +00044 BeeThree(); +00045 +00047 ~BeeThree(); +00048 +00050 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00051 +00053 MY_FLOAT tick(); +00054 }; +00055 +00056 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__BIQUAD_H) +00016 #define __BIQUAD_H +00017 +00018 #include "Filter.h" +00019 +00020 class BiQuad : protected Filter +00021 { +00022 public: +00023 +00025 BiQuad(); +00026 +00028 virtual ~BiQuad(); +00029 +00031 void clear(void); +00032 +00034 void setB0(MY_FLOAT b0); +00035 +00037 void setB1(MY_FLOAT b1); +00038 +00040 void setB2(MY_FLOAT b2); +00041 +00043 void setA1(MY_FLOAT a1); +00044 +00046 void setA2(MY_FLOAT a2); +00047 +00049 +00060 void setResonance(MY_FLOAT frequency, MY_FLOAT radius, bool normalize = FALSE); +00061 +00063 +00069 void setNotch(MY_FLOAT frequency, MY_FLOAT radius); +00070 +00072 +00078 void setEqualGainZeroes(); +00079 +00081 +00085 void setGain(MY_FLOAT theGain); +00086 +00088 MY_FLOAT getGain(void) const; +00089 +00091 MY_FLOAT lastOut(void) const; +00092 +00094 MY_FLOAT tick(MY_FLOAT sample); +00095 +00097 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00098 }; +00099 +00100 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00017 /***************************************************/ +00018 +00019 #if !defined(__BOTTLE_H) +00020 #define __BOTTLE_H +00021 +00022 #include "Instrmnt.h" +00023 #include "JetTabl.h" +00024 #include "BiQuad.h" +00025 #include "PoleZero.h" +00026 #include "Noise.h" +00027 #include "ADSR.h" +00028 #include "WaveLoop.h" +00029 +00030 class BlowBotl : public Instrmnt +00031 { +00032 public: +00034 BlowBotl(); +00035 +00037 ~BlowBotl(); +00038 +00040 void clear(); +00041 +00043 void setFrequency(MY_FLOAT frequency); +00044 +00046 void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); +00047 +00049 void stopBlowing(MY_FLOAT rate); +00050 +00052 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00053 +00055 void noteOff(MY_FLOAT amplitude); +00056 +00058 MY_FLOAT tick(); +00059 +00061 void controlChange(int number, MY_FLOAT value); +00062 +00063 protected: +00064 JetTabl *jetTable; +00065 BiQuad *resonator; +00066 PoleZero *dcBlock; +00067 Noise *noise; +00068 ADSR *adsr; +00069 WaveLoop *vibrato; +00070 MY_FLOAT maxPressure; +00071 MY_FLOAT noiseGain; +00072 MY_FLOAT vibratoGain; +00073 MY_FLOAT outputGain; +00074 +00075 }; +00076 +00077 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00034 /***************************************************/ +00035 +00036 #if !defined(__BLOWHOLE_H) +00037 #define __BLOWHOLE_H +00038 +00039 #include "Instrmnt.h" +00040 #include "DelayL.h" +00041 #include "ReedTabl.h" +00042 #include "OneZero.h" +00043 #include "PoleZero.h" +00044 #include "Envelope.h" +00045 #include "Noise.h" +00046 #include "WaveLoop.h" +00047 +00048 class BlowHole : public Instrmnt +00049 { +00050 public: +00052 BlowHole(MY_FLOAT lowestFrequency); +00053 +00055 ~BlowHole(); +00056 +00058 void clear(); +00059 +00061 void setFrequency(MY_FLOAT frequency); +00062 +00064 void setTonehole(MY_FLOAT newValue); +00065 +00067 void setVent(MY_FLOAT newValue); +00068 +00070 void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); +00071 +00073 void stopBlowing(MY_FLOAT rate); +00074 +00076 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00077 +00079 void noteOff(MY_FLOAT amplitude); +00080 +00082 MY_FLOAT tick(); +00083 +00085 void controlChange(int number, MY_FLOAT value); +00086 +00087 protected: +00088 DelayL *delays[3]; +00089 ReedTabl *reedTable; +00090 OneZero *filter; +00091 PoleZero *tonehole; +00092 PoleZero *vent; +00093 Envelope *envelope; +00094 Noise *noise; +00095 WaveLoop *vibrato; +00096 long length; +00097 MY_FLOAT scatter; +00098 MY_FLOAT th_coeff; +00099 MY_FLOAT r_th; +00100 MY_FLOAT rh_coeff; +00101 MY_FLOAT rh_gain; +00102 MY_FLOAT outputGain; +00103 MY_FLOAT noiseGain; +00104 MY_FLOAT vibratoGain; +00105 +00106 }; +00107 +00108 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00010 /***************************************************/ +00011 +00012 #if !defined(__BOWTABL_H) +00013 #define __BOWTABL_H +00014 +00015 #include "Stk.h" +00016 +00017 class BowTabl : public Stk +00018 { +00019 public: +00021 BowTabl(); +00022 +00024 ~BowTabl(); +00025 +00027 +00033 void setOffset(MY_FLOAT aValue); +00034 +00036 +00040 void setSlope(MY_FLOAT aValue); +00041 +00043 MY_FLOAT lastOut(void) const; +00044 +00046 +00050 MY_FLOAT tick(const MY_FLOAT input); +00051 +00053 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00054 +00055 protected: +00056 MY_FLOAT offSet; +00057 MY_FLOAT slope; +00058 MY_FLOAT lastOutput; +00059 +00060 }; +00061 +00062 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00022 /***************************************************/ +00023 +00024 #if !defined(__BOWED_H) +00025 #define __BOWED_H +00026 +00027 #include "Instrmnt.h" +00028 #include "DelayL.h" +00029 #include "BowTabl.h" +00030 #include "OnePole.h" +00031 #include "BiQuad.h" +00032 #include "WaveLoop.h" +00033 #include "ADSR.h" +00034 +00035 class Bowed : public Instrmnt +00036 { +00037 public: +00039 Bowed(MY_FLOAT lowestFrequency); +00040 +00042 ~Bowed(); +00043 +00045 void clear(); +00046 +00048 void setFrequency(MY_FLOAT frequency); +00049 +00051 void setVibrato(MY_FLOAT gain); +00052 +00054 void startBowing(MY_FLOAT amplitude, MY_FLOAT rate); +00055 +00057 void stopBowing(MY_FLOAT rate); +00058 +00060 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00061 +00063 void noteOff(MY_FLOAT amplitude); +00064 +00066 MY_FLOAT tick(); +00067 +00069 void controlChange(int number, MY_FLOAT value); +00070 +00071 protected: +00072 DelayL *neckDelay; +00073 DelayL *bridgeDelay; +00074 BowTabl *bowTable; +00075 OnePole *stringFilter; +00076 BiQuad *bodyFilter; +00077 WaveLoop *vibrato; +00078 ADSR *adsr; +00079 MY_FLOAT maxVelocity; +00080 MY_FLOAT baseDelay; +00081 MY_FLOAT vibratoGain; +00082 MY_FLOAT betaRatio; +00083 +00084 }; +00085 +00086 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00021 /***************************************************/ +00022 +00023 #if !defined(__BRASS_H) +00024 #define __BRASS_H +00025 +00026 #include "Instrmnt.h" +00027 #include "DelayA.h" +00028 #include "BiQuad.h" +00029 #include "PoleZero.h" +00030 #include "ADSR.h" +00031 #include "WaveLoop.h" +00032 +00033 class Brass: public Instrmnt +00034 { +00035 public: +00037 Brass(MY_FLOAT lowestFrequency); +00038 +00040 ~Brass(); +00041 +00043 void clear(); +00044 +00046 void setFrequency(MY_FLOAT frequency); +00047 +00049 void setLip(MY_FLOAT frequency); +00050 +00052 void startBlowing(MY_FLOAT amplitude,MY_FLOAT rate); +00053 +00055 void stopBlowing(MY_FLOAT rate); +00056 +00058 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00059 +00061 void noteOff(MY_FLOAT amplitude); +00062 +00064 MY_FLOAT tick(); +00065 +00067 void controlChange(int number, MY_FLOAT value); +00068 +00069 protected: +00070 DelayA *delayLine; +00071 BiQuad *lipFilter; +00072 PoleZero *dcBlock; +00073 ADSR *adsr; +00074 WaveLoop *vibrato; +00075 long length; +00076 MY_FLOAT lipTarget; +00077 MY_FLOAT slideTarget; +00078 MY_FLOAT vibratoGain; +00079 MY_FLOAT maxPressure; +00080 +00081 }; +00082 +00083 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00009 /***************************************************/ +00010 +00011 #if !defined(__CHORUS_H) +00012 #define __CHORUS_H +00013 +00014 #include "Stk.h" +00015 #include "DelayL.h" +00016 #include "WaveLoop.h" +00017 +00018 class Chorus : public Stk +00019 { +00020 public: +00022 Chorus(MY_FLOAT baseDelay); +00023 +00025 ~Chorus(); +00026 +00028 void clear(); +00029 +00031 void setModDepth(MY_FLOAT depth); +00032 +00034 void setModFrequency(MY_FLOAT frequency); +00035 +00037 void setEffectMix(MY_FLOAT mix); +00038 +00040 MY_FLOAT lastOut() const; +00041 +00043 MY_FLOAT lastOutLeft() const; +00044 +00046 MY_FLOAT lastOutRight() const; +00047 +00049 MY_FLOAT tick(MY_FLOAT input); +00050 +00052 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00053 +00054 protected: +00055 DelayL *delayLine[2]; +00056 WaveLoop *mods[2]; +00057 MY_FLOAT baseLength; +00058 MY_FLOAT modDepth; +00059 MY_FLOAT lastOutput[2]; +00060 MY_FLOAT effectMix; +00061 +00062 }; +00063 +00064 #endif +00065 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00023 /***************************************************/ +00024 +00025 #if !defined(__CLARINET_H) +00026 #define __CLARINET_H +00027 +00028 #include "Instrmnt.h" +00029 #include "DelayL.h" +00030 #include "ReedTabl.h" +00031 #include "OneZero.h" +00032 #include "Envelope.h" +00033 #include "Noise.h" +00034 #include "WaveLoop.h" +00035 +00036 class Clarinet : public Instrmnt +00037 { +00038 public: +00040 Clarinet(MY_FLOAT lowestFrequency); +00041 +00043 ~Clarinet(); +00044 +00046 void clear(); +00047 +00049 void setFrequency(MY_FLOAT frequency); +00050 +00052 void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); +00053 +00055 void stopBlowing(MY_FLOAT rate); +00056 +00058 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00059 +00061 void noteOff(MY_FLOAT amplitude); +00062 +00064 MY_FLOAT tick(); +00065 +00067 void controlChange(int number, MY_FLOAT value); +00068 +00069 protected: +00070 DelayL *delayLine; +00071 ReedTabl *reedTable; +00072 OneZero *filter; +00073 Envelope *envelope; +00074 Noise *noise; +00075 WaveLoop *vibrato; +00076 long length; +00077 MY_FLOAT outputGain; +00078 MY_FLOAT noiseGain; +00079 MY_FLOAT vibratoGain; +00080 +00081 }; +00082 +00083 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00023 /***************************************************/ +00024 +00025 #if !defined(__DelayA_h) +00026 #define __DelayA_h +00027 +00028 #include "Delay.h" +00029 +00030 class DelayA : public Delay +00031 { +00032 public: +00033 +00035 DelayA(); +00036 +00038 +00039 DelayA(MY_FLOAT theDelay, long maxDelay); +00040 +00042 ~DelayA(); +00043 +00045 void clear(); +00046 +00048 +00051 void setDelay(MY_FLOAT theDelay); +00052 +00054 MY_FLOAT getDelay(void); +00055 +00057 MY_FLOAT tick(MY_FLOAT sample); +00058 +00059 protected: +00060 MY_FLOAT alpha; +00061 MY_FLOAT coeff; +00062 MY_FLOAT apInput; +00063 }; +00064 +00065 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00023 /***************************************************/ +00024 +00025 #if !defined(__DELAYL_H) +00026 #define __DELAYL_H +00027 +00028 #include "Delay.h" +00029 +00030 class DelayL : public Delay +00031 { +00032 public: +00033 +00035 DelayL(); +00036 +00038 +00039 DelayL(MY_FLOAT theDelay, long maxDelay); +00040 +00042 ~DelayL(); +00043 +00045 +00048 void setDelay(MY_FLOAT theDelay); +00049 +00051 MY_FLOAT getDelay(void) const; +00052 +00054 MY_FLOAT tick(MY_FLOAT sample); +00055 +00056 protected: +00057 MY_FLOAT alpha; +00058 MY_FLOAT omAlpha; +00059 }; +00060 +00061 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00019 /***************************************************/ +00020 +00021 #if !defined(__DELAY_H) +00022 #define __DELAY_H +00023 +00024 #include "Filter.h" +00025 +00026 class Delay : protected Filter +00027 { +00028 public: +00029 +00031 Delay(); +00032 +00034 Delay(long theDelay, long maxDelay); +00035 +00037 virtual ~Delay(); +00038 +00040 void clear(); +00041 +00043 +00046 void setDelay(long theDelay); +00047 +00049 long getDelay(void) const; +00050 +00052 MY_FLOAT energy(void) const; +00053 +00055 +00058 MY_FLOAT contentsAt(long tapDelay) const; +00059 +00061 MY_FLOAT lastOut(void) const; +00062 +00064 virtual MY_FLOAT tick(MY_FLOAT sample); +00065 +00067 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00068 +00069 protected: +00070 long inPoint; +00071 long outPoint; +00072 long length; +00073 MY_FLOAT delay; +00074 }; +00075 +00076 #endif +00077 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00016 /***************************************************/ +00017 +00018 #if !defined(__DRUMMER_H) +00019 #define __DRUMMER_H +00020 +00021 #include "Instrmnt.h" +00022 #include "WvIn.h" +00023 #include "OnePole.h" +00024 +00025 #define DRUM_NUMWAVES 11 +00026 #define DRUM_POLYPHONY 4 +00027 +00028 class Drummer : public Instrmnt +00029 { +00030 public: +00032 Drummer(); +00033 +00035 ~Drummer(); +00036 +00038 +00043 void noteOn(MY_FLOAT instrument, MY_FLOAT amplitude); +00044 +00046 void noteOff(MY_FLOAT amplitude); +00047 +00049 MY_FLOAT tick(); +00050 +00051 protected: +00052 WvIn *waves[DRUM_POLYPHONY]; +00053 OnePole *filters[DRUM_POLYPHONY]; +00054 int sounding[DRUM_POLYPHONY]; +00055 int nSounding; +00056 +00057 }; +00058 +00059 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00009 /***************************************************/ +00010 +00011 #if !defined(__ECHO_H) +00012 #define __ECHO_H +00013 +00014 #include "Stk.h" +00015 #include "Delay.h" +00016 +00017 class Echo : public Stk +00018 { +00019 public: +00021 Echo(MY_FLOAT longestDelay); +00022 +00024 ~Echo(); +00025 +00027 void clear(); +00028 +00030 void setDelay(MY_FLOAT delay); +00031 +00033 void setEffectMix(MY_FLOAT mix); +00034 +00036 MY_FLOAT lastOut() const; +00037 +00039 MY_FLOAT tick(MY_FLOAT input); +00040 +00042 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00043 +00044 protected: +00045 Delay *delayLine; +00046 long length; +00047 MY_FLOAT lastOutput; +00048 MY_FLOAT effectMix; +00049 +00050 }; +00051 +00052 #endif +00053 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00014 /***************************************************/ +00015 +00016 #if !defined(__ENVELOPE_H) +00017 #define __ENVELOPE_H +00018 +00019 #include "Stk.h" +00020 +00021 class Envelope : public Stk +00022 { +00023 public: +00024 +00026 Envelope(void); +00027 +00029 virtual ~Envelope(void); +00030 +00032 virtual void keyOn(void); +00033 +00035 virtual void keyOff(void); +00036 +00038 void setRate(MY_FLOAT aRate); +00039 +00041 void setTime(MY_FLOAT aTime); +00042 +00044 virtual void setTarget(MY_FLOAT aTarget); +00045 +00047 virtual void setValue(MY_FLOAT aValue); +00048 +00050 virtual int getState(void) const; +00051 +00053 virtual MY_FLOAT tick(void); +00054 +00056 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00057 +00059 MY_FLOAT lastOut(void) const; +00060 +00061 protected: +00062 MY_FLOAT value; +00063 MY_FLOAT target; +00064 MY_FLOAT rate; +00065 int state; +00066 }; +00067 +00068 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00031 /***************************************************/ +00032 +00033 #if !defined(__FMVOICES_H) +00034 #define __FMVOICES_H +00035 +00036 #include "FM.h" +00037 +00038 class FMVoices : public FM +00039 { +00040 public: +00042 FMVoices(); +00043 +00045 ~FMVoices(); +00046 +00048 virtual void setFrequency(MY_FLOAT frequency); +00049 +00051 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00052 +00054 MY_FLOAT tick(); +00055 +00057 virtual void controlChange(int number, MY_FLOAT value); +00058 +00059 protected: +00060 int currentVowel; +00061 MY_FLOAT tilt[3]; +00062 MY_FLOAT mods[3]; +00063 }; +00064 +00065 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00024 /***************************************************/ +00025 +00026 #if !defined(__FM_H) +00027 #define __FM_H +00028 +00029 #include "Instrmnt.h" +00030 #include "ADSR.h" +00031 #include "WaveLoop.h" +00032 #include "TwoZero.h" +00033 +00034 class FM : public Instrmnt +00035 { +00036 public: +00038 FM( int operators = 4 ); +00039 +00041 virtual ~FM(); +00042 +00044 void clear(); +00045 +00047 void loadWaves(const char **filenames); +00048 +00050 virtual void setFrequency(MY_FLOAT frequency); +00051 +00053 void setRatio(int waveIndex, MY_FLOAT ratio); +00054 +00056 void setGain(int waveIndex, MY_FLOAT gain); +00057 +00059 void setModulationSpeed(MY_FLOAT mSpeed); +00060 +00062 void setModulationDepth(MY_FLOAT mDepth); +00063 +00065 void setControl1(MY_FLOAT cVal); +00066 +00068 void setControl2(MY_FLOAT cVal); +00069 +00071 void keyOn(); +00072 +00074 void keyOff(); +00075 +00077 void noteOff(MY_FLOAT amplitude); +00078 +00080 virtual MY_FLOAT tick() = 0; +00081 +00083 virtual void controlChange(int number, MY_FLOAT value); +00084 +00085 protected: +00086 ADSR **adsr; +00087 WaveLoop **waves; +00088 WaveLoop *vibrato; +00089 TwoZero *twozero; +00090 int nOperators; +00091 MY_FLOAT baseFrequency; +00092 MY_FLOAT *ratios; +00093 MY_FLOAT *gains; +00094 MY_FLOAT modDepth; +00095 MY_FLOAT control1; +00096 MY_FLOAT control2; +00097 MY_FLOAT __FM_gains[100]; +00098 MY_FLOAT __FM_susLevels[16]; +00099 MY_FLOAT __FM_attTimes[32]; +00100 +00101 }; +00102 +00103 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00028 /***************************************************/ +00029 +00030 #if !defined(__FILTER_H) +00031 #define __FILTER_H +00032 +00033 #include "Stk.h" +00034 +00035 class Filter : public Stk +00036 { +00037 public: +00039 Filter(void); +00040 +00042 +00046 Filter(int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients); +00047 +00049 virtual ~Filter(void); +00050 +00052 void clear(void); +00053 +00055 +00060 void setCoefficients(int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients); +00061 +00063 +00069 void setNumerator(int nb, MY_FLOAT *bCoefficients); +00070 +00072 +00080 void setDenominator(int na, MY_FLOAT *aCoefficients); +00081 +00083 +00087 virtual void setGain(MY_FLOAT theGain); +00088 +00090 virtual MY_FLOAT getGain(void) const; +00091 +00093 virtual MY_FLOAT lastOut(void) const; +00094 +00096 virtual MY_FLOAT tick(MY_FLOAT sample); +00097 +00099 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00100 +00101 protected: +00102 MY_FLOAT gain; +00103 int nB; +00104 int nA; +00105 MY_FLOAT *b; +00106 MY_FLOAT *a; +00107 MY_FLOAT *outputs; +00108 MY_FLOAT *inputs; +00109 +00110 }; +00111 +00112 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00023 /***************************************************/ +00024 +00025 #if !defined(__FLUTE_H) +00026 #define __FLUTE_H +00027 +00028 #include "Instrmnt.h" +00029 #include "JetTabl.h" +00030 #include "DelayL.h" +00031 #include "OnePole.h" +00032 #include "PoleZero.h" +00033 #include "Noise.h" +00034 #include "ADSR.h" +00035 #include "WaveLoop.h" +00036 +00037 class Flute : public Instrmnt +00038 { +00039 public: +00041 Flute(MY_FLOAT lowestFrequency); +00042 +00044 ~Flute(); +00045 +00047 void clear(); +00048 +00050 void setFrequency(MY_FLOAT frequency); +00051 +00053 void setJetReflection(MY_FLOAT coefficient); +00054 +00056 void setEndReflection(MY_FLOAT coefficient); +00057 +00059 void setJetDelay(MY_FLOAT aRatio); +00060 +00062 void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); +00063 +00065 void stopBlowing(MY_FLOAT rate); +00066 +00068 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00069 +00071 void noteOff(MY_FLOAT amplitude); +00072 +00074 MY_FLOAT tick(); +00075 +00077 void controlChange(int number, MY_FLOAT value); +00078 +00079 protected: +00080 DelayL *jetDelay; +00081 DelayL *boreDelay; +00082 JetTabl *jetTable; +00083 OnePole *filter; +00084 PoleZero *dcBlock; +00085 Noise *noise; +00086 ADSR *adsr; +00087 WaveLoop *vibrato; +00088 long length; +00089 MY_FLOAT lastFrequency; +00090 MY_FLOAT maxPressure; +00091 MY_FLOAT jetReflection; +00092 MY_FLOAT endReflection; +00093 MY_FLOAT noiseGain; +00094 MY_FLOAT vibratoGain; +00095 MY_FLOAT outputGain; +00096 MY_FLOAT jetRatio; +00097 +00098 }; +00099 +00100 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__FORMSWEP_H) +00016 #define __FORMSWEP_H +00017 +00018 #include "BiQuad.h" +00019 +00020 class FormSwep : public BiQuad +00021 { +00022 public: +00023 +00025 FormSwep(); +00026 +00028 ~FormSwep(); +00029 +00031 +00042 void setResonance(MY_FLOAT aFrequency, MY_FLOAT aRadius); +00043 +00045 void setStates(MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain = 1.0); +00046 +00048 void setTargets(MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain = 1.0); +00049 +00051 +00059 void setSweepRate(MY_FLOAT aRate); +00060 +00062 +00067 void setSweepTime(MY_FLOAT aTime); +00068 +00070 MY_FLOAT tick(MY_FLOAT sample); +00071 +00073 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00074 +00075 protected: +00076 bool dirty; +00077 MY_FLOAT frequency; +00078 MY_FLOAT radius; +00079 MY_FLOAT startFrequency; +00080 MY_FLOAT startRadius; +00081 MY_FLOAT startGain; +00082 MY_FLOAT targetFrequency; +00083 MY_FLOAT targetRadius; +00084 MY_FLOAT targetGain; +00085 MY_FLOAT deltaFrequency; +00086 MY_FLOAT deltaRadius; +00087 MY_FLOAT deltaGain; +00088 MY_FLOAT sweepState; +00089 MY_FLOAT sweepRate; +00090 +00091 }; +00092 +00093 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00029 /***************************************************/ +00030 +00031 #if !defined(__HEVYMETL_H) +00032 #define __HEVYMETL_H +00033 +00034 #include "FM.h" +00035 +00036 class HevyMetl : public FM +00037 { +00038 public: +00040 HevyMetl(); +00041 +00043 ~HevyMetl(); +00044 +00046 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00047 +00049 MY_FLOAT tick(); +00050 }; +00051 +00052 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00010 /***************************************************/ +00011 +00012 #if !defined(__INSTRMNT_H) +00013 #define __INSTRMNT_H +00014 +00015 #include "Stk.h" +00016 #include <iostream.h> +00017 +00018 class Instrmnt : public Stk +00019 { +00020 public: +00022 Instrmnt(); +00023 +00025 virtual ~Instrmnt(); +00026 +00028 virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude) = 0; +00029 +00031 virtual void noteOff(MY_FLOAT amplitude) = 0; +00032 +00034 virtual void setFrequency(MY_FLOAT frequency); +00035 +00037 MY_FLOAT lastOut() const; +00038 +00040 virtual MY_FLOAT tick() = 0; +00041 +00043 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00044 +00046 virtual void controlChange(int number, MY_FLOAT value); +00047 +00048 protected: +00049 MY_FLOAT lastOutput; +00050 +00051 }; +00052 +00053 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00015 /***************************************************/ +00016 +00017 #if !defined(__JCREV_H) +00018 #define __JCREV_H +00019 +00020 #include "Reverb.h" +00021 #include "Delay.h" +00022 +00023 class JCRev : public Reverb +00024 { +00025 public: +00026 // Class constructor taking a T60 decay time argument. +00027 JCRev(MY_FLOAT T60); +00028 +00029 // Class destructor. +00030 ~JCRev(); +00031 +00033 void clear(); +00034 +00036 MY_FLOAT tick(MY_FLOAT input); +00037 +00038 protected: +00039 Delay *allpassDelays[3]; +00040 Delay *combDelays[4]; +00041 Delay *outLeftDelay; +00042 Delay *outRightDelay; +00043 MY_FLOAT allpassCoefficient; +00044 MY_FLOAT combCoefficient[4]; +00045 +00046 }; +00047 +00048 #endif +00049 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00014 /***************************************************/ +00015 +00016 #if !defined(__JETTABL_H) +00017 #define __JETTABL_H +00018 +00019 #include "Stk.h" +00020 +00021 class JetTabl : public Stk +00022 { +00023 public: +00025 JetTabl(); +00026 +00028 ~JetTabl(); +00029 +00031 MY_FLOAT lastOut() const; +00032 +00034 MY_FLOAT tick(MY_FLOAT input); +00035 +00037 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00038 +00039 protected: +00040 MY_FLOAT lastOutput; +00041 +00042 }; +00043 +00044 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00028 /***************************************************/ +00029 +00030 #if !defined(__MANDOLIN_H) +00031 #define __MANDOLIN_H +00032 +00033 #include "PluckTwo.h" +00034 #include "WvIn.h" +00035 +00036 class Mandolin : public PluckTwo +00037 { +00038 public: +00040 Mandolin(MY_FLOAT lowestFrequency); +00041 +00043 virtual ~Mandolin(); +00044 +00046 void pluck(MY_FLOAT amplitude); +00047 +00049 void pluck(MY_FLOAT amplitude,MY_FLOAT position); +00050 +00052 virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00053 +00055 void setBodySize(MY_FLOAT size); +00056 +00058 virtual MY_FLOAT tick(); +00059 +00061 virtual void controlChange(int number, MY_FLOAT value); +00062 +00063 protected: +00064 WvIn *soundfile[12]; +00065 MY_FLOAT directBody; +00066 int mic; +00067 long dampTime; +00068 bool waveDone; +00069 }; +00070 +00071 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00025 /***************************************************/ +00026 +00027 #if !defined(__MESH2D_H) +00028 #define __MESH2D_H +00029 +00030 #include "Instrmnt.h" +00031 #include "OnePole.h" +00032 +00033 #define NXMAX ((short)(12)) +00034 #define NYMAX ((short)(12)) +00035 +00036 class Mesh2D : public Instrmnt +00037 { +00038 public: +00040 Mesh2D(short nX, short nY); +00041 +00043 ~Mesh2D(); +00044 +00046 void clear(); +00047 +00049 void setNX(short lenX); +00050 +00052 void setNY(short lenY); +00053 +00055 void setInputPosition(MY_FLOAT xFactor, MY_FLOAT yFactor); +00056 +00058 void setDecay(MY_FLOAT decayFactor); +00059 +00061 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00062 +00064 void noteOff(MY_FLOAT amplitude); +00065 +00067 MY_FLOAT energy(); +00068 +00070 MY_FLOAT tick(); +00071 +00073 MY_FLOAT tick(MY_FLOAT input); +00074 +00076 void controlChange(int number, MY_FLOAT value); +00077 +00078 protected: +00079 +00080 MY_FLOAT tick0(); +00081 MY_FLOAT tick1(); +00082 void clearMesh(); +00083 +00084 short NX, NY; +00085 short xInput, yInput; +00086 OnePole *filterX[NXMAX]; +00087 OnePole *filterY[NYMAX]; +00088 MY_FLOAT v[NXMAX-1][NYMAX-1]; // junction velocities +00089 MY_FLOAT vxp[NXMAX][NYMAX]; // positive-x velocity wave +00090 MY_FLOAT vxm[NXMAX][NYMAX]; // negative-x velocity wave +00091 MY_FLOAT vyp[NXMAX][NYMAX]; // positive-y velocity wave +00092 MY_FLOAT vym[NXMAX][NYMAX]; // negative-y velocity wave +00093 +00094 // Alternate buffers +00095 MY_FLOAT vxp1[NXMAX][NYMAX]; // positive-x velocity wave +00096 MY_FLOAT vxm1[NXMAX][NYMAX]; // negative-x velocity wave +00097 MY_FLOAT vyp1[NXMAX][NYMAX]; // positive-y velocity wave +00098 MY_FLOAT vym1[NXMAX][NYMAX]; // negative-y velocity wave +00099 +00100 int counter; // time in samples +00101 +00102 +00103 }; +00104 +00105 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00034 /***************************************************/ +00035 +00036 #if !defined(__MESSAGER_H) +00037 #define __MESSSAGER_H +00038 +00039 #include "Stk.h" +00040 #include "SKINI.h" +00041 +00042 #define MESSAGE_LENGTH 128 +00043 #define MAX_MESSAGES 25 +00044 +00045 #if defined(__STK_REALTIME__) +00046 +00047 #include "Thread.h" +00048 #include "Socket.h" +00049 #include "RtMidi.h" +00050 +00051 #define STK_MIDI 0x0001 +00052 #define STK_PIPE 0x0002 +00053 #define STK_SOCKET 0x0004 +00054 +00055 extern "C" THREAD_RETURN THREAD_TYPE stdinHandler(void * ptr); +00056 +00057 #if (defined(__OS_IRIX__) || defined(__OS_LINUX__)) +00058 #include <sys/types.h> +00059 #include <sys/time.h> +00060 #endif +00061 +00062 #endif // __STK_REALTIME__ +00063 +00064 class Messager : public Stk +00065 { +00066 public: +00068 +00075 Messager(int inputMask = 0); +00076 +00078 ~Messager(); +00079 +00081 +00087 long nextMessage(void); +00088 +00090 void setRtDelta(long nSamples); +00091 +00093 long getDelta(void) const; +00094 +00096 long getType() const; +00097 +00099 MY_FLOAT getByteTwo() const; +00100 +00102 MY_FLOAT getByteThree() const; +00103 +00105 long getChannel() const; +00106 +00107 protected: +00108 +00109 SKINI *skini; +00110 long type; +00111 long channel; +00112 MY_FLOAT byte2; +00113 MY_FLOAT byte3; +00114 int sources; +00115 long delta; +00116 long rtDelta; +00117 char message[MAX_MESSAGES][MESSAGE_LENGTH]; +00118 unsigned int messageIndex; +00119 int nMessages; +00120 +00121 #if defined(__STK_REALTIME__) +00122 +00123 // Check MIDI source for new messages. +00124 bool midiMessage(void); +00125 +00126 // Check socket sources for new messages. +00127 bool socketMessage(void); +00128 +00129 // Receive and parse socket data. +00130 bool readSocket(int fd); +00131 +00132 RtMidi *midi; +00133 Thread *thread; +00134 Socket *soket; +00135 +00136 unsigned int nSockets; +00137 fd_set mask; +00138 int maxfd; +00139 int pipefd; +00140 int fd[16]; +00141 char error[256]; +00142 +00143 #endif // __STK_REALTIME__ +00144 +00145 }; +00146 +00147 #endif // defined(__MESSAGER_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00028 /***************************************************/ +00029 +00030 #if !defined(__MODALBAR_H) +00031 #define __MODALBAR_H +00032 +00033 #include "Modal.h" +00034 +00035 class ModalBar : public Modal +00036 { +00037 public: +00039 ModalBar(); +00040 +00042 ~ModalBar(); +00043 +00045 void setStickHardness(MY_FLOAT hardness); +00046 +00048 void setStrikePosition(MY_FLOAT position); +00049 +00051 void setPreset(int preset); +00052 +00054 void setModulationDepth(MY_FLOAT mDepth); +00055 +00057 void controlChange(int number, MY_FLOAT value); +00058 }; +00059 +00060 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00012 /***************************************************/ +00013 +00014 #if !defined(__MODAL_H) +00015 #define __MODAL_H +00016 +00017 #include "Instrmnt.h" +00018 #include "Envelope.h" +00019 #include "WaveLoop.h" +00020 #include "BiQuad.h" +00021 #include "OnePole.h" +00022 +00023 class Modal : public Instrmnt +00024 { +00025 public: +00027 Modal( int modes = 4 ); +00028 +00030 virtual ~Modal(); +00031 +00033 void clear(); +00034 +00036 virtual void setFrequency(MY_FLOAT frequency); +00037 +00039 void setRatioAndRadius(int modeIndex, MY_FLOAT ratio, MY_FLOAT radius); +00040 +00042 void setMasterGain(MY_FLOAT aGain); +00043 +00045 void setDirectGain(MY_FLOAT aGain); +00046 +00048 void setModeGain(int modeIndex, MY_FLOAT gain); +00049 +00051 virtual void strike(MY_FLOAT amplitude); +00052 +00054 void damp(MY_FLOAT amplitude); +00055 +00057 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00058 +00060 void noteOff(MY_FLOAT amplitude); +00061 +00063 virtual MY_FLOAT tick(); +00064 +00066 virtual void controlChange(int number, MY_FLOAT value) = 0; +00067 +00068 protected: +00069 Envelope *envelope; +00070 WvIn *wave; +00071 BiQuad **filters; +00072 OnePole *onepole; +00073 WaveLoop *vibrato; +00074 int nModes; +00075 MY_FLOAT vibratoGain; +00076 MY_FLOAT masterGain; +00077 MY_FLOAT directGain; +00078 MY_FLOAT stickHardness; +00079 MY_FLOAT strikePosition; +00080 MY_FLOAT baseFrequency; +00081 MY_FLOAT *ratios; +00082 MY_FLOAT *radii; +00083 +00084 }; +00085 +00086 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00011 /***************************************************/ +00012 +00013 #if !defined(__MODULATE_H) +00014 #define __MODULATE_H +00015 +00016 #include "Stk.h" +00017 #include "WaveLoop.h" +00018 #include "SubNoise.h" +00019 #include "OnePole.h" +00020 +00021 class Modulate : public Stk +00022 { +00023 public: +00025 Modulate(); +00026 +00028 ~Modulate(); +00029 +00031 void reset(); +00032 +00034 void setVibratoRate(MY_FLOAT aRate); +00035 +00037 void setVibratoGain(MY_FLOAT aGain); +00038 +00040 void setRandomGain(MY_FLOAT aGain); +00041 +00043 MY_FLOAT tick(); +00044 +00046 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00047 +00049 MY_FLOAT lastOut() const; +00050 +00051 protected: +00052 WaveLoop *vibrato; +00053 SubNoise *noise; +00054 OnePole *filter; +00055 MY_FLOAT vibratoGain; +00056 MY_FLOAT randomGain; +00057 MY_FLOAT lastOutput; +00058 +00059 }; +00060 +00061 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00019 /***************************************************/ +00020 +00021 #if !defined(__MOOG_H) +00022 #define __MOOG_H +00023 +00024 #include "Sampler.h" +00025 #include "FormSwep.h" +00026 +00027 class Moog : public Sampler +00028 { +00029 public: +00031 Moog(); +00032 +00034 ~Moog(); +00035 +00037 virtual void setFrequency(MY_FLOAT frequency); +00038 +00040 virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00041 +00043 void setModulationSpeed(MY_FLOAT mSpeed); +00044 +00046 void setModulationDepth(MY_FLOAT mDepth); +00047 +00049 virtual MY_FLOAT tick(); +00050 +00052 virtual void controlChange(int number, MY_FLOAT value); +00053 +00054 protected: +00055 FormSwep *filters[2]; +00056 MY_FLOAT modDepth; +00057 MY_FLOAT filterQ; +00058 MY_FLOAT filterRate; +00059 +00060 }; +00061 +00062 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00017 /***************************************************/ +00018 +00019 #if !defined(__NREV_H) +00020 #define __NREV_H +00021 +00022 #include "Reverb.h" +00023 #include "Delay.h" +00024 +00025 class NRev : public Reverb +00026 { +00027 public: +00028 // Class constructor taking a T60 decay time argument. +00029 NRev(MY_FLOAT T60); +00030 +00031 // Class destructor. +00032 ~NRev(); +00033 +00035 void clear(); +00036 +00038 MY_FLOAT tick(MY_FLOAT input); +00039 +00040 protected: +00041 Delay *allpassDelays[8]; +00042 Delay *combDelays[6]; +00043 MY_FLOAT allpassCoefficient; +00044 MY_FLOAT combCoefficient[6]; +00045 MY_FLOAT lowpassState; +00046 +00047 }; +00048 +00049 #endif +00050 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00011 /***************************************************/ +00012 +00013 #if !defined(__NOISE_H) +00014 #define __NOISE_H +00015 +00016 #include "Stk.h" +00017 +00018 class Noise : public Stk +00019 { +00020 public: +00021 +00023 Noise(); +00024 +00026 virtual ~Noise(); +00027 +00029 virtual MY_FLOAT tick(); +00030 +00032 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00033 +00035 MY_FLOAT lastOut() const; +00036 +00037 protected: +00038 +00039 MY_FLOAT lastOutput; +00040 +00041 }; +00042 +00043 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__ONEPOLE_H) +00016 #define __ONEPOLE_H +00017 +00018 #include "Filter.h" +00019 +00020 class OnePole : protected Filter +00021 { +00022 public: +00023 +00025 OnePole(); +00026 +00028 OnePole(MY_FLOAT thePole); +00029 +00031 ~OnePole(); +00032 +00034 void clear(void); +00035 +00037 void setB0(MY_FLOAT b0); +00038 +00040 void setA1(MY_FLOAT a1); +00041 +00043 +00050 void setPole(MY_FLOAT thePole); +00051 +00053 +00057 void setGain(MY_FLOAT theGain); +00058 +00060 MY_FLOAT getGain(void) const; +00061 +00063 MY_FLOAT lastOut(void) const; +00064 +00066 MY_FLOAT tick(MY_FLOAT sample); +00067 +00069 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00070 }; +00071 +00072 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__ONEZERO_H) +00016 #define __ONEZERO_H +00017 +00018 #include "Filter.h" +00019 +00020 class OneZero : protected Filter +00021 { +00022 public: +00023 +00025 OneZero(); +00026 +00028 OneZero(MY_FLOAT theZero); +00029 +00031 ~OneZero(); +00032 +00034 void clear(void); +00035 +00037 void setB0(MY_FLOAT b0); +00038 +00040 void setB1(MY_FLOAT b1); +00041 +00043 +00050 void setZero(MY_FLOAT theZero); +00051 +00053 +00057 void setGain(MY_FLOAT theGain); +00058 +00060 MY_FLOAT getGain(void) const; +00061 +00063 MY_FLOAT lastOut(void) const; +00064 +00066 MY_FLOAT tick(MY_FLOAT sample); +00067 +00069 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00070 }; +00071 +00072 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00015 /***************************************************/ +00016 +00017 #if !defined(__PRCREV_H) +00018 #define __PRCREV_H +00019 +00020 #include "Reverb.h" +00021 #include "Delay.h" +00022 +00023 class PRCRev : public Reverb +00024 { +00025 public: +00026 // Class constructor taking a T60 decay time argument. +00027 PRCRev(MY_FLOAT T60); +00028 +00029 // Class destructor. +00030 ~PRCRev(); +00031 +00033 void clear(); +00034 +00036 MY_FLOAT tick(MY_FLOAT input); +00037 +00038 protected: +00039 Delay *allpassDelays[2]; +00040 Delay *combDelays[2]; +00041 MY_FLOAT allpassCoefficient; +00042 MY_FLOAT combCoefficient[2]; +00043 +00044 }; +00045 +00046 #endif +00047 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00027 /***************************************************/ +00028 +00029 #if !defined(__PERCFLUT_H) +00030 #define __PERCFLUT_H +00031 +00032 #include "FM.h" +00033 +00034 class PercFlut : public FM +00035 { +00036 public: +00038 PercFlut(); +00039 +00041 ~PercFlut(); +00042 +00044 void setFrequency(MY_FLOAT frequency); +00045 +00047 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00048 +00050 MY_FLOAT tick(); +00051 }; +00052 +00053 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00010 /***************************************************/ +00011 +00012 #if !defined(__PITSHIFT_H) +00013 #define __PITSHIFT_H +00014 +00015 #include "Stk.h" +00016 #include "DelayL.h" +00017 +00018 class PitShift : public Stk +00019 { +00020 public: +00022 PitShift(); +00023 +00025 ~PitShift(); +00026 +00028 void clear(); +00029 +00031 void setShift(MY_FLOAT shift); +00032 +00034 void setEffectMix(MY_FLOAT mix); +00035 +00037 MY_FLOAT lastOut() const; +00038 +00040 MY_FLOAT tick(MY_FLOAT input); +00041 +00043 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00044 +00045 protected: +00046 Delay *delayLine[2]; +00047 MY_FLOAT lastOutput; +00048 MY_FLOAT delay[2]; +00049 MY_FLOAT env[2]; +00050 MY_FLOAT effectMix; +00051 MY_FLOAT rate; +00052 +00053 }; +00054 +00055 #endif +00056 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00019 /***************************************************/ +00020 +00021 #if !defined(__PLUCKTWO_H) +00022 #define __PLUCKTWO_H +00023 +00024 #include "Instrmnt.h" +00025 #include "DelayL.h" +00026 #include "DelayA.h" +00027 #include "OneZero.h" +00028 +00029 class PluckTwo : public Instrmnt +00030 { +00031 public: +00033 PluckTwo(MY_FLOAT lowestFrequency); +00034 +00036 virtual ~PluckTwo(); +00037 +00039 void clear(); +00040 +00042 virtual void setFrequency(MY_FLOAT frequency); +00043 +00045 void setDetune(MY_FLOAT detune); +00046 +00048 void setFreqAndDetune(MY_FLOAT frequency, MY_FLOAT detune); +00049 +00051 void setPluckPosition(MY_FLOAT position); +00052 +00054 +00059 void setBaseLoopGain(MY_FLOAT aGain); +00060 +00062 virtual void noteOff(MY_FLOAT amplitude); +00063 +00065 virtual MY_FLOAT tick() = 0; +00066 +00067 protected: +00068 DelayA *delayLine; +00069 DelayA *delayLine2; +00070 DelayL *combDelay; +00071 OneZero *filter; +00072 OneZero *filter2; +00073 long length; +00074 MY_FLOAT loopGain; +00075 MY_FLOAT baseLoopGain; +00076 MY_FLOAT lastFrequency; +00077 MY_FLOAT lastLength; +00078 MY_FLOAT detuning; +00079 MY_FLOAT pluckAmplitude; +00080 MY_FLOAT pluckPosition; +00081 +00082 }; +00083 +00084 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00018 /***************************************************/ +00019 +00020 #if !defined(__PLUCKED_H) +00021 #define __PLUCKED_H +00022 +00023 #include "Instrmnt.h" +00024 #include "DelayA.h" +00025 #include "OneZero.h" +00026 #include "OnePole.h" +00027 #include "Noise.h" +00028 +00029 class Plucked : public Instrmnt +00030 { +00031 public: +00033 Plucked(MY_FLOAT lowestFrequency); +00034 +00036 ~Plucked(); +00037 +00039 void clear(); +00040 +00042 virtual void setFrequency(MY_FLOAT frequency); +00043 +00045 void pluck(MY_FLOAT amplitude); +00046 +00048 virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00049 +00051 virtual void noteOff(MY_FLOAT amplitude); +00052 +00054 virtual MY_FLOAT tick(); +00055 +00056 protected: +00057 DelayA *delayLine; +00058 OneZero *loopFilter; +00059 OnePole *pickFilter; +00060 Noise *noise; +00061 long length; +00062 MY_FLOAT loopGain; +00063 +00064 }; +00065 +00066 #endif +00067 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__POLEZERO_H) +00016 #define __POLEZERO_H +00017 +00018 #include "Filter.h" +00019 +00020 class PoleZero : protected Filter +00021 { +00022 public: +00023 +00025 PoleZero(); +00026 +00028 ~PoleZero(); +00029 +00031 void clear(void); +00032 +00034 void setB0(MY_FLOAT b0); +00035 +00037 void setB1(MY_FLOAT b1); +00038 +00040 void setA1(MY_FLOAT a1); +00041 +00043 +00048 void setAllpass(MY_FLOAT coefficient); +00049 +00051 +00057 void setBlockZero(MY_FLOAT thePole = 0.99); +00058 +00060 +00064 void setGain(MY_FLOAT theGain); +00065 +00067 MY_FLOAT getGain(void) const; +00068 +00070 MY_FLOAT lastOut(void) const; +00071 +00073 MY_FLOAT tick(MY_FLOAT sample); +00074 +00076 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00077 }; +00078 +00079 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00018 /***************************************************/ +00019 +00020 #if !defined(__REEDTABL_H) +00021 #define __REEDTABL_H +00022 +00023 #include "Stk.h" +00024 +00025 class ReedTabl : public Stk +00026 { +00027 public: +00029 ReedTabl(); +00030 +00032 ~ReedTabl(); +00033 +00035 +00040 void setOffset(MY_FLOAT aValue); +00041 +00043 +00048 void setSlope(MY_FLOAT aValue); +00049 +00051 MY_FLOAT lastOut() const; +00052 +00054 +00058 MY_FLOAT tick(MY_FLOAT input); +00059 +00061 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00062 +00063 protected: +00064 MY_FLOAT offSet; +00065 MY_FLOAT slope; +00066 MY_FLOAT lastOutput; +00067 +00068 }; +00069 +00070 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00018 /***************************************************/ +00019 +00020 #if !defined(__RESONATE_H) +00021 #define __RESONATE_H +00022 +00023 #include "Instrmnt.h" +00024 #include "ADSR.h" +00025 #include "BiQuad.h" +00026 #include "Noise.h" +00027 +00028 class Resonate : public Instrmnt +00029 { +00030 public: +00032 Resonate(); +00033 +00035 ~Resonate(); +00036 +00038 void clear(); +00039 +00041 void setResonance(MY_FLOAT frequency, MY_FLOAT radius); +00042 +00044 void setNotch(MY_FLOAT frequency, MY_FLOAT radius); +00045 +00047 void setEqualGainZeroes(); +00048 +00050 void keyOn(); +00051 +00053 void keyOff(); +00054 +00056 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00057 +00059 void noteOff(MY_FLOAT amplitude); +00060 +00062 MY_FLOAT tick(); +00063 +00065 virtual void controlChange(int number, MY_FLOAT value); +00066 +00067 protected: +00068 ADSR *adsr; +00069 BiQuad *filter; +00070 Noise *noise; +00071 MY_FLOAT poleFrequency; +00072 MY_FLOAT poleRadius; +00073 MY_FLOAT zeroFrequency; +00074 MY_FLOAT zeroRadius; +00075 +00076 }; +00077 +00078 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00010 /***************************************************/ +00011 +00012 #include "Stk.h" +00013 +00014 #if !defined(__REVERB_H) +00015 #define __REVERB_H +00016 +00017 class Reverb : public Stk +00018 { +00019 public: +00021 Reverb(); +00022 +00024 virtual ~Reverb(); +00025 +00027 virtual void clear() = 0; +00028 +00030 void setEffectMix(MY_FLOAT mix); +00031 +00033 MY_FLOAT lastOut() const; +00034 +00036 MY_FLOAT lastOutLeft() const; +00037 +00039 MY_FLOAT lastOutRight() const; +00040 +00042 virtual MY_FLOAT tick(MY_FLOAT input) = 0; +00043 +00045 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00046 +00047 protected: +00048 +00049 // Returns true if argument value is prime. +00050 bool isPrime(int number); +00051 +00052 MY_FLOAT lastOutput[2]; +00053 MY_FLOAT effectMix; +00054 +00055 }; +00056 +00057 #endif // defined(__REVERB_H) +00058 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00031 /***************************************************/ +00032 +00033 #if !defined(__RHODEY_H) +00034 #define __RHODEY_H +00035 +00036 #include "FM.h" +00037 +00038 class Rhodey : public FM +00039 { +00040 public: +00042 Rhodey(); +00043 +00045 ~Rhodey(); +00046 +00048 void setFrequency(MY_FLOAT frequency); +00049 +00051 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00052 +00054 MY_FLOAT tick(); +00055 }; +00056 +00057 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /******************************************/
+00002 /*
+00003 RtAudio - realtime sound I/O C++ class
+00004 by Gary P. Scavone, 2001-2002.
+00005 */
+00006 /******************************************/
+00007
+00008 #if !defined(__RTAUDIO_H)
+00009 #define __RTAUDIO_H
+00010
+00011 #include <map>
+00012
+00013 #if defined(__LINUX_ALSA__)
+00014 #include <alsa/asoundlib.h>
+00015 #include <pthread.h>
+00016 #include <unistd.h>
+00017
+00018 #define THREAD_TYPE
+00019 typedef snd_pcm_t *AUDIO_HANDLE;
+00020 typedef int DEVICE_ID;
+00021 typedef pthread_t THREAD_HANDLE;
+00022 typedef pthread_mutex_t MUTEX;
+00023
+00024 #elif defined(__LINUX_OSS__)
+00025 #include <pthread.h>
+00026 #include <unistd.h>
+00027
+00028 #define THREAD_TYPE
+00029 typedef int AUDIO_HANDLE;
+00030 typedef int DEVICE_ID;
+00031 typedef pthread_t THREAD_HANDLE;
+00032 typedef pthread_mutex_t MUTEX;
+00033
+00034 #elif defined(__WINDOWS_DS__)
+00035 #include <windows.h>
+00036 #include <process.h>
+00037
+00038 // The following struct is used to hold the extra variables
+00039 // specific to the DirectSound implementation.
+00040 typedef struct {
+00041 void * object;
+00042 void * buffer;
+00043 UINT bufferPointer;
+00044 } AUDIO_HANDLE;
+00045
+00046 #define THREAD_TYPE __stdcall
+00047 typedef LPGUID DEVICE_ID;
+00048 typedef unsigned long THREAD_HANDLE;
+00049 typedef CRITICAL_SECTION MUTEX;
+00050
+00051 #elif defined(__IRIX_AL__)
+00052 #include <dmedia/audio.h>
+00053 #include <pthread.h>
+00054 #include <unistd.h>
+00055
+00056 #define THREAD_TYPE
+00057 typedef ALport AUDIO_HANDLE;
+00058 typedef int DEVICE_ID;
+00059 typedef pthread_t THREAD_HANDLE;
+00060 typedef pthread_mutex_t MUTEX;
+00061
+00062 #endif
+00063
+00064
+00065 // *************************************************** //
+00066 //
+00067 // RtError class declaration.
+00068 //
+00069 // *************************************************** //
+00070
+00071 class RtError
+00072 {
+00073 public:
+00074 enum TYPE {
+00075 WARNING,
+00076 DEBUG_WARNING,
+00077 UNSPECIFIED,
+00078 NO_DEVICES_FOUND,
+00079 INVALID_DEVICE,
+00080 INVALID_STREAM,
+00081 MEMORY_ERROR,
+00082 INVALID_PARAMETER,
+00083 DRIVER_ERROR,
+00084 SYSTEM_ERROR,
+00085 THREAD_ERROR
+00086 };
+00087
+00088 protected:
+00089 char error_message[256];
+00090 TYPE type;
+00091
+00092 public:
+00094 RtError(const char *p, TYPE tipe = RtError::UNSPECIFIED);
+00095
+00097 virtual ~RtError(void);
+00098
+00100 virtual void printMessage(void);
+00101
+00103 virtual const TYPE& getType(void) { return type; }
+00104
+00106 virtual const char *getMessage(void) { return error_message; }
+00107 };
+00108
+00109
+00110 // *************************************************** //
+00111 //
+00112 // RtAudio class declaration.
+00113 //
+00114 // *************************************************** //
+00115
+00116 class RtAudio
+00117 {
+00118 public:
+00119
+00120 // Support for signed integers and floats. Audio data fed to/from
+00121 // the tickStream() routine is assumed to ALWAYS be in host
+00122 // byte order. The internal routines will automatically take care of
+00123 // any necessary byte-swapping between the host format and the
+00124 // soundcard. Thus, endian-ness is not a concern in the following
+00125 // format definitions.
+00126 typedef unsigned long RTAUDIO_FORMAT;
+00127 static const RTAUDIO_FORMAT RTAUDIO_SINT8;
+00128 static const RTAUDIO_FORMAT RTAUDIO_SINT16;
+00129 static const RTAUDIO_FORMAT RTAUDIO_SINT24;
+00130 static const RTAUDIO_FORMAT RTAUDIO_SINT32;
+00131 static const RTAUDIO_FORMAT RTAUDIO_FLOAT32;
+00132 static const RTAUDIO_FORMAT RTAUDIO_FLOAT64;
+00133
+00134 //static const int MAX_SAMPLE_RATES = 14;
+00135 enum { MAX_SAMPLE_RATES = 14 };
+00136
+00137 typedef int (*RTAUDIO_CALLBACK)(char *buffer, int bufferSize, void *userData);
+00138
+00139 typedef struct {
+00140 char name[128];
+00141 DEVICE_ID id[2];
+00142 bool probed;
+00143 int maxOutputChannels;
+00144 int maxInputChannels;
+00145 int maxDuplexChannels;
+00146 int minOutputChannels;
+00147 int minInputChannels;
+00148 int minDuplexChannels;
+00149 bool hasDuplexSupport;
+00150 int nSampleRates;
+00151 int sampleRates[MAX_SAMPLE_RATES];
+00152 RTAUDIO_FORMAT nativeFormats;
+00153 } RTAUDIO_DEVICE;
+00154
+00156
+00163 RtAudio();
+00164
+00166
+00177 RtAudio(int *streamId,
+00178 int outputDevice, int outputChannels,
+00179 int inputDevice, int inputChannels,
+00180 RTAUDIO_FORMAT format, int sampleRate,
+00181 int *bufferSize, int numberOfBuffers);
+00182
+00184
+00188 ~RtAudio();
+00189
+00191
+00218 int openStream(int outputDevice, int outputChannels,
+00219 int inputDevice, int inputChannels,
+00220 RTAUDIO_FORMAT format, int sampleRate,
+00221 int *bufferSize, int numberOfBuffers);
+00222
+00224
+00243 void setStreamCallback(int streamId, RTAUDIO_CALLBACK callback, void *userData);
+00244
+00246
+00253 void cancelStreamCallback(int streamId);
+00254
+00256 int getDeviceCount(void);
+00257
+00259
+00269 void getDeviceInfo(int device, RTAUDIO_DEVICE *info);
+00270
+00272
+00277 char * const getStreamBuffer(int streamId);
+00278
+00280
+00285 void tickStream(int streamId);
+00286
+00288
+00292 void closeStream(int streamId);
+00293
+00295
+00299 void startStream(int streamId);
+00300
+00302
+00306 void stopStream(int streamId);
+00307
+00309
+00313 void abortStream(int streamId);
+00314
+00316
+00321 int streamWillBlock(int streamId);
+00322
+00323 protected:
+00324
+00325 private:
+00326
+00327 static const unsigned int SAMPLE_RATES[MAX_SAMPLE_RATES];
+00328
+00329 enum { FAILURE, SUCCESS };
+00330
+00331 enum STREAM_MODE {
+00332 PLAYBACK,
+00333 RECORD,
+00334 DUPLEX,
+00335 UNINITIALIZED = -75
+00336 };
+00337
+00338 enum STREAM_STATE {
+00339 STREAM_STOPPED,
+00340 STREAM_RUNNING
+00341 };
+00342
+00343 typedef struct {
+00344 int device[2]; // Playback and record, respectively.
+00345 STREAM_MODE mode; // PLAYBACK, RECORD, or DUPLEX.
+00346 AUDIO_HANDLE handle[2]; // Playback and record handles, respectively.
+00347 STREAM_STATE state; // STOPPED or RUNNING
+00348 char *userBuffer;
+00349 char *deviceBuffer;
+00350 bool doConvertBuffer[2]; // Playback and record, respectively.
+00351 bool deInterleave[2]; // Playback and record, respectively.
+00352 bool doByteSwap[2]; // Playback and record, respectively.
+00353 int sampleRate;
+00354 int bufferSize;
+00355 int nBuffers;
+00356 int nUserChannels[2]; // Playback and record, respectively.
+00357 int nDeviceChannels[2]; // Playback and record channels, respectively.
+00358 RTAUDIO_FORMAT userFormat;
+00359 RTAUDIO_FORMAT deviceFormat[2]; // Playback and record, respectively.
+00360 bool usingCallback;
+00361 THREAD_HANDLE thread;
+00362 MUTEX mutex;
+00363 RTAUDIO_CALLBACK callback;
+00364 void *userData;
+00365 } RTAUDIO_STREAM;
+00366
+00367 typedef signed short INT16;
+00368 typedef signed int INT32;
+00369 typedef float FLOAT32;
+00370 typedef double FLOAT64;
+00371
+00372 char message[256];
+00373 int nDevices;
+00374 RTAUDIO_DEVICE *devices;
+00375
+00376 std::map<int, void *> streams;
+00377
+00379 void error(RtError::TYPE type);
+00380
+00385 void initialize(void);
+00386
+00388 void clearDeviceInfo(RTAUDIO_DEVICE *info);
+00389
+00397 void probeDeviceInfo(RTAUDIO_DEVICE *info);
+00398
+00405 bool probeDeviceOpen(int device, RTAUDIO_STREAM *stream,
+00406 STREAM_MODE mode, int channels,
+00407 int sampleRate, RTAUDIO_FORMAT format,
+00408 int *bufferSize, int numberOfBuffers);
+00409
+00416 void *verifyStream(int streamId);
+00417
+00422 void convertStreamBuffer(RTAUDIO_STREAM *stream, STREAM_MODE mode);
+00423
+00425 void byteSwapBuffer(char *buffer, int samples, RTAUDIO_FORMAT format);
+00426
+00428 int formatBytes(RTAUDIO_FORMAT format);
+00429 };
+00430
+00431 // Uncomment the following definition to have extra information spewed to stderr.
+00432 //#define RTAUDIO_DEBUG
+00433
+00434 #endif
+| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00022 /***************************************************/ +00023 +00024 #if !defined(__RTDUPLEX_H) +00025 #define __RTDUPLEX_H +00026 +00027 #include "Stk.h" +00028 #include "RtAudio.h" +00029 +00030 class RtDuplex : public Stk +00031 { +00032 public: +00034 +00045 RtDuplex(int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2); +00046 +00048 ~RtDuplex(); +00049 +00051 +00054 void start(void); +00055 +00057 +00060 void stop(void); +00061 +00063 MY_FLOAT lastOut(void) const; +00064 +00066 +00069 MY_FLOAT tick(const MY_FLOAT sample); +00070 +00072 +00075 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00076 +00078 const MY_FLOAT *lastFrame(void) const; +00079 +00081 +00084 MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames = 1); +00085 +00086 protected: +00087 +00088 RtAudio *audio; +00089 MY_FLOAT *data; +00090 MY_FLOAT *lastOutput; +00091 int bufferSize; +00092 bool stopped; +00093 int stream; +00094 long counter; +00095 unsigned int channels; +00096 +00097 }; +00098 +00099 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00030 /***************************************************/ +00031 +00032 #if !defined(__RTMIDI_H) +00033 #define __RTMIDI_H +00034 +00035 #include "Stk.h" +00036 +00037 class RtMidi : public Stk +00038 { +00039 public: +00041 RtMidi(int device = 0); +00042 +00044 ~RtMidi(); +00045 +00047 void printMessage(void) const; +00048 +00050 +00053 int nextMessage(void); +00054 +00056 int getType() const; +00057 +00059 int getChannel() const; +00060 +00062 MY_FLOAT getByteTwo() const; +00063 +00065 MY_FLOAT getByteThree() const; +00066 +00068 MY_FLOAT getDeltaTime() const; +00069 +00070 protected: +00071 int messageType; +00072 int channel; +00073 float byteTwo; +00074 float byteThree; +00075 MY_FLOAT deltaTime; +00076 int readIndex; +00077 +00078 }; +00079 +00080 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00020 /***************************************************/ +00021 +00022 #if !defined(__RTWVIN_H) +00023 #define __RTWVIN_H +00024 +00025 #include "Stk.h" +00026 #include "WvIn.h" +00027 #include "RtAudio.h" +00028 +00029 class RtWvIn : protected WvIn +00030 { +00031 public: +00033 +00044 RtWvIn(int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2); +00045 +00047 ~RtWvIn(); +00048 +00050 +00053 void start(void); +00054 +00056 +00059 void stop(void); +00060 +00062 MY_FLOAT lastOut(void) const; +00063 +00065 +00068 MY_FLOAT tick(void); +00069 +00071 +00074 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00075 +00077 const MY_FLOAT *lastFrame(void) const; +00078 +00080 +00083 const MY_FLOAT *tickFrame(void); +00084 +00086 +00089 MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames); +00090 +00091 protected: +00092 +00093 RtAudio *audio; +00094 bool stopped; +00095 int stream; +00096 long counter; +00097 +00098 }; +00099 +00100 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00019 /***************************************************/ +00020 +00021 #if !defined(__RTWVOUT_H) +00022 #define __RTWVOUT_H +00023 +00024 #include "WvOut.h" +00025 #include "RtAudio.h" +00026 +00027 class RtWvOut : protected WvOut +00028 { +00029 public: +00031 +00042 RtWvOut(unsigned int nChannels = 1, MY_FLOAT sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 4 ); +00043 +00045 ~RtWvOut(); +00046 +00048 +00051 void start(void); +00052 +00054 +00057 void stop(void); +00058 +00060 unsigned long getFrames( void ) const; +00061 +00063 MY_FLOAT getTime( void ) const; +00064 +00066 +00069 void tick(const MY_FLOAT sample); +00070 +00072 +00075 void tick(const MY_FLOAT *vector, unsigned int vectorSize); +00076 +00078 +00081 void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1); +00082 +00083 protected: +00084 +00085 RtAudio *audio; +00086 bool stopped; +00087 int stream; +00088 int bufferSize; +00089 +00090 }; +00091 +00092 #endif // defined(__RTWVOUT_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00026 /***************************************************/ +00027 +00028 #if !defined(__SKINI_H) +00029 #define __SKINI_H +00030 +00031 #include "Stk.h" +00032 #include <stdio.h> +00033 +00034 class SKINI : public Stk +00035 { +00036 public: +00038 SKINI(); +00039 +00041 SKINI(char *fileName); +00042 +00044 ~SKINI(); +00045 +00047 +00050 long parseThis(char* aString); +00051 +00053 +00056 long nextMessage(); +00057 +00059 long getType() const; +00060 +00062 long getChannel() const; +00063 +00065 MY_FLOAT getDelta() const; +00066 +00068 MY_FLOAT getByteTwo() const; +00069 +00071 MY_FLOAT getByteThree() const; +00072 +00074 long getByteTwoInt() const; +00075 +00077 long getByteThreeInt() const; +00078 +00080 const char* getRemainderString(); +00081 +00083 const char* getMessageTypeString(); +00084 +00086 const char* whatsThisType(long type); +00087 +00089 const char* whatsThisController(long number); +00090 +00091 protected: +00092 +00093 FILE *myFile; +00094 long messageType; +00095 char msgTypeString[64]; +00096 long channel; +00097 MY_FLOAT deltaTime; +00098 MY_FLOAT byteTwo; +00099 MY_FLOAT byteThree; +00100 long byteTwoInt; +00101 long byteThreeInt; +00102 char remainderString[1024]; +00103 char whatString[1024]; +00104 }; +00105 +00106 static const double Midi2Pitch[129] = { +00107 8.18,8.66,9.18,9.72,10.30,10.91,11.56,12.25, +00108 12.98,13.75,14.57,15.43,16.35,17.32,18.35,19.45, +00109 20.60,21.83,23.12,24.50,25.96,27.50,29.14,30.87, +00110 32.70,34.65,36.71,38.89,41.20,43.65,46.25,49.00, +00111 51.91,55.00,58.27,61.74,65.41,69.30,73.42,77.78, +00112 82.41,87.31,92.50,98.00,103.83,110.00,116.54,123.47, +00113 130.81,138.59,146.83,155.56,164.81,174.61,185.00,196.00, +00114 207.65,220.00,233.08,246.94,261.63,277.18,293.66,311.13, +00115 329.63,349.23,369.99,392.00,415.30,440.00,466.16,493.88, +00116 523.25,554.37,587.33,622.25,659.26,698.46,739.99,783.99, +00117 830.61,880.00,932.33,987.77,1046.50,1108.73,1174.66,1244.51, +00118 1318.51,1396.91,1479.98,1567.98,1661.22,1760.00,1864.66,1975.53, +00119 2093.00,2217.46,2349.32,2489.02,2637.02,2793.83,2959.96,3135.96, +00120 3322.44,3520.00,3729.31,3951.07,4186.01,4434.92,4698.64,4978.03, +00121 5274.04,5587.65,5919.91,6271.93,6644.88,7040.00,7458.62,7902.13, +00122 8372.02,8869.84,9397.27,9956.06,10548.08,11175.30,11839.82,12543.85, +00123 13289.75}; +00124 +00125 #endif +00126 +00127 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00010 /***************************************************/ +00011 +00012 #if !defined(__SAMPLER_H) +00013 #define __SAMPLER_H +00014 +00015 #include "Instrmnt.h" +00016 #include "ADSR.h" +00017 #include "WvIn.h" +00018 #include "WaveLoop.h" +00019 #include "OnePole.h" +00020 +00021 class Sampler : public Instrmnt +00022 { +00023 public: +00025 Sampler(); +00026 +00028 virtual ~Sampler(); +00029 +00031 void clear(); +00032 +00034 virtual void setFrequency(MY_FLOAT frequency) = 0; +00035 +00037 void keyOn(); +00038 +00040 void keyOff(); +00041 +00043 virtual void noteOff(MY_FLOAT amplitude); +00044 +00046 virtual MY_FLOAT tick(); +00047 +00049 virtual void controlChange(int number, MY_FLOAT value) = 0; +00050 +00051 protected: +00052 ADSR *adsr; +00053 WvIn *attacks[5]; +00054 WaveLoop *loops[5]; +00055 OnePole *filter; +00056 MY_FLOAT baseFrequency; +00057 MY_FLOAT attackRatios[5]; +00058 MY_FLOAT loopRatios[5]; +00059 MY_FLOAT attackGain; +00060 MY_FLOAT loopGain; +00061 int whichOne; +00062 +00063 }; +00064 +00065 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00036 /***************************************************/ +00037 +00038 #if !defined(__SAXOFONY_H) +00039 #define __SAXOFONY_H +00040 +00041 #include "Instrmnt.h" +00042 #include "DelayL.h" +00043 #include "ReedTabl.h" +00044 #include "OneZero.h" +00045 #include "Envelope.h" +00046 #include "Noise.h" +00047 #include "WaveLoop.h" +00048 +00049 class Saxofony : public Instrmnt +00050 { +00051 public: +00053 Saxofony(MY_FLOAT lowestFrequency); +00054 +00056 ~Saxofony(); +00057 +00059 void clear(); +00060 +00062 void setFrequency(MY_FLOAT frequency); +00063 +00065 void setBlowPosition(MY_FLOAT aPosition); +00066 +00068 void startBlowing(MY_FLOAT amplitude, MY_FLOAT rate); +00069 +00071 void stopBlowing(MY_FLOAT rate); +00072 +00074 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00075 +00077 void noteOff(MY_FLOAT amplitude); +00078 +00080 MY_FLOAT tick(); +00081 +00083 void controlChange(int number, MY_FLOAT value); +00084 +00085 protected: +00086 DelayL *delays[2]; +00087 ReedTabl *reedTable; +00088 OneZero *filter; +00089 Envelope *envelope; +00090 Noise *noise; +00091 WaveLoop *vibrato; +00092 long length; +00093 MY_FLOAT outputGain; +00094 MY_FLOAT noiseGain; +00095 MY_FLOAT vibratoGain; +00096 MY_FLOAT position; +00097 +00098 }; +00099 +00100 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00053 /***************************************************/ +00054 +00055 #if !defined(__SHAKERS_H) +00056 #define __SHAKERS_H +00057 +00058 #include "Instrmnt.h" +00059 +00060 #define MAX_FREQS 8 +00061 #define NUM_INSTR 24 +00062 +00063 class Shakers : public Instrmnt +00064 { +00065 public: +00067 Shakers(); +00068 +00070 ~Shakers(); +00071 +00073 +00077 virtual void noteOn(MY_FLOAT instrument, MY_FLOAT amplitude); +00078 +00080 virtual void noteOff(MY_FLOAT amplitude); +00081 +00083 MY_FLOAT tick(); +00084 +00086 virtual void controlChange(int number, MY_FLOAT value); +00087 +00088 protected: +00089 +00090 int setupName(char* instr); +00091 int setupNum(int inst); +00092 int setFreqAndReson(int which, MY_FLOAT freq, MY_FLOAT reson); +00093 void setDecays(MY_FLOAT sndDecay, MY_FLOAT sysDecay); +00094 void setFinalZs(MY_FLOAT z0, MY_FLOAT z1, MY_FLOAT z2); +00095 MY_FLOAT wuter_tick(); +00096 MY_FLOAT tbamb_tick(); +00097 MY_FLOAT ratchet_tick(); +00098 +00099 int instType; +00100 int ratchetPos, lastRatchetPos; +00101 MY_FLOAT shakeEnergy; +00102 MY_FLOAT inputs[MAX_FREQS]; +00103 MY_FLOAT outputs[MAX_FREQS][2]; +00104 MY_FLOAT coeffs[MAX_FREQS][2]; +00105 MY_FLOAT sndLevel; +00106 MY_FLOAT baseGain; +00107 MY_FLOAT gains[MAX_FREQS]; +00108 int nFreqs; +00109 MY_FLOAT t_center_freqs[MAX_FREQS]; +00110 MY_FLOAT center_freqs[MAX_FREQS]; +00111 MY_FLOAT resons[MAX_FREQS]; +00112 MY_FLOAT freq_rand[MAX_FREQS]; +00113 int freqalloc[MAX_FREQS]; +00114 MY_FLOAT soundDecay; +00115 MY_FLOAT systemDecay; +00116 MY_FLOAT nObjects; +00117 MY_FLOAT collLikely; +00118 MY_FLOAT totalEnergy; +00119 MY_FLOAT ratchet,ratchetDelta; +00120 MY_FLOAT finalZ[3]; +00121 MY_FLOAT finalZCoeffs[3]; +00122 MY_FLOAT defObjs[NUM_INSTR]; +00123 MY_FLOAT defDecays[NUM_INSTR]; +00124 MY_FLOAT decayScale[NUM_INSTR]; +00125 +00126 }; +00127 +00128 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00018 /***************************************************/ +00019 +00020 #if !defined(__SIMPLE_H) +00021 #define __SIMPLE_H +00022 +00023 #include "Instrmnt.h" +00024 #include "ADSR.h" +00025 #include "WaveLoop.h" +00026 #include "OnePole.h" +00027 #include "BiQuad.h" +00028 #include "Noise.h" +00029 +00030 class Simple : public Instrmnt +00031 { +00032 public: +00034 Simple(); +00035 +00037 virtual ~Simple(); +00038 +00040 void clear(); +00041 +00043 virtual void setFrequency(MY_FLOAT frequency); +00044 +00046 void keyOn(); +00047 +00049 void keyOff(); +00050 +00052 virtual void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00053 +00055 virtual void noteOff(MY_FLOAT amplitude); +00056 +00058 virtual MY_FLOAT tick(); +00059 +00061 virtual void controlChange(int number, MY_FLOAT value); +00062 +00063 protected: +00064 ADSR *adsr; +00065 WaveLoop *loop; +00066 OnePole *filter; +00067 BiQuad *biquad; +00068 Noise *noise; +00069 MY_FLOAT baseFrequency; +00070 MY_FLOAT loopGain; +00071 +00072 }; +00073 +00074 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00018 /***************************************************/ +00019 +00020 #if !defined(__SITAR_H) +00021 #define __SITAR_H +00022 +00023 #include "Instrmnt.h" +00024 #include "DelayA.h" +00025 #include "OneZero.h" +00026 #include "Noise.h" +00027 #include "ADSR.h" +00028 +00029 class Sitar : public Instrmnt +00030 { +00031 public: +00033 Sitar(MY_FLOAT lowestFrequency); +00034 +00036 ~Sitar(); +00037 +00039 void clear(); +00040 +00042 void setFrequency(MY_FLOAT frequency); +00043 +00045 void pluck(MY_FLOAT amplitude); +00046 +00048 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00049 +00051 void noteOff(MY_FLOAT amplitude); +00052 +00054 MY_FLOAT tick(); +00055 +00056 protected: +00057 DelayA *delayLine; +00058 OneZero *loopFilter; +00059 Noise *noise; +00060 ADSR *envelope; +00061 long length; +00062 MY_FLOAT loopGain; +00063 MY_FLOAT amGain; +00064 MY_FLOAT delay; +00065 MY_FLOAT targetDelay; +00066 +00067 }; +00068 +00069 #endif +00070 +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00019 /***************************************************/ +00020 +00021 #if !defined(__SOCKET_H) +00022 #define __SOCKET_H +00023 +00024 #include "Stk.h" +00025 +00026 class Socket : public Stk +00027 { +00028 public: +00030 +00033 Socket( int port = 2006 ); +00034 +00036 +00039 Socket( int port, const char *hostname ); +00040 +00042 ~Socket(); +00043 +00045 +00053 int connect( int port, const char *hostname = "localhost" ); +00054 +00056 void close( void ); +00057 +00059 int socket( void ) const; +00060 +00062 int port( void ) const; +00063 +00065 +00071 int accept( void ); +00072 +00074 static void setBlocking( int socket, bool enable ); +00075 +00077 static void close( int socket ); +00078 +00080 static bool isValid( int socket ); +00081 +00083 int writeBuffer(const void *buffer, long bufferSize, int flags = 0); +00084 +00086 static int writeBuffer(int socket, const void *buffer, long bufferSize, int flags ); +00087 +00089 int readBuffer(void *buffer, long bufferSize, int flags = 0); +00090 +00092 static int readBuffer(int socket, void *buffer, long bufferSize, int flags ); +00093 +00094 protected: +00095 +00096 char msg[256]; +00097 int soket; +00098 int poort; +00099 bool server; +00100 +00101 }; +00102 +00103 #endif // defined(__SOCKET_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00022 /***************************************************/ +00023 +00024 #if !defined(__StifKarp_h) +00025 #define __StifKarp_h +00026 +00027 #include "Instrmnt.h" +00028 #include "DelayL.h" +00029 #include "DelayA.h" +00030 #include "OneZero.h" +00031 #include "Noise.h" +00032 #include "BiQuad.h" +00033 +00034 class StifKarp : public Instrmnt +00035 { +00036 public: +00038 StifKarp(MY_FLOAT lowestFrequency); +00039 +00041 ~StifKarp(); +00042 +00044 void clear(); +00045 +00047 void setFrequency(MY_FLOAT frequency); +00048 +00050 void setStretch(MY_FLOAT stretch); +00051 +00053 void setPickupPosition(MY_FLOAT position); +00054 +00056 +00061 void setBaseLoopGain(MY_FLOAT aGain); +00062 +00064 void pluck(MY_FLOAT amplitude); +00065 +00067 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00068 +00070 void noteOff(MY_FLOAT amplitude); +00071 +00073 MY_FLOAT tick(); +00074 +00076 void controlChange(int number, MY_FLOAT value); +00077 +00078 protected: +00079 DelayA *delayLine; +00080 DelayL *combDelay; +00081 OneZero *filter; +00082 Noise *noise; +00083 BiQuad *biQuad[4]; +00084 long length; +00085 MY_FLOAT loopGain; +00086 MY_FLOAT baseLoopGain; +00087 MY_FLOAT lastFrequency; +00088 MY_FLOAT lastLength; +00089 MY_FLOAT stretching; +00090 MY_FLOAT pluckAmplitude; +00091 MY_FLOAT pickupPosition; +00092 +00093 }; +00094 +00095 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__STK_H) +00016 #define __STK_H +00017 +00018 // Most data in STK is passed and calculated with the following +00019 // user-definable floating-point type. You can change this to "float" +00020 // if you prefer or perhaps a "long double" in the future. +00021 typedef double MY_FLOAT; +00022 +00024 +00029 class StkError +00030 { +00031 public: +00032 enum TYPE { +00033 WARNING, +00034 DEBUG_WARNING, +00035 FUNCTION_ARGUMENT, +00036 FILE_NOT_FOUND, +00037 FILE_UNKNOWN_FORMAT, +00038 FILE_ERROR, +00039 PROCESS_THREAD, +00040 PROCESS_SOCKET, +00041 PROCESS_SOCKET_IPADDR, +00042 AUDIO_SYSTEM, +00043 MIDI_SYSTEM, +00044 UNSPECIFIED +00045 }; +00046 +00047 protected: +00048 char message[256]; +00049 TYPE type; +00050 +00051 public: +00053 StkError(const char *p, TYPE tipe = StkError::UNSPECIFIED); +00054 +00056 virtual ~StkError(void); +00057 +00059 virtual void printMessage(void); +00060 +00062 virtual const TYPE& getType(void) { return type; } +00063 +00065 virtual const char *getMessage(void) const { return message; } +00066 }; +00067 +00068 +00069 class Stk +00070 { +00071 public: +00072 +00073 typedef unsigned long STK_FORMAT; +00074 static const STK_FORMAT STK_SINT8; +00075 static const STK_FORMAT STK_SINT16; +00076 static const STK_FORMAT STK_SINT32; +00077 static const STK_FORMAT STK_FLOAT32; +00078 static const STK_FORMAT STK_FLOAT64; +00079 +00081 static MY_FLOAT sampleRate(void); +00082 +00084 +00092 static void setSampleRate(MY_FLOAT newRate); +00093 +00095 static void swap16(unsigned char *ptr); +00096 +00098 static void swap32(unsigned char *ptr); +00099 +00101 static void swap64(unsigned char *ptr); +00102 +00104 static void sleep(unsigned long milliseconds); +00105 +00106 private: +00107 static MY_FLOAT srate; +00108 +00109 protected: +00110 +00112 Stk(void); +00113 +00115 virtual ~Stk(void); +00116 +00118 static void handleError( const char *message, StkError::TYPE type ); +00119 +00120 }; +00121 +00122 // Here are a few other useful typedefs. +00123 typedef signed short SINT16; +00124 typedef signed int SINT32; +00125 typedef float FLOAT32; +00126 typedef double FLOAT64; +00127 +00128 // Boolean values +00129 #define FALSE 0 +00130 #define TRUE 1 +00131 +00132 // The default sampling rate. +00133 #define SRATE (MY_FLOAT) 22050.0 +00134 +00135 // Real-time audio input and output buffer size. If clicks are +00136 // occuring in the input and/or output sound stream, a larger buffer +00137 // size may help. Larger buffer sizes, however, produce more latency. +00138 +00139 #define RT_BUFFER_SIZE 512 +00140 +00141 // The RAWWAVE_PATH definition is concatenated to the beginning of all +00142 // references to rawwave files in the various STK core classes +00143 // (ex. Clarinet.cpp). If you wish to move the rawwaves directory to +00144 // a different location in your file system, you will need to set this +00145 // path definition appropriately. The current definition is a +00146 // relative reference that will work "out of the box" for the STK +00147 // distribution. +00148 #define RAWWAVE_PATH "../../" +00149 +00150 #define PI (MY_FLOAT) 3.14159265359 +00151 #define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI) +00152 +00153 #define ONE_OVER_128 (MY_FLOAT) 0.0078125 +00154 +00155 #if defined(__WINDOWS_DS__) +00156 #define __OS_WINDOWS__ +00157 #define __STK_REALTIME__ +00158 #elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) +00159 #define __OS_LINUX__ +00160 #define __STK_REALTIME__ +00161 #elif defined(__IRIX_AL__) +00162 #define __OS_IRIX__ +00163 #define __STK_REALTIME__ +00164 #endif +00165 +00166 //#define _STK_DEBUG_ +00167 +00168 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00011 /***************************************************/ +00012 +00013 #if !defined(__SUBNOISE_H) +00014 #define __SUBNOISE_H +00015 +00016 #include "Noise.h" +00017 +00018 class SubNoise : public Noise +00019 { +00020 public: +00021 +00023 SubNoise(int subRate = 16); +00024 +00026 ~SubNoise(); +00027 +00029 int subRate(void) const; +00030 +00032 void setRate(int subRate); +00033 +00035 MY_FLOAT tick(); +00036 +00037 protected: +00038 int counter; +00039 int rate; +00040 +00041 }; +00042 +00043 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00015 /***************************************************/ +00016 +00017 #if !defined(__TABLE_H) +00018 #define __TABLE_H +00019 +00020 #include "Stk.h" +00021 +00022 class Table : public Stk +00023 { +00024 public: +00026 Table(char *fileName); +00027 +00029 ~Table(); +00030 +00032 long getLength() const; +00033 +00035 MY_FLOAT lastOut() const; +00036 +00038 +00042 MY_FLOAT tick(MY_FLOAT index); +00043 +00045 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00046 +00047 protected: +00048 long length; +00049 MY_FLOAT *data; +00050 MY_FLOAT lastOutput; +00051 +00052 }; +00053 +00054 #endif // defined(__TABLE_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/
+00027 /***************************************************/
+00028
+00029 #if !defined(__TCPWVIN_H)
+00030 #define __TCPWVIN_H
+00031
+00032 #include "WvIn.h"
+00033 #include "Socket.h"
+00034 #include "Thread.h"
+00035
+00036 typedef struct {
+00037 bool finished;
+00038 void *object;
+00039 } thread_info;
+00040
+00041 class TcpWvIn : protected WvIn
+00042 {
+00043 public:
+00045
+00048 TcpWvIn( int port = 2006 );
+00049
+00051 ~TcpWvIn();
+00052
+00054
+00057 void listen(unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16);
+00058
+00060
+00064 bool isConnected(void);
+00065
+00067 MY_FLOAT lastOut(void) const;
+00068
+00070 MY_FLOAT tick(void);
+00071
+00073 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
+00074
+00076 const MY_FLOAT *lastFrame(void) const;
+00077
+00079 const MY_FLOAT *tickFrame(void);
+00080
+00082 MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames);
+00083
+00084 // Called by the thread routine to receive data via the socket connection
+00085 // and fill the socket buffer. This is not intended for general use but
+00086 // had to be made public for access from the thread.
+00087 void receive(void);
+00088
+00089 protected:
+00090
+00091 // Initialize class variables.
+00092 void init( int port );
+00093
+00094 // Read buffered socket data into the data buffer ... will block if none available.
+00095 int readData( void );
+00096
+00097 Socket *soket;
+00098 Thread *thread;
+00099 Mutex mutex;
+00100 char *buffer;
+00101 long bufferBytes;
+00102 long bytesFilled;
+00103 long writePoint;
+00104 long readPoint;
+00105 long counter;
+00106 int dataSize;
+00107 bool connected;
+00108 int fd;
+00109 thread_info threadInfo;
+00110
+00111 };
+00112
+00113 #endif
+| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00026 /***************************************************/ +00027 +00028 #if !defined(__TCPWVOUT_H) +00029 #define __TCPWVOUT_H +00030 +00031 #include "WvOut.h" +00032 #include "Socket.h" +00033 +00034 class TcpWvOut : protected WvOut +00035 { +00036 public: +00038 TcpWvOut(); +00039 +00041 +00044 TcpWvOut(int port, const char *hostname = "localhost", unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16); +00045 +00047 ~TcpWvOut(); +00048 +00050 +00053 void connect(int port, const char *hostname = "localhost", unsigned int nChannels = 1, Stk::STK_FORMAT format = STK_SINT16); +00054 +00056 void disconnect(void); +00057 +00059 unsigned long getFrames( void ) const; +00060 +00062 MY_FLOAT getTime( void ) const; +00063 +00065 +00068 void tick(MY_FLOAT sample); +00069 +00071 +00074 void tick(const MY_FLOAT *vector, unsigned int vectorSize); +00075 +00077 +00080 void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1); +00081 +00082 protected: +00083 +00084 // Write a buffer of length \e frames via the socket connection. +00085 void writeData( long frames ); +00086 +00087 char msg[256]; +00088 char *buffer; +00089 Socket *soket; +00090 int dataSize; +00091 }; +00092 +00093 #endif // defined(__TCPWVOUT_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00012 /***************************************************/ +00013 +00014 #if !defined(__THREAD_H) +00015 #define __THREAD_H +00016 +00017 #include "Stk.h" +00018 +00019 #if (defined(__OS_IRIX__) || defined(__OS_LINUX__)) +00020 +00021 #include <pthread.h> +00022 #define THREAD_TYPE +00023 typedef pthread_t THREAD_HANDLE; +00024 typedef void * THREAD_RETURN; +00025 typedef void * (*THREAD_FUNCTION)(void *); +00026 typedef pthread_mutex_t MUTEX; +00027 +00028 #elif defined(__OS_WINDOWS__) +00029 +00030 #include <windows.h> +00031 #include <process.h> +00032 #define THREAD_TYPE __stdcall +00033 typedef unsigned long THREAD_HANDLE; +00034 typedef unsigned THREAD_RETURN; +00035 typedef unsigned (__stdcall *THREAD_FUNCTION)(void *); +00036 typedef CRITICAL_SECTION MUTEX; +00037 +00038 #endif +00039 +00040 class Thread : public Stk +00041 { +00042 public: +00044 Thread(); +00045 +00047 ~Thread(); +00048 +00050 +00054 bool start( THREAD_FUNCTION routine, void * ptr = NULL ); +00055 +00057 +00063 bool wait( long milliseconds = -1 ); +00064 +00066 static void test(void); +00067 +00068 protected: +00069 +00070 THREAD_HANDLE thread; +00071 +00072 }; +00073 +00074 class Mutex : public Stk +00075 { +00076 public: +00078 Mutex(); +00079 +00081 ~Mutex(); +00082 +00084 void lock(void); +00085 +00087 void unlock(void); +00088 +00089 protected: +00090 +00091 MUTEX mutex; +00092 +00093 }; +00094 +00095 #endif // defined(__THREAD_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00031 /***************************************************/ +00032 +00033 #if !defined(__TUBEBELL_H) +00034 #define __TUBEBELL_H +00035 +00036 #include "FM.h" +00037 +00038 class TubeBell : public FM +00039 { +00040 public: +00042 TubeBell(); +00043 +00045 ~TubeBell(); +00046 +00048 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00049 +00051 MY_FLOAT tick(); +00052 }; +00053 +00054 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__TWOPOLE_H) +00016 #define __TWOPOLE_H +00017 +00018 #include "Filter.h" +00019 +00020 class TwoPole : protected Filter +00021 { +00022 public: +00023 +00025 TwoPole(); +00026 +00028 ~TwoPole(); +00029 +00031 void clear(void); +00032 +00034 void setB0(MY_FLOAT b0); +00035 +00037 void setA1(MY_FLOAT a1); +00038 +00040 void setA2(MY_FLOAT a2); +00041 +00043 +00056 void setResonance(MY_FLOAT frequency, MY_FLOAT radius, bool normalize = FALSE); +00057 +00059 +00063 void setGain(MY_FLOAT theGain); +00064 +00066 MY_FLOAT getGain(void) const; +00067 +00069 MY_FLOAT lastOut(void) const; +00070 +00072 MY_FLOAT tick(MY_FLOAT sample); +00073 +00075 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00076 }; +00077 +00078 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00013 /***************************************************/ +00014 +00015 #if !defined(__TWOZERO_H) +00016 #define __TWOZERO_H +00017 +00018 #include "Filter.h" +00019 +00020 class TwoZero : protected Filter +00021 { +00022 public: +00024 TwoZero(); +00025 +00027 ~TwoZero(); +00028 +00030 void clear(void); +00031 +00033 void setB0(MY_FLOAT b0); +00034 +00036 void setB1(MY_FLOAT b1); +00037 +00039 void setB2(MY_FLOAT b2); +00040 +00042 +00052 void setNotch(MY_FLOAT frequency, MY_FLOAT radius); +00053 +00055 +00059 void setGain(MY_FLOAT theGain); +00060 +00062 MY_FLOAT getGain(void) const; +00063 +00065 MY_FLOAT lastOut(void) const; +00066 +00068 MY_FLOAT tick(MY_FLOAT sample); +00069 +00071 MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00072 }; +00073 +00074 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00019 /***************************************************/ +00020 +00021 #if !defined(__WAVELOOP_H) +00022 #define __WAVELOOP_H +00023 +00024 #include "WvIn.h" +00025 #include <stdio.h> +00026 +00027 class WaveLoop : public WvIn +00028 { +00029 public: +00031 WaveLoop( const char *fileName, bool raw = FALSE ); +00032 +00034 virtual ~WaveLoop(); +00035 +00037 +00043 void setFrequency(MY_FLOAT aFrequency); +00044 +00046 void addTime(MY_FLOAT aTime); +00047 +00049 +00054 void addPhase(MY_FLOAT anAngle); +00055 +00057 +00062 void addPhaseOffset(MY_FLOAT anAngle); +00063 +00065 const MY_FLOAT *tickFrame(void); +00066 +00067 protected: +00068 +00069 // Read file data. +00070 void readData(unsigned long index); +00071 +00072 MY_FLOAT phaseOffset; +00073 +00074 }; +00075 +00076 #endif // defined(__WAVELOOP_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00031 /***************************************************/ +00032 +00033 #if !defined(__WURLEY_H) +00034 #define __WURLEY_H +00035 +00036 #include "FM.h" +00037 +00038 class Wurley : public FM +00039 { +00040 public: +00042 Wurley(); +00043 +00045 ~Wurley(); +00046 +00048 void setFrequency(MY_FLOAT frequency); +00049 +00051 void noteOn(MY_FLOAT frequency, MY_FLOAT amplitude); +00052 +00054 MY_FLOAT tick(); +00055 }; +00056 +00057 #endif +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00037 /***************************************************/ +00038 +00039 #if !defined(__WVIN_H) +00040 #define __WVIN_H +00041 +00042 // Files larger than CHUNK_THRESHOLD will be copied into memory +00043 // in CHUNK_SIZE increments, rather than completely loaded into +00044 // a buffer at once. +00045 +00046 #define CHUNK_THRESHOLD 5000000 // 5 Mb +00047 #define CHUNK_SIZE 1024 // sample frames +00048 +00049 #include "Stk.h" +00050 #include <stdio.h> +00051 +00052 class WvIn : public Stk +00053 { +00054 public: +00056 WvIn(); +00057 +00059 +00063 WvIn( const char *fileName, bool raw = FALSE ); +00064 +00066 virtual ~WvIn(); +00067 +00069 +00073 void openFile( const char *fileName, bool raw = FALSE ); +00074 +00076 void closeFile(void); +00077 +00079 void reset(void); +00080 +00082 +00088 void normalize(void); +00089 +00091 +00097 void normalize(MY_FLOAT peak); +00098 +00100 unsigned long getSize(void) const; +00101 +00103 unsigned int getChannels(void) const; +00104 +00106 +00111 MY_FLOAT getFileRate(void) const; +00112 +00114 bool isFinished(void) const; +00115 +00117 +00120 void setRate(MY_FLOAT aRate); +00121 +00123 virtual void addTime(MY_FLOAT aTime); +00124 +00126 +00132 void setInterpolate(bool doInterpolate); +00133 +00135 virtual MY_FLOAT lastOut(void) const; +00136 +00138 +00141 virtual MY_FLOAT tick(void); +00142 +00144 +00147 virtual MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize); +00148 +00150 virtual const MY_FLOAT *lastFrame(void) const; +00151 +00153 +00156 virtual const MY_FLOAT *tickFrame(void); +00157 +00159 +00162 virtual MY_FLOAT *tickFrame(MY_FLOAT *frameVector, unsigned int frames); +00163 +00164 protected: +00165 +00166 // Initialize class variables. +00167 void init( void ); +00168 +00169 // Read file data. +00170 virtual void readData(unsigned long index); +00171 +00172 // Get STK RAW file information. +00173 bool getRawInfo( const char *fileName ); +00174 +00175 // Get WAV file header information. +00176 bool getWavInfo( const char *fileName ); +00177 +00178 // Get SND (AU) file header information. +00179 bool getSndInfo( const char *fileName ); +00180 +00181 // Get AIFF file header information. +00182 bool getAifInfo( const char *fileName ); +00183 +00184 // Get MAT-file header information. +00185 bool getMatInfo( const char *fileName ); +00186 +00187 char msg[256]; +00188 FILE *fd; +00189 MY_FLOAT *data; +00190 MY_FLOAT *lastOutput; +00191 bool chunking; +00192 bool finished; +00193 bool interpolate; +00194 bool byteswap; +00195 unsigned long fileSize; +00196 unsigned long bufferSize; +00197 unsigned long dataOffset; +00198 unsigned int channels; +00199 long chunkPointer; +00200 STK_FORMAT dataType; +00201 MY_FLOAT fileRate; +00202 MY_FLOAT gain; +00203 MY_FLOAT time; +00204 MY_FLOAT rate; +00205 }; +00206 +00207 #endif // defined(__WVIN_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
00001 /***************************************************/ +00034 /***************************************************/ +00035 +00036 #if !defined(__WVOUT_H) +00037 #define __WVOUT_H +00038 +00039 #include "Stk.h" +00040 #include <stdio.h> +00041 +00042 #define BUFFER_SIZE 1024 // sample frames +00043 +00044 class WvOut : public Stk +00045 { +00046 public: +00047 +00048 typedef unsigned long FILE_TYPE; +00049 +00050 static const FILE_TYPE WVOUT_RAW; +00051 static const FILE_TYPE WVOUT_WAV; +00052 static const FILE_TYPE WVOUT_SND; +00053 static const FILE_TYPE WVOUT_AIF; +00054 static const FILE_TYPE WVOUT_MAT; +00055 +00057 WvOut(); +00058 +00060 +00063 WvOut( const char *fileName, unsigned int nChannels = 1, FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 ); +00064 +00066 virtual ~WvOut(); +00067 +00069 +00072 void openFile( const char *fileName, unsigned int nChannels = 1, +00073 WvOut::FILE_TYPE type = WVOUT_WAV, Stk::STK_FORMAT format = STK_SINT16 ); +00074 +00076 void closeFile( void ); +00077 +00079 unsigned long getFrames( void ) const; +00080 +00082 MY_FLOAT getTime( void ) const; +00083 +00085 +00088 virtual void tick(const MY_FLOAT sample); +00089 +00091 +00094 virtual void tick(const MY_FLOAT *vector, unsigned int vectorSize); +00095 +00097 +00100 virtual void tickFrame(const MY_FLOAT *frameVector, unsigned int frames = 1); +00101 +00102 protected: +00103 +00104 // Initialize class variables. +00105 void init( void ); +00106 +00107 // Write data to output file; +00108 virtual void writeData( unsigned long frames ); +00109 +00110 // Write STK RAW file header. +00111 bool setRawFile( const char *fileName ); +00112 +00113 // Write WAV file header. +00114 bool setWavFile( const char *fileName ); +00115 +00116 // Close WAV file, updating the header. +00117 void closeWavFile( void ); +00118 +00119 // Write SND (AU) file header. +00120 bool setSndFile( const char *fileName ); +00121 +00122 // Close SND file, updating the header. +00123 void closeSndFile( void ); +00124 +00125 // Write AIFF file header. +00126 bool setAifFile( const char *fileName ); +00127 +00128 // Close AIFF file, updating the header. +00129 void closeAifFile( void ); +00130 +00131 // Write MAT-file header. +00132 bool setMatFile( const char *fileName ); +00133 +00134 // Close MAT-file, updating the header. +00135 void closeMatFile( void ); +00136 +00137 char msg[256]; +00138 FILE *fd; +00139 MY_FLOAT *data; +00140 FILE_TYPE fileType; +00141 STK_FORMAT dataType; +00142 bool byteswap; +00143 unsigned int channels; +00144 unsigned long counter; +00145 unsigned long totalCount; +00146 +00147 }; +00148 +00149 #endif // defined(__WVOUT_H) +
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [static] [virtual] [virtual] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <ADSR.h>
+
+
Inheritance diagram for ADSR:: +

Public Types | |
| enum | { + ATTACK, +DECAY, +SUSTAIN, +RELEASE, + + DONE + + } |
| Envelope states. | |
Public Methods | |
| + | ADSR (void) |
| Default constructor. | |
| + | ~ADSR (void) |
| Class destructor. | |
| +void | keyOn (void) |
| Set target = 1, state = ADSR::ATTACK. | |
| +void | keyOff (void) |
| Set target = 0, state = ADSR::RELEASE. | |
| +void | setAttackRate (MY_FLOAT aRate) |
| Set the attack rate. | |
| +void | setDecayRate (MY_FLOAT aRate) |
| Set the decay rate. | |
| +void | setSustainLevel (MY_FLOAT aLevel) |
| Set the sustain level. | |
| +void | setReleaseRate (MY_FLOAT aRate) |
| Set the release rate. | |
| +void | setAttackTime (MY_FLOAT aTime) |
| Set the attack rate based on a time duration. | |
| +void | setDecayTime (MY_FLOAT aTime) |
| Set the decay rate based on a time duration. | |
| +void | setReleaseTime (MY_FLOAT aTime) |
| Set the release rate based on a time duration. | |
| +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 on time durations. | |
| +void | setTarget (MY_FLOAT aTarget) |
| Set the target value. | |
| +int | getState (void) const |
| Return the current envelope state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE). | |
| +void | setValue (MY_FLOAT aValue) |
| Set to state = ADSR::SUSTAIN with current and target values of aValue. | |
| +MY_FLOAT | tick (void) |
| Return one envelope output value. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Return vectorSize envelope outputs in vector. | |
+This 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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <BandedWG.h>
+
+
Inheritance diagram for BandedWG:: +

Public Methods | |
| + | BandedWG () |
| Class constructor. | |
| + | ~BandedWG () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setStrikePosition (MY_FLOAT position) |
| Set strike position (0.0 - 1.0). | |
| +void | setPreset (int preset) |
| Select a preset. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | startBowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply bow velocity/pressure to instrument with given amplitude and rate of increase. | |
| +void | stopBowing (MY_FLOAT rate) |
| Decrease bow velocity/breath pressure with given rate of decrease. | |
| +void | pluck (MY_FLOAT amp) |
| Pluck the instrument with given amplitude. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class uses banded waveguide techniques to model a variety of sounds, including bowed bars, glasses, and bowls. For more information, see Essl, G. and Cook, P. "Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments", Proceedings of the 1999 International Computer Music Conference. +
+Control Change Numbers:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <BeeThree.h>
+
+
Inheritance diagram for BeeThree:: +

Public Methods | |
| + | BeeThree () |
| Class constructor. | |
| + | ~BeeThree () |
| Class destructor. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements a simple 4 operator topology, also referred to as algorithm 8 of the TX81Z. +
+
Algorithm 8 is : + 1 --. + 2 -\| + +-> Out + 3 -/| + 4 --
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <BiQuad.h>
+
+
Inheritance diagram for BiQuad:: +

Public Methods | |
| + | BiQuad () |
| Default constructor creates a second-order pass-through filter. | |
| +virtual | ~BiQuad () |
| Class destructor. | |
| +void | clear (void) |
| Clears all internal states of the filter. | |
| +void | setB0 (MY_FLOAT b0) |
| Set the b[0] coefficient value. | |
| +void | setB1 (MY_FLOAT b1) |
| Set the b[1] coefficient value. | |
| +void | setB2 (MY_FLOAT b2) |
| Set the b[2] coefficient value. | |
| +void | setA1 (MY_FLOAT a1) |
| Set the a[1] coefficient value. | |
| +void | setA2 (MY_FLOAT a2) |
| Set the a[2] coefficient value. | |
| void | setResonance (MY_FLOAT frequency, MY_FLOAT radius, bool normalize=FALSE) |
| Sets the filter coefficients for a resonance at frequency (in Hz). More... | |
| void | setNotch (MY_FLOAT frequency, MY_FLOAT radius) |
| Set the filter coefficients for a notch at frequency (in Hz). More... | |
| void | setEqualGainZeroes () |
| Sets the filter zeroes for equal resonance gain. More... | |
| void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This protected Filter 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. +
+
+
+
|
+
| + + | +
+
+ +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 filter zeros are placed at z = 1, z = -1, and the coefficients are then normalized to produce a constant unity peak 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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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 Filter. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <BlowBotl.h>
+
+
Inheritance diagram for BlowBotl:: +

Public Methods | |
| + | BlowBotl () |
| Class constructor. | |
| + | ~BlowBotl () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | startBlowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath velocity to instrument with given amplitude and rate of increase. | |
| +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 | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class implements a helmholtz resonator (biquad filter) with a polynomial jet excitation (a la Cook). +
+Control Change Numbers:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <BlowHole.h>
+
+
Inheritance diagram for BlowHole:: +

Public Methods | |
| + | BlowHole (MY_FLOAT lowestFrequency) |
| Class constructor. | |
| + | ~BlowHole () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setTonehole (MY_FLOAT newValue) |
| Set the tonehole state (0.0 = closed, 1.0 = fully open). | |
| +void | setVent (MY_FLOAT newValue) |
| Set the register hole state (0.0 = closed, 1.0 = fully open). | |
| +void | startBlowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath pressure to instrument with given amplitude and rate of increase. | |
| +void | stopBlowing (MY_FLOAT rate) |
| Decrease breath pressure with given rate of decrease. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class is based on the clarinet model, with the addition of a two-port register hole and a three-port dynamic tonehole implementation, as discussed by Scavone and Cook (1998). +
+In this implementation, the distances between the reed/register hole and tonehole/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:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <BowTabl.h>
+
+
Inheritance diagram for BowTabl:: +

Public Methods | |
| + | BowTabl () |
| Default constructor. | |
| + | ~BowTabl () |
| Class destructor. | |
| void | setOffset (MY_FLOAT aValue) |
| Set the table offset value. More... | |
| void | setSlope (MY_FLOAT aValue) |
| Set the table slope value. More... | |
| +MY_FLOAT | lastOut (void) const |
| Return the last output value. | |
| MY_FLOAT | tick (const MY_FLOAT input) |
| Return the function value for input. More... | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Take vectorSize inputs and return the corresponding function values in vector. | |
+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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Set the table slope value. + +The table slope controls the width of the friction pulse, which is related to bow force. |
+
+
+
|
+
| + + | +
+
+ +Return the function value for input. + +The function input represents differential string-to-bow velocity. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Bowed.h>
+
+
Inheritance diagram for Bowed:: +

Public Methods | |
| + | Bowed (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Bowed () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setVibrato (MY_FLOAT gain) |
| Set vibrato gain. | |
| +void | startBowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath pressure to instrument with given amplitude and rate of increase. | |
| +void | stopBowing (MY_FLOAT rate) |
| Decrease breath pressure with given rate of decrease. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+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:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Brass.h>
+
+
Inheritance diagram for Brass:: +

Public Methods | |
| + | Brass (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Brass () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setLip (MY_FLOAT frequency) |
| Set the lips frequency. | |
| +void | startBlowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath pressure to instrument with given amplitude and rate of increase. | |
| +void | stopBlowing (MY_FLOAT rate) |
| Decrease breath pressure with given rate of decrease. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This 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:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Chorus.h>
+
+
Inheritance diagram for Chorus:: +

Public Methods | |
| + | Chorus (MY_FLOAT baseDelay) |
| Class constructor, taking the longest desired delay length. | |
| + | ~Chorus () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setModDepth (MY_FLOAT depth) |
| Set modulation depth. | |
| +void | setModFrequency (MY_FLOAT frequency) |
| Set modulation frequency. | |
| +void | setEffectMix (MY_FLOAT mix) |
| Set the mixture of input and processed levels in the output (0.0 = input only, 1.0 = processed only). | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| +MY_FLOAT | lastOutLeft () const |
| Return the last left output value. | |
| +MY_FLOAT | lastOutRight () const |
| Return the last right output value. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Compute one output sample. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Take vectorSize inputs, compute the same number of outputs and return them in vector. | |
+This class implements a chorus effect. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Clarinet.h>
+
+
Inheritance diagram for Clarinet:: +

Public Methods | |
| + | Clarinet (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Clarinet () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | startBlowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath pressure to instrument with given amplitude and rate of increase. | |
| +void | stopBlowing (MY_FLOAT rate) |
| Decrease breath pressure with given rate of decrease. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+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:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [protected, virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [protected, virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Delay.h>
+
+
Inheritance diagram for Delay:: +

Public Methods | |
| + | Delay () |
| Default constructor creates a delay-line with maximum length of 4095 samples and zero delay. | |
| + | Delay (long theDelay, long maxDelay) |
| Overloaded constructor which specifies the current and maximum delay-line lengths. | |
| +virtual | ~Delay () |
| Class destructor. | |
| +void | clear () |
| Clears the internal state of the delay line. | |
| void | setDelay (long theDelay) |
| Set the delay-line length. More... | |
| +long | getDelay (void) const |
| Return the current delay-line length. | |
| +MY_FLOAT | energy (void) const |
| Calculate and return the signal energy in the delay-line. | |
| MY_FLOAT | contentsAt (long tapDelay) const |
| Return the value at tapDelay samples from the delay-line input. More... | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +virtual MY_FLOAT | tick (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. | |
+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. +
+
+
+
|
+
| + + | +
+
+ +Set the delay-line length. + +The valid range for theDelay is from 0 to the maximum delay-line length. |
+
+
+
|
+
| + + | +
+
+ +Return the value at tapDelay samples from the delay-line input. + +The valid range for tapDelay is 1 to the delay-line length. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [protected, virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [protected, virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <DelayA.h>
+
+
Inheritance diagram for DelayA:: +

Public Methods | |
| + | DelayA () |
| Default constructor creates a delay-line with maximum length of 4095 samples and zero delay. | |
| + | DelayA (MY_FLOAT theDelay, long maxDelay) |
| Overloaded constructor which specifies the current and maximum delay-line lengths. | |
| + | ~DelayA () |
| Class destructor. | |
| +void | clear () |
| Clears the internal state of the delay line. | |
| void | setDelay (MY_FLOAT theDelay) |
| Set the delay-line length. More... | |
| +MY_FLOAT | getDelay (void) |
| Return the current delay-line length. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the delay-line and return one output. | |
+This Delay subclass implements a fractional- length digital delay-line using a first-order allpass filter. 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 frequency 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. +
+
+
+
|
+
| + + | +
+
+ +Set the delay-line length. + +The valid range for theDelay is from 0.5 to the maximum delay-line length. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [protected, virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [protected, virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <DelayL.h>
+
+
Inheritance diagram for DelayL:: +

Public Methods | |
| + | DelayL () |
| Default constructor creates a delay-line with maximum length of 4095 samples and zero delay. | |
| + | DelayL (MY_FLOAT theDelay, long maxDelay) |
| Overloaded constructor which specifies the current and maximum delay-line lengths. | |
| + | ~DelayL () |
| Class destructor. | |
| void | setDelay (MY_FLOAT theDelay) |
| Set the delay-line length. More... | |
| +MY_FLOAT | getDelay (void) const |
| Return the current delay-line length. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the delay-line and return one output. | |
+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 varying degrees depending on the fractional delay setting. The use of higher order Lagrange interpolators can typically improve (minimize) this attenuation characteristic. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +Set the delay-line length. + +The valid range for theDelay is from 0 to the maximum delay-line length. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Drummer.h>
+
+
Inheritance diagram for Drummer:: +

Public Methods | |
| + | Drummer () |
| Class constructor. | |
| + | ~Drummer () |
| Class destructor. | |
| void | noteOn (MY_FLOAT instrument, MY_FLOAT amplitude) |
| Start a note with the given drum type and amplitude. More... | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements a drum sampling synthesizer using WvIn 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 maximum polyphony (maximum number of simultaneous voices) via a define in the Drummer.h. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +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 Instrmnt. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Echo.h>
+
+
Inheritance diagram for Echo:: +

Public Methods | |
| + | Echo (MY_FLOAT longestDelay) |
| Class constructor, taking the longest desired delay length. | |
| + | ~Echo () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setDelay (MY_FLOAT delay) |
| Set the delay line length in samples. | |
| +void | setEffectMix (MY_FLOAT mix) |
| Set the mixture of input and processed levels in the output (0.0 = input only, 1.0 = processed only). | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Compute one output sample. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This class implements a echo effect. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [static] [virtual] [virtual] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Envelope.h>
+
+
Inheritance diagram for Envelope:: +

Public Methods | |
| + | Envelope (void) |
| Default constructor. | |
| +virtual | ~Envelope (void) |
| Class destructor. | |
| +virtual void | keyOn (void) |
| Set target = 1. | |
| +virtual void | keyOff (void) |
| Set target = 0. | |
| +void | setRate (MY_FLOAT aRate) |
| Set the rate. | |
| +void | setTime (MY_FLOAT aTime) |
| Set the rate based on a time duration. | |
| +virtual void | setTarget (MY_FLOAT aTarget) |
| Set the target value. | |
| +virtual void | setValue (MY_FLOAT aValue) |
| Set current and target values to aValue. | |
| +virtual int | getState (void) const |
| Return the current envelope state (0 = at target, 1 otherwise). | |
| +virtual MY_FLOAT | tick (void) |
| Return one envelope output value. | |
| +virtual MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Return vectorSize envelope outputs in vector. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [pure virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [pure virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <FM.h>
+
+
Inheritance diagram for FM:: +

Public Methods | |
| + | FM (int operators=4) |
| Class constructor, taking the number of wave/envelope operators to control. | |
| +virtual | ~FM () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all wave and envelope states. | |
| +void | loadWaves (const char **filenames) |
| Load the rawwave filenames in waves. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setRatio (int waveIndex, MY_FLOAT ratio) |
| Set the frequency ratio for the specified wave. | |
| +void | setGain (int waveIndex, MY_FLOAT gain) |
| Set the gain for the specified wave. | |
| +void | setModulationSpeed (MY_FLOAT mSpeed) |
| Set the modulation speed in Hz. | |
| +void | setModulationDepth (MY_FLOAT mDepth) |
| Set the modulation depth. | |
| +void | setControl1 (MY_FLOAT cVal) |
| Set the value of control1. | |
| +void | setControl2 (MY_FLOAT cVal) |
| Set the value of control1. | |
| +void | keyOn () |
| Start envelopes toward "on" targets. | |
| +void | keyOff () |
| Start envelopes toward "off" targets. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual MY_FLOAT | tick ()=0 |
| Pure virtual function ... must be defined in subclasses. | |
| +virtual void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class controls an arbitrary number of waves and envelopes, determined via a constructor argument. +
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <FMVoices.h>
+
+
Inheritance diagram for FMVoices:: +

Public Methods | |
| + | FMVoices () |
| Class constructor. | |
| + | ~FMVoices () |
| Class destructor. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| 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). | |
+This class implements 3 carriers and a common modulator, also referred to as algorithm 6 of the TX81Z. +
+
Algorithm 6 is : + /->1 -\ + 4-|-->2 - +-> Out + \->3 -/
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Filter.h>
+
+
Inheritance diagram for Filter:: +

Public Methods | |
| + | Filter (void) |
| Default constructor creates a zero-order pass-through "filter". | |
| Filter (int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients) | |
| Overloaded constructor which takes filter coefficients. More... | |
| +virtual | ~Filter (void) |
| Class destructor. | |
| +void | clear (void) |
| Clears all internal states of the filter. | |
| void | setCoefficients (int nb, MY_FLOAT *bCoefficients, int na, MY_FLOAT *aCoefficients) |
| Set filter coefficients. More... | |
| void | setNumerator (int nb, MY_FLOAT *bCoefficients) |
| Set numerator coefficients. More... | |
| void | setDenominator (int na, MY_FLOAT *aCoefficients) |
| Set denominator coefficients. More... | |
| virtual void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +virtual MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +virtual MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +virtual MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +virtual MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This class implements a generic structure which can be used to create a wide range of filters. 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]*x[n] + ... + b[nb]*x[n-nb] - a[1]*y[n-1] - ... - a[na]*y[n-na] +
+If a[0] is not equal to 1, the filter coeffcients are normalized by a[0]. +
+The gain parameter is applied at the filter input and does not affect the coefficient 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Set 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. If a[0] is not equal to 1, the filter coeffcients are normalized by a[0]. |
+
+
+
|
+
| + + | +
+
+ +Set numerator coefficients. + +An StkError can be thrown if nb is less than one. Any previously set denominator coefficients are left unaffected. Note that the default constructor sets the single denominator coefficient a[0] to 1.0. |
+
+
+
|
+
| + + | +
+
+ +Set denominator coefficients. + +An StkError can be thrown if na is less than one or if the a[0] 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. |
+
+
+
|
+
| + + | +
+
+ +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 BiQuad, OnePole, OneZero, PoleZero, TwoPole, and TwoZero. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Flute.h>
+
+
Inheritance diagram for Flute:: +

Public Methods | |
| + | Flute (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Flute () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (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 | startBlowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath velocity to instrument with given amplitude and rate of increase. | |
| +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 | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+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 patents held by Stanford University, Yamaha, and others. +
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. ++
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <FormSwep.h>
+
+
Inheritance diagram for FormSwep:: +

Public Methods | |
| + | FormSwep () |
| Default constructor creates a second-order pass-through filter. | |
| + | ~FormSwep () |
| Class destructor. | |
| void | setResonance (MY_FLOAT aFrequency, MY_FLOAT aRadius) |
| Sets the filter coefficients for a resonance at frequency (in Hz). More... | |
| +void | setStates (MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain=1.0) |
| Set both the current and target resonance parameters. | |
| +void | setTargets (MY_FLOAT aFrequency, MY_FLOAT aRadius, MY_FLOAT aGain=1.0) |
| Set target resonance parameters. | |
| void | setSweepRate (MY_FLOAT aRate) |
| Set the sweep rate (between 0.0 - 1.0). More... | |
| void | setSweepTime (MY_FLOAT aTime) |
| Set the sweep rate in terms of a time value in seconds. More... | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This public BiQuad filter subclass implements a formant (resonance) which can be "swept" over time from one frequency setting to another. It provides methods for controlling the sweep rate and target frequency. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Set the sweep rate in terms of a time value in seconds. + +This method adjusts the sweep rate based on a given time for the formant parameters to reach their target values. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <HevyMetl.h>
+
+
Inheritance diagram for HevyMetl:: +

Public Methods | |
| + | HevyMetl () |
| Class constructor. | |
| + | ~HevyMetl () |
| Class destructor. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements 3 cascade operators with feedback modulation, also referred to as algorithm 3 of the TX81Z. +
+
Algorithm 3 is : 4--\ + 3-->2-- + -->1-->Out
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [pure virtual] [pure virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [pure virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Instrmnt.h>
+
+
Inheritance diagram for Instrmnt:: +

Public Methods | |
| + | Instrmnt () |
| Default constructor. | |
| +virtual | ~Instrmnt () |
| Class destructor. | |
| +virtual void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude)=0 |
| Start a note with the given frequency and amplitude. | |
| +virtual void | noteOff (MY_FLOAT amplitude)=0 |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| +virtual MY_FLOAT | tick ()=0 |
| Compute one output sample. | |
| +virtual MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Computer vectorSize outputs and return them in vector. | |
| +virtual void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class provides a common interface for all STK instruments. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <JCRev.h>
+
+
Inheritance diagram for JCRev:: +

Public Methods | |
| +void | clear () |
| Reset and clear all internal state. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Compute one output sample. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <JetTabl.h>
+
+
Inheritance diagram for JetTabl:: +

Public Methods | |
| + | JetTabl () |
| Default constructor. | |
| + | ~JetTabl () |
| Class destructor. | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Return the function value for input. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Take vectorSize inputs and return the corresponding function values in vector. | |
+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 information. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Mandolin.h>
+
+
Inheritance diagram for Mandolin:: +

Public Methods | |
| + | Mandolin (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| +virtual | ~Mandolin () |
| Class destructor. | |
| +void | pluck (MY_FLOAT amplitude) |
| Pluck the strings with the given amplitude (0.0 - 1.0) using the current frequency. | |
| +void | pluck (MY_FLOAT amplitude, MY_FLOAT position) |
| Pluck the strings with the given amplitude (0.0 - 1.0) and position (0.0 - 1.0). | |
| +virtual void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude (0.0 - 1.0). | |
| +void | setBodySize (MY_FLOAT size) |
| Set the body size (a value of 1.0 produces the "default" size). | |
| +virtual MY_FLOAT | tick () |
| 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). | |
+This class inherits from PluckTwo 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 Numbers:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Mesh2D.h>
+
+
Inheritance diagram for Mesh2D:: +

Public Methods | |
| + | Mesh2D (short nX, short nY) |
| Class constructor, taking the x and y dimensions in samples. | |
| + | ~Mesh2D () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setNX (short lenX) |
| Set the x dimension size in samples. | |
| +void | setNY (short lenY) |
| Set the y dimension size in samples. | |
| +void | setInputPosition (MY_FLOAT xFactor, MY_FLOAT yFactor) |
| Set the x, y input position on a 0.0 - 1.0 scale. | |
| +void | setDecay (MY_FLOAT decayFactor) |
| Set the loss filters gains (0.0 - 1.0). | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Impulse the mesh with the given amplitude (frequency ignored). | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay) ... currently ignored. | |
| +MY_FLOAT | energy () |
| Calculate and return the signal energy stored in the mesh. | |
| +MY_FLOAT | tick () |
| Compute one output sample, without adding energy to the mesh. | |
| +MY_FLOAT | tick (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). | |
+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:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Messager.h>
+
+
Inheritance diagram for Messager:: +

Public Methods | |
| Messager (int inputMask=0) | |
| Constructor performs initialization based on an input mask. More... | |
| + | ~Messager () |
| Class destructor. | |
| long | nextMessage (void) |
| Check for a new input message and return the message type. More... | |
| +void | setRtDelta (long nSamples) |
| Set the delta time (in samples) returned between valid realtime messages. This setting has no affect for scorefile messages. | |
| +long | getDelta (void) const |
| Return the current message "delta time" in samples. | |
| +long | getType () const |
| Return the current message type. | |
| +MY_FLOAT | getByteTwo () const |
| Return the byte two value for the current message. | |
| +MY_FLOAT | getByteThree () const |
| Return the byte three value for the current message. | |
| +long | getChannel () const |
| Return the channel number for the current message. | |
+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 nextMessage(), 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 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. +
+
+
+
|
+
| + + | +
+
+ +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 combination for multiple "realtime" input source parsing. For realtime input types, an StkError can be thrown during instantiation. |
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[pure virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [virtual] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Modal.h>
+
+
Inheritance diagram for Modal:: +

Public Methods | |
| + | Modal (int modes=4) |
| Class constructor, taking the desired number of modes to create. | |
| +virtual | ~Modal () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setRatioAndRadius (int modeIndex, MY_FLOAT ratio, MY_FLOAT radius) |
| Set the ratio and radius for a specified mode filter. | |
| +void | setMasterGain (MY_FLOAT aGain) |
| Set the master gain. | |
| +void | setDirectGain (MY_FLOAT aGain) |
| Set the direct gain. | |
| +void | setModeGain (int modeIndex, MY_FLOAT gain) |
| Set the gain for a specified mode filter. | |
| +virtual void | strike (MY_FLOAT amplitude) |
| Initiate a strike with the given amplitude (0.0 - 1.0). | |
| +void | damp (MY_FLOAT amplitude) |
| Damp modes with a given decay factor (0.0 - 1.0). | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual MY_FLOAT | tick () |
| Compute one output sample. | |
| +virtual void | controlChange (int number, MY_FLOAT value)=0 |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class contains an excitation wavetable, an envelope, an oscillator, and N resonances (non-sweeping BiQuad filters), where N is set during instantiation. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [virtual] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <ModalBar.h>
+
+
Inheritance diagram for ModalBar:: +

Public Methods | |
| + | ModalBar () |
| Class constructor. | |
| + | ~ModalBar () |
| Class destructor. | |
| +void | setStickHardness (MY_FLOAT hardness) |
| Set stick hardness (0.0 - 1.0). | |
| +void | setStrikePosition (MY_FLOAT position) |
| Set stick position (0.0 - 1.0). | |
| +void | setPreset (int preset) |
| Select a bar preset (currently modulo 9). | |
| +void | setModulationDepth (MY_FLOAT mDepth) |
| Set the modulation (vibrato) depth. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class implements a number of different struck bar instruments. It inherits from the Modal class. +
+Control Change Numbers:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Modulate.h>
+
+
Inheritance diagram for Modulate:: +

Public Methods | |
| + | Modulate () |
| Class constructor. | |
| + | ~Modulate () |
| Class destructor. | |
| +void | reset () |
| Reset internal state. | |
| +void | setVibratoRate (MY_FLOAT aRate) |
| Set the periodic (vibrato) rate or frequency in Hz. | |
| +void | setVibratoGain (MY_FLOAT aGain) |
| Set the periodic (vibrato) gain. | |
| +void | setRandomGain (MY_FLOAT aGain) |
| Set the random modulation gain. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +virtual MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Return vectorSize outputs in vector. | |
| +MY_FLOAT | lastOut () const |
| Return the last computed output value. | |
+This class combines random and periodic modulations to give a nice, natural human modulation function. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Moog.h>
+
+
Inheritance diagram for Moog:: +

Public Methods | |
| + | Moog () |
| Class constructor. | |
| + | ~Moog () |
| Class destructor. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +virtual void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | setModulationSpeed (MY_FLOAT mSpeed) |
| Set the modulation (vibrato) speed in Hz. | |
| +void | setModulationDepth (MY_FLOAT mDepth) |
| Set the modulation (vibrato) depth. | |
| +virtual MY_FLOAT | tick () |
| 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). | |
+This instrument uses one attack wave, one looped wave, and an ADSR envelope (inherited from the Sampler class) and adds two sweepable formant (FormSwep) filters. +
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. ++
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <NRev.h>
+
+
Inheritance diagram for NRev:: +

Public Methods | |
| +void | clear () |
| Reset and clear all internal state. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Compute one output sample. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Noise.h>
+
+
Inheritance diagram for Noise:: +

Public Methods | |
| + | Noise () |
| Default constructor. | |
| +virtual | ~Noise () |
| Class destructor. | |
| +virtual MY_FLOAT | tick () |
| 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 | lastOut () const |
| Return the last computed value. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <OnePole.h>
+
+
Inheritance diagram for OnePole:: +

Public Methods | |
| + | OnePole () |
| Default constructor creates a first-order low-pass filter. | |
| + | OnePole (MY_FLOAT thePole) |
| Overloaded constructor which sets the pole position during instantiation. | |
| + | ~OnePole () |
| Class destructor. | |
| +void | clear (void) |
| Clears the internal state of the filter. | |
| +void | setB0 (MY_FLOAT b0) |
| Set the b[0] coefficient value. | |
| +void | setA1 (MY_FLOAT a1) |
| Set the a[1] coefficient value. | |
| void | setPole (MY_FLOAT thePole) |
| Set the pole position in the z-plane. More... | |
| void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This protected Filter 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. +
+
+
+
|
+
| + + | +
+
+ +Set the pole position in the z-plane. + +This method sets the pole position along the real-axis of the z-plane and normalizes 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. |
+
+
+
|
+
| + + | +
+
+ +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 Filter. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <OneZero.h>
+
+
Inheritance diagram for OneZero:: +

Public Methods | |
| + | OneZero () |
| Default constructor creates a first-order low-pass filter. | |
| + | OneZero (MY_FLOAT theZero) |
| Overloaded constructor which sets the zero position during instantiation. | |
| + | ~OneZero () |
| Class destructor. | |
| +void | clear (void) |
| Clears the internal state of the filter. | |
| +void | setB0 (MY_FLOAT b0) |
| Set the b[0] coefficient value. | |
| +void | setB1 (MY_FLOAT b1) |
| Set the b[1] coefficient value. | |
| void | setZero (MY_FLOAT theZero) |
| Set the zero position in the z-plane. More... | |
| void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This protected Filter 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. +
+
+
+
|
+
| + + | +
+
+ +Set the zero position in the z-plane. + +This method sets the zero position along the real-axis of the z-plane and normalizes 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. |
+
+
+
|
+
| + + | +
+
+ +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 Filter. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <PRCRev.h>
+
+
Inheritance diagram for PRCRev:: +

Public Methods | |
| +void | clear () |
| Reset and clear all internal state. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Compute one output sample. | |
+This class is based on some of the famous Stanford/CCRMA reverbs (NRev, 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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <PercFlut.h>
+
+
Inheritance diagram for PercFlut:: +

Public Methods | |
| + | PercFlut () |
| Class constructor. | |
| + | ~PercFlut () |
| Class destructor. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements algorithm 4 of the TX81Z. +
+
Algorithm 4 is : 4->3--\ + 2-- + -->1-->Out
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <PitShift.h>
+
+
Inheritance diagram for PitShift:: +

Public Methods | |
| + | PitShift () |
| Class constructor. | |
| + | ~PitShift () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setShift (MY_FLOAT shift) |
| Set the pitch shift factor (1.0 produces no shift). | |
| +void | setEffectMix (MY_FLOAT mix) |
| Set the mixture of input and processed levels in the output (0.0 = input only, 1.0 = processed only). | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| +MY_FLOAT | tick (MY_FLOAT input) |
| Compute one output sample. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This class implements a simple pitch shifter using delay lines. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [pure virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [pure virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <PluckTwo.h>
+
+
Inheritance diagram for PluckTwo:: +

Public Methods | |
| + | PluckTwo (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| +virtual | ~PluckTwo () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setDetune (MY_FLOAT detune) |
| Detune the two strings by the given factor. A value of 1.0 produces unison strings. | |
| +void | setFreqAndDetune (MY_FLOAT frequency, MY_FLOAT detune) |
| Efficient combined setting of frequency and detuning. | |
| +void | setPluckPosition (MY_FLOAT position) |
| Set the pluck or "excitation" position along the string (0.0 - 1.0). | |
| void | setBaseLoopGain (MY_FLOAT aGain) |
| Set the base loop gain. More... | |
| +virtual void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual MY_FLOAT | tick ()=0 |
| Virtual (abstract) tick function is implemented by subclasses. | |
+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. +
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Plucked.h>
+
+
Inheritance diagram for Plucked:: +

Public Methods | |
| + | Plucked (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Plucked () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | pluck (MY_FLOAT amplitude) |
| Pluck the string with the given amplitude using the current frequency. | |
| +virtual void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +virtual void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual MY_FLOAT | tick () |
| Compute one output sample. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <PoleZero.h>
+
+
Inheritance diagram for PoleZero:: +

Public Methods | |
| + | PoleZero () |
| Default constructor creates a first-order pass-through filter. | |
| + | ~PoleZero () |
| Class destructor. | |
| +void | clear (void) |
| Clears the internal states of the filter. | |
| +void | setB0 (MY_FLOAT b0) |
| Set the b[0] coefficient value. | |
| +void | setB1 (MY_FLOAT b1) |
| Set the b[1] coefficient value. | |
| +void | setA1 (MY_FLOAT a1) |
| Set the a[1] coefficient value. | |
| void | setAllpass (MY_FLOAT coefficient) |
| Set the filter for allpass behavior using coefficient. More... | |
| void | setBlockZero (MY_FLOAT thePole=0.99) |
| Create a DC blocking filter with the given pole position in the z-plane. More... | |
| void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This protected Filter 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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 Filter. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <ReedTabl.h>
+
+
Inheritance diagram for ReedTabl:: +

Public Methods | |
| + | ReedTabl () |
| Default constructor. | |
| + | ~ReedTabl () |
| Class destructor. | |
| void | setOffset (MY_FLOAT aValue) |
| Set the table offset value. More... | |
| void | setSlope (MY_FLOAT aValue) |
| Set the table slope value. More... | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| MY_FLOAT | tick (MY_FLOAT input) |
| Return the function value for input. More... | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Take vectorSize inputs and return the corresponding function values in vector. | |
+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, & Woodhouse (1983), Smith (1986), Hirschman, Cook, Scavone, and others for more information. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +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). |
+
+
+
|
+
| + + | +
+
+ +Set the table slope value. + +The table slope roughly corresponds to the reed stiffness (a greater slope represents a harder reed). |
+
+
+
|
+
| + + | +
+
+ +Return the function value for input. + +The function input represents the differential pressure across the reeds. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Resonate.h>
+
+
Inheritance diagram for Resonate:: +

Public Methods | |
| + | Resonate () |
| Class constructor. | |
| + | ~Resonate () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setResonance (MY_FLOAT frequency, MY_FLOAT radius) |
| Set the filter for a resonance at the given frequency (Hz) and radius. | |
| +void | setNotch (MY_FLOAT frequency, MY_FLOAT radius) |
| Set the filter for a notch at the given frequency (Hz) and radius. | |
| +void | setEqualGainZeroes () |
| Set the filter zero coefficients for contant resonance gain. | |
| +void | keyOn () |
| Initiate the envelope with a key-on event. | |
| +void | keyOff () |
| Signal a key-off event to the envelope. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| 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). | |
+This instrument contains a noise source, which excites a biquad resonance filter, with volume controlled by an ADSR. +
+Control Change Numbers:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[pure virtual] [protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [pure virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Reverb.h>
+
+
Inheritance diagram for Reverb:: +

Public Methods | |
| + | Reverb () |
| Class constructor. | |
| +virtual | ~Reverb () |
| Class destructor. | |
| +virtual void | clear ()=0 |
| Reset and clear all internal state. | |
| +void | setEffectMix (MY_FLOAT mix) |
| Set the mixture of input and "reverberated" levels in the output (0.0 = input only, 1.0 = reverb only). | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| +MY_FLOAT | lastOutLeft () const |
| Return the last left output value. | |
| +MY_FLOAT | lastOutRight () const |
| Return the last right output value. | |
| +virtual MY_FLOAT | tick (MY_FLOAT input)=0 |
| Abstract tick function ... must be implemented in subclasses. | |
| +virtual MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Take vectorSize inputs, compute the same number of outputs and return them in vector. | |
+This class provides common functionality for STK reverberator subclasses. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Rhodey.h>
+
+
Inheritance diagram for Rhodey:: +

Public Methods | |
| + | Rhodey () |
| Class constructor. | |
| + | ~Rhodey () |
| Class destructor. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements two simple FM Pairs summed together, also referred to as algorithm 5 of the TX81Z. +
+
Algorithm 5 is : 4->3--\ + + --> Out + 2->1--/
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <RtDuplex.h>
+
+
Inheritance diagram for RtDuplex:: +

Public Methods | |
| RtDuplex (int nChannels=1, MY_FLOAT sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=2) | |
| Default constructor. More... | |
| + | ~RtDuplex () |
| Class destructor. | |
| void | start (void) |
| Start the audio input/output stream. More... | |
| void | stop (void) |
| Stop the audio input/output stream. More... | |
| +MY_FLOAT | lastOut (void) const |
| Return the average across the last output sample frame. | |
| MY_FLOAT | 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. More... | |
| MY_FLOAT* | tick (MY_FLOAT *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. More... | |
| +const MY_FLOAT* | lastFrame (void) const |
| Return a pointer to the last output sample frame. | |
| MY_FLOAT* | tickFrame (MY_FLOAT *frameVector, unsigned int frames=1) |
| Output sample frames from frameVector and return new input frames in frameVector. More... | |
+This class provides a simplified interface to RtAudio for realtime audio input/output. It is also possible to achieve duplex operation using separate RtWvIn and RtWvOut classes, but this class ensures better input/output syncronization. +
+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. +
+
+
+
|
+
| + + | +
+
+ +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 soundcards/devices, values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API. The default buffer size of RT_BUFFER_SIZE is defined in Stk.h. An StkError will be thrown if an error occurs duing instantiation. |
+
+
+
|
+
| + + | +
+
+ +Start the audio input/output stream. + +The stream is started automatically, if necessary, when a tick() or tickFrame method is called. |
+
+
+
|
+
| + + | +
+
+ +Stop the audio input/output stream. + +It may be necessary to use this method to avoid audio overflow/underflow problems if you wish to temporarily stop the audio stream. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Output sample frames from frameVector and return new input frames in frameVector. + +An StkError will be thrown if an error occurs during input/output. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <RtMidi.h>
+
+
Inheritance diagram for RtMidi:: +

Public Methods | |
| + | RtMidi (int device=0) |
| Default constructor with optional device argument. | |
| + | ~RtMidi () |
| Class destructor. | |
| +void | printMessage (void) const |
| Print out the current message values. | |
| int | nextMessage (void) |
| Check for and parse a new MIDI message in the queue, returning its type. More... | |
| +int | getType () const |
| Return the current message type. | |
| +int | getChannel () const |
| Return the current message channel value. | |
| +MY_FLOAT | getByteTwo () 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. | |
+At the moment, this object only handles MIDI input, though MIDI output code can go here when someone 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. +
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, virtual] [protected] [protected] [protected] [protected] [protected, static] [protected] [virtual] [virtual] [protected] [protected] [protected] [protected] [protected, static] [protected] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [virtual] [protected] [protected] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <RtWvIn.h>
+
+
Inheritance diagram for RtWvIn:: +

Public Methods | |
| RtWvIn (int nChannels=1, MY_FLOAT sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=2) | |
| Default constructor. More... | |
| + | ~RtWvIn () |
| Class destructor. | |
| void | start (void) |
| Start the audio input stream. More... | |
| void | stop (void) |
| Stop the audio input stream. More... | |
| +MY_FLOAT | lastOut (void) const |
| Return the average across the last output sample frame. | |
| MY_FLOAT | tick (void) |
| Read out the average across one sample frame of data. More... | |
| MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Read out vectorSize averaged sample frames of data in vector. More... | |
| +const MY_FLOAT* | lastFrame (void) const |
| Return a pointer to the last output sample frame. | |
| const MY_FLOAT* | tickFrame (void) |
| Return a pointer to the next sample frame of data. More... | |
| MY_FLOAT* | tickFrame (MY_FLOAT *frameVector, unsigned int frames) |
| Read out sample frames of data to frameVector. More... | |
+This class provides a simplified interface to RtAudio for realtime audio input. It is a protected subclass of WvIn. +
+RtWvIn 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 tickFrame() 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. +
+
+
+
|
+
| + + | +
+
+ +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 soundcards/devices, values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API. The default buffer size of RT_BUFFER_SIZE is defined in Stk.h. An StkError will be thrown if an error occurs duing instantiation. |
+
+
+
|
+
| + + | +
+
+ +Start the audio input stream. + +The stream is started automatically, if necessary, when a tick() or tickFrame method is called. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Read out the average across one sample frame of data. + +An StkError will be thrown if an error occurs during input. + +Reimplemented from WvIn. |
+
+
+
|
+
| + + | +
+
+ +Read out vectorSize averaged sample frames of data in vector. + +An StkError will be thrown if an error occurs during input. + +Reimplemented from WvIn. |
+
+
+
|
+
| + + | +
+
+ +Return a pointer to the next sample frame of data. + +An StkError will be thrown if an error occurs during input. + +Reimplemented from WvIn. |
+
+
+
|
+
| + + | +
+
+ +Read out sample frames of data to frameVector. + +An StkError will be thrown if an error occurs during input. + +Reimplemented from WvIn. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <RtWvOut.h>
+
+
Inheritance diagram for RtWvOut:: +

Public Methods | |
| RtWvOut (unsigned int nChannels=1, MY_FLOAT sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=4) | |
| Default constructor. More... | |
| + | ~RtWvOut () |
| Class destructor. | |
| void | start (void) |
| Start the audio output stream. More... | |
| void | stop (void) |
| Stop the audio output stream. More... | |
| +unsigned long | getFrames (void) const |
| Return the number of sample frames output. | |
| +MY_FLOAT | getTime (void) const |
| Return the number of seconds of data output. | |
| void | tick (const MY_FLOAT sample) |
| Output a single sample to all channels in a sample frame. More... | |
| void | tick (const MY_FLOAT *vector, unsigned int vectorSize) |
| Output each sample in vector to all channels in vectorSize sample frames. More... | |
| void | tickFrame (const MY_FLOAT *frameVector, unsigned int frames=1) |
| Output the frameVector of sample frames of the given length. More... | |
+This class provides a simplified interface to RtAudio for realtime audio output. It is a protected subclass of WvOut. +
+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 tickFrame() method, which takes a pointer to multi-channel sample frame data. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +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 soundcards/devices, values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API. The default buffer size of RT_BUFFER_SIZE is defined in Stk.h. An StkError will be thrown if an error occurs duing instantiation. |
+
+
+
|
+
| + + | +
+
+ +Start the audio output stream. + +The stream is started automatically, if necessary, when a tick() or tickFrame method is called. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Output a single sample to all channels in a sample frame. + +An StkError will be thrown if an error occurs during output. + +Reimplemented from WvOut. |
+
+
+
|
+
| + + | +
+
+ +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 WvOut. |
+
+
+
|
+
| + + | +
+
+ +Output the frameVector of sample frames of the given length. + +An StkError will be thrown if an error occurs during output. + +Reimplemented from WvOut. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <SKINI.h>
+
+
Inheritance diagram for SKINI:: +

Public Methods | |
| + | SKINI () |
| Default constructor used for parsing messages received externally. | |
| + | SKINI (char *fileName) |
| Overloaded constructor taking a SKINI formatted scorefile. | |
| + | ~SKINI () |
| Class destructor. | |
| long | parseThis (char *aString) |
| Attempt to parse the given string, returning the message type. More... | |
| long | nextMessage () |
| Parse the next message (if a file is loaded) and return the message type. More... | |
| +long | getType () const |
| Return the current message type. | |
| +long | getChannel () const |
| Return the current message channel value. | |
| +MY_FLOAT | getDelta () const |
| Return the current message delta time value (in seconds). | |
| +MY_FLOAT | getByteTwo () const |
| Return the current message byte two value. | |
| +MY_FLOAT | getByteThree () const |
| Return the current message byte three value. | |
| +long | getByteTwoInt () const |
| Return the current message byte two value (integer). | |
| +long | getByteThreeInt () const |
| Return the current message byte three value (integer). | |
| +const char* | getRemainderString () |
| Return remainder string after parsing. | |
| +const char* | getMessageTypeString () |
| Return the message type as a string. | |
| +const char* | whatsThisType (long type) |
| Return the SKINI type string for the given type value. | |
| +const char* | whatsThisController (long number) |
| Return the SKINI controller string for the given controller number. | |
+This class parses SKINI formatted text messages. It can be used to parse individual messages or it can be passed an entire file. 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
+
+
+
+
+
|
+
| + + | +
+
+ +Attempt to parse the given string, returning the message type. + +A type value equal to zero indicates an invalid message. |
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[pure virtual] [protected, static] [virtual] [pure virtual] [static] [pure virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Sampler.h>
+
+
Inheritance diagram for Sampler:: +

Public Methods | |
| + | Sampler () |
| Default constructor. | |
| +virtual | ~Sampler () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +virtual void | setFrequency (MY_FLOAT frequency)=0 |
| Set instrument parameters for a particular frequency. | |
| +void | keyOn () |
| Initiate the envelopes with a key-on event and reset the attack waves. | |
| +void | keyOff () |
| Signal a key-off event to the envelopes. | |
| +virtual void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual MY_FLOAT | tick () |
| Compute one output sample. | |
| +virtual void | controlChange (int number, MY_FLOAT value)=0 |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Saxofony.h>
+
+
Inheritance diagram for Saxofony:: +

Public Methods | |
| + | Saxofony (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Saxofony () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setBlowPosition (MY_FLOAT aPosition) |
| Set the "blowing" position between the air column terminations (0.0 - 1.0). | |
| +void | startBlowing (MY_FLOAT amplitude, MY_FLOAT rate) |
| Apply breath pressure to instrument with given amplitude and rate of increase. | |
| +void | stopBlowing (MY_FLOAT rate) |
| Decrease breath pressure with given rate of decrease. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class implements a "hybrid" digital 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:
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Shakers.h>
+
+
Inheritance diagram for Shakers:: +

Public Methods | |
| + | Shakers () |
| Class constructor. | |
| + | ~Shakers () |
| Class destructor. | |
| virtual void | noteOn (MY_FLOAT instrument, MY_FLOAT amplitude) |
| Start a note with the given instrument and amplitude. More... | |
| +virtual void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| 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). | |
+PhISEM (Physically Informed Stochastic Event Modeling) is an algorithmic approach for simulating collisions of multiple independent sound producing objects. 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 implements simulations of breaking sticks, crunchy snow (or not), a wrench, sandpaper, and more. +
+Control Change Numbers:
+
+
+
|
+
| + + | +
+
+ +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 Instrmnt. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Simple.h>
+
+
Inheritance diagram for Simple:: +

Public Methods | |
| + | Simple () |
| Class constructor. | |
| +virtual | ~Simple () |
| Class destructor. | |
| +void | clear () |
| Clear internal states. | |
| +virtual void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | keyOn () |
| Start envelope toward "on" target. | |
| +void | keyOff () |
| Start envelope toward "off" target. | |
| +virtual void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +virtual void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +virtual MY_FLOAT | tick () |
| 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). | |
+This class combines a looped wave, a noise source, a biquad resonance filter, a one-pole filter, and an ADSR envelope to create some interesting sounds. +
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. ++
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Sitar.h>
+
+
Inheritance diagram for Sitar:: +

Public Methods | |
| + | Sitar (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~Sitar () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | pluck (MY_FLOAT amplitude) |
| Pluck the string with the given amplitude using the current frequency. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[static] [protected, static] [static] [static] [static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Socket.h>
+
+
Inheritance diagram for Socket:: +

Public Methods | |
| Socket (int port=2006) | |
| Default constructor which creates a local socket server on port 2006 (or the specified port number). More... | |
| Socket (int port, const char *hostname) | |
| Class constructor which creates a socket client connection to the specified host and port. More... | |
| + | ~Socket () |
| The class destructor closes the socket instance, breaking any existing connections. | |
| int | connect (int port, const char *hostname="localhost") |
| Connect a socket client to the specified host and port and returns the resulting socket descriptor. More... | |
| +void | close (void) |
| Close this socket. | |
| +int | socket (void) const |
| Return the server/client socket descriptor. | |
| +int | port (void) const |
| Return the server/client port number. | |
| int | 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. More... | |
| +int | writeBuffer (const void *buffer, long bufferSize, int flags=0) |
| Write a buffer over the socket connection. Returns the number of bytes written or -1 if an error occurs. | |
| +int | readBuffer (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 | |
| +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 | close (int socket) |
| Close the socket with the given descriptor. | |
| +bool | isValid (int socket) |
| Returns TRUE is the socket descriptor is valid. | |
| +int | writeBuffer (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 | readBuffer (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. | |
+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 user is responsible for checking the values returned by the read/write methods. 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Class constructor which creates a socket client connection to the specified host and port. + +An StkError will be thrown if a socket error occurs during instantiation. |
+
+
+
|
+
| + + | +
+
+ +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 accept() method. An StkError will be thrown if a socket error occurs during instantiation.
|
+
+
+
|
+
| + + | +
+
+ +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. + +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <StifKarp.h>
+
+
Inheritance diagram for StifKarp:: +

Public Methods | |
| + | StifKarp (MY_FLOAT lowestFrequency) |
| Class constructor, taking the lowest desired playing frequency. | |
| + | ~StifKarp () |
| Class destructor. | |
| +void | clear () |
| Reset and clear all internal state. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | setStretch (MY_FLOAT stretch) |
| Set the stretch "factor" of the string (0.0 - 1.0). | |
| +void | setPickupPosition (MY_FLOAT position) |
| Set the pluck or "excitation" position along the string (0.0 - 1.0). | |
| void | setBaseLoopGain (MY_FLOAT aGain) |
| Set the base loop gain. More... | |
| +void | pluck (MY_FLOAT amplitude) |
| Pluck the string with the given amplitude using the current frequency. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +void | noteOff (MY_FLOAT amplitude) |
| Stop a note with the given amplitude (speed of decay). | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
| +void | controlChange (int number, MY_FLOAT value) |
| Perform the control change specified by number and value (0.0 - 128.0). | |
+This class implements a simple plucked string algorithm (Karplus 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:
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Stk.h>
+
+
Inheritance diagram for Stk:: +

Static Public Methods | |
| +MY_FLOAT | sampleRate (void) |
| Static method which returns the current STK sample rate. | |
| void | setSampleRate (MY_FLOAT newRate) |
| Static method which sets the STK sample rate. More... | |
| +void | swap16 (unsigned char *ptr) |
| Static method which byte-swaps a 16-bit data type. | |
| +void | swap32 (unsigned char *ptr) |
| Static method which byte-swaps a 32-bit data type. | |
| +void | swap64 (unsigned char *ptr) |
| Static method which byte-swaps a 64-bit data type. | |
| +void | sleep (unsigned long milliseconds) |
| Static cross-platform method to sleep for a number of milliseconds. | |
Static Public Attributes | |
| const STK_FORMAT | STK_SINT8 |
| const STK_FORMAT | STK_SINT16 |
| const STK_FORMAT | STK_SINT32 |
| const STK_FORMAT | STK_FLOAT32 |
| const STK_FORMAT | STK_FLOAT64 |
Protected Methods | |
| + | Stk (void) |
| Default constructor. | |
| +virtual | ~Stk (void) |
| Class destructor. | |
Static Protected Methods | |
| +void | handleError (const char *message, StkError::TYPE type) |
| Function for error reporting and handling. | |
+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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +-128 to +127 |
+
+
+
|
+
| + + | +
+
+ +-32768 to +32767 |
+
+
+
|
+
| + + | +
+
+ +-2147483648 to +2147483647. |
+
+
+
|
+
| + + | +
+
+ +Normalized between plus/minus 1.0. |
+
+
+
|
+
| + + | +
+
+ +Normalized between plus/minus 1.0. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[inline, virtual] [inline, virtual] [virtual] [virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Stk.h>
+
Public Methods | |
| + | StkError (const char *p, TYPE tipe=StkError::UNSPECIFIED) |
| The constructor. | |
| +virtual | ~StkError (void) |
| The destructor. | |
| +virtual void | printMessage (void) |
| Prints "thrown" error message to stdout. | |
| +virtual const TYPE& | getType (void) |
| Returns the "thrown" error message TYPE. | |
| +virtual const char* | getMessage (void) const |
| Returns the "thrown" error message string. | |
+This is a fairly abstract exception handling class. There could be sub-classes to take care of more specific error conditions ... or not. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <SubNoise.h>
+
+
Inheritance diagram for SubNoise:: +

Public Methods | |
| + | SubNoise (int subRate=16) |
| Default constructor sets sub-sample rate to 16. | |
| + | ~SubNoise () |
| Class destructor. | |
| +int | subRate (void) const |
| Return the current sub-sampling rate. | |
| +void | setRate (int subRate) |
| Set the sub-sampling rate. | |
| +MY_FLOAT | tick () |
| Return a sub-sampled random number between -1.0 and 1.0. | |
+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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Table.h>
+
+
Inheritance diagram for Table:: +

Public Methods | |
| + | Table (char *fileName) |
| Constructor loads the data from fileName. | |
| + | ~Table () |
| Class destructor. | |
| +long | getLength () const |
| Return the number of elements in the table. | |
| +MY_FLOAT | lastOut () const |
| Return the last output value. | |
| MY_FLOAT | tick (MY_FLOAT index) |
| Return the table value at position index. More... | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Take vectorSize index positions and return the corresponding table values in vector. | |
+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. +
+An StkError will be thrown if the table file is not found. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +Return the table value at position index. + +Linear interpolation is performed if index is fractional. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, virtual] [protected] [protected] [protected] [protected] [protected, static] [protected] [virtual] [virtual] [protected] [protected] [protected] [protected] [protected, static] [protected] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [virtual] [protected] [protected] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <TcpWvIn.h>
+
+
Inheritance diagram for TcpWvIn:: +

Public Methods | |
| TcpWvIn (int port=2006) | |
| Default constructor starts a socket server. If not specified, the server is associated with port 2006. More... | |
| + | ~TcpWvIn () |
| Class destructor. | |
| void | listen (unsigned int nChannels=1, Stk::STK_FORMAT format=STK_SINT16) |
| Listen for a (new) connection with specified data channels and format. More... | |
| bool | isConnected (void) |
| Returns TRUE is an input connection exists or input data remains in the queue. More... | |
| +MY_FLOAT | lastOut (void) const |
| Return the average across the last output sample frame. | |
| +MY_FLOAT | tick (void) |
| Read out the average across one sample frame of data. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Read out vectorSize averaged sample frames of data in vector. | |
| +const MY_FLOAT* | lastFrame (void) const |
| Return a pointer to the last output sample frame. | |
| +const MY_FLOAT* | tickFrame (void) |
| Return a pointer to the next sample frame of data. | |
| +MY_FLOAT* | tickFrame (MY_FLOAT *frameVector, unsigned int frames) |
| Read out sample frames of data to frameVector. | |
+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 tick() methods, which return samples produced by averaging across sample frames, from the tickFrame() 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_FORMATs are permissible. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +Default constructor starts a socket server. If not specified, the server is associated with port 2006. + +An StkError will be thrown if an error occurs while initializing the input thread or starting the socket server. |
+
+
+
|
+
| + + | +
+
+ +Listen for a (new) connection with specified data channels and format. + +An StkError will be thrown a socket error or an invalid function argument. |
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [virtual] [protected] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <TcpWvOut.h>
+
+
Inheritance diagram for TcpWvOut:: +

Public Methods | |
| + | TcpWvOut () |
| Default constructor ... the socket is not instantiated. | |
| TcpWvOut (int port, const char *hostname="localhost", unsigned int nChannels=1, Stk::STK_FORMAT format=STK_SINT16) | |
| Overloaded constructor which opens a network connection during instantiation. More... | |
| + | ~TcpWvOut () |
| Class destructor. | |
| void | 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. More... | |
| +void | disconnect (void) |
| If a connection is open, write out remaining samples in the queue and then disconnect. | |
| +unsigned long | getFrames (void) const |
| Return the number of sample frames output. | |
| +MY_FLOAT | getTime (void) const |
| Return the number of seconds of data output. | |
| void | tick (MY_FLOAT sample) |
| Output a single sample to all channels in a sample frame. More... | |
| void | tick (const MY_FLOAT *vector, unsigned int vectorSize) |
| Output each sample in vector to all channels in vectorSize sample frames. More... | |
| void | tickFrame (const MY_FLOAT *frameVector, unsigned int frames=1) |
| Output the frameVector of sample frames of the given length. More... | |
+This protected WvOut 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 tick() methods, which output single samples to all channels in a sample frame, from the tickFrame() 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_FORMATs are permissible. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +Overloaded constructor which opens a network connection during instantiation. + +An StkError is thrown if a socket error occurs or an invalid argument is specified. |
+
+
+
|
+
| + + | +
+
+ +Connect to the specified host and port and prepare to stream nChannels of data in the given data format. + +An StkError is thrown if a socket error occurs or an invalid argument is specified. |
+
+
+
|
+
| + + | +
+
+ +Output a single sample to all channels in a sample frame. + +An StkError is thrown if a socket write error occurs. + +Reimplemented from WvOut. |
+
+
+
|
+
| + + | +
+
+ +Output each sample in vector to all channels in vectorSize sample frames. + +An StkError is thrown if a socket write error occurs. + +Reimplemented from WvOut. |
+
+
+
|
+
| + + | +
+
+ +Output the frameVector of sample frames of the given length. + +An StkError is thrown if a socket write error occurs. + +Reimplemented from WvOut. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [static] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Thread.h>
+
+
Inheritance diagram for Thread:: +

Public Methods | |
| + | Thread () |
| Default constructor. | |
| + | ~Thread () |
| The class destructor waits indefinitely for the thread to end before returning. | |
| bool | start (THREAD_FUNCTION routine, void *ptr=NULL) |
| Begin execution of the thread routine. Upon success, TRUE is returned. More... | |
| bool | wait (long milliseconds=-1) |
| Wait the specified number of milliseconds for the thread to terminate. Return TRUE on success. More... | |
Static Public Methods | |
| +void | test (void) |
| Test for a thread cancellation request. | |
+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. +
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Wait the specified number of milliseconds for the thread to terminate. Return TRUE on success. + +If the specified time value is negative, the function will block indefinitely. Otherwise, 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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <TubeBell.h>
+
+
Inheritance diagram for TubeBell:: +

Public Methods | |
| + | TubeBell () |
| Class constructor. | |
| + | ~TubeBell () |
| Class destructor. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements two simple FM Pairs summed together, also referred to as algorithm 5 of the TX81Z. +
+
Algorithm 5 is : 4->3--\ + + --> Out + 2->1--/
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <TwoPole.h>
+
+
Inheritance diagram for TwoPole:: +

Public Methods | |
| + | TwoPole () |
| Default constructor creates a second-order pass-through filter. | |
| + | ~TwoPole () |
| Class destructor. | |
| +void | clear (void) |
| Clears the internal states of the filter. | |
| +void | setB0 (MY_FLOAT b0) |
| Set the b[0] coefficient value. | |
| +void | setA1 (MY_FLOAT a1) |
| Set the a[1] coefficient value. | |
| +void | setA2 (MY_FLOAT a2) |
| Set the a[2] coefficient value. | |
| void | setResonance (MY_FLOAT frequency, MY_FLOAT radius, bool normalize=FALSE) |
| Sets the filter coefficients for a resonance at frequency (in Hz). More... | |
| void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This protected Filter 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. +
+
+
+
|
+
| + + | +
+
+ +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 >= 1.0. For a better resonance filter, use a BiQuad filter.
|
+
+
+
|
+
| + + | +
+
+ +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 Filter. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected] [protected] [virtual] [protected, static] [virtual] [protected, static] [protected] [protected] [virtual] [protected] [protected, static] [protected, static] [protected] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [protected, static] [virtual] [virtual] [protected, virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <TwoZero.h>
+
+
Inheritance diagram for TwoZero:: +

Public Methods | |
| + | TwoZero () |
| Default constructor creates a second-order pass-through filter. | |
| + | ~TwoZero () |
| Class destructor. | |
| +void | clear (void) |
| Clears the internal states of the filter. | |
| +void | setB0 (MY_FLOAT b0) |
| Set the b[0] coefficient value. | |
| +void | setB1 (MY_FLOAT b1) |
| Set the b[1] coefficient value. | |
| +void | setB2 (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). More... | |
| void | setGain (MY_FLOAT theGain) |
| Set the filter gain. More... | |
| +MY_FLOAT | getGain (void) const |
| Return the current filter gain. | |
| +MY_FLOAT | lastOut (void) const |
| Return the last computed output value. | |
| +MY_FLOAT | tick (MY_FLOAT sample) |
| Input one sample to the filter and return one output. | |
| +MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Input vectorSize samples to the filter and return an equal number of outputs in vector. | |
+This protected Filter 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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 Filter. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual] [virtual] [virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <WaveLoop.h>
+
+
Inheritance diagram for WaveLoop:: +

Public Methods | |
| + | WaveLoop (const char *fileName, bool raw=FALSE) |
| Class constructor. | |
| +virtual | ~WaveLoop () |
| Class destructor. | |
| void | setFrequency (MY_FLOAT aFrequency) |
| Set the data interpolation rate based on a looping frequency. More... | |
| +void | addTime (MY_FLOAT aTime) |
| Increment the read pointer by aTime samples, modulo file size. | |
| void | addPhase (MY_FLOAT anAngle) |
| Increment current read pointer by anAngle, relative to a looping frequency. More... | |
| void | addPhaseOffset (MY_FLOAT anAngle) |
| Add a phase offset to the current read pointer. More... | |
| +const MY_FLOAT* | tickFrame (void) |
| Return a pointer to the next sample frame of data. | |
+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 tickFrame() 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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 Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [virtual] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <Wurley.h>
+
+
Inheritance diagram for Wurley:: +

Public Methods | |
| + | Wurley () |
| Class constructor. | |
| + | ~Wurley () |
| Class destructor. | |
| +void | setFrequency (MY_FLOAT frequency) |
| Set instrument parameters for a particular frequency. | |
| +void | noteOn (MY_FLOAT frequency, MY_FLOAT amplitude) |
| Start a note with the given frequency and amplitude. | |
| +MY_FLOAT | tick () |
| Compute one output sample. | |
+This class implements two simple FM Pairs summed together, also referred to as algorithm 5 of the TX81Z. +
+
Algorithm 5 is : 4->3--\ + + --> Out + 2->1--/
+Control Change Numbers:
+by Perry R. Cook and Gary P. Scavone, 1995 - 2002. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[virtual] [protected, static] [virtual] [virtual] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [virtual] [protected, virtual] [virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <WvIn.h>
+
+
Inheritance diagram for WvIn:: +

Public Methods | |
| + | WvIn () |
| Default constructor. | |
| WvIn (const char *fileName, bool raw=FALSE) | |
| Overloaded constructor for file input. More... | |
| +virtual | ~WvIn () |
| Class destructor. | |
| void | openFile (const char *fileName, bool raw=FALSE) |
| Open the specified file and load its data. More... | |
| +void | closeFile (void) |
| If a file is open, close it. | |
| +void | reset (void) |
| Clear outputs and reset time (file pointer) to zero. | |
| void | normalize (void) |
| Normalize data to a maximum of +-1.0. More... | |
| void | normalize (MY_FLOAT peak) |
| Normalize data to a maximum of +-peak. More... | |
| +unsigned long | getSize (void) const |
| Return the file size in sample frames. | |
| +unsigned int | getChannels (void) const |
| Return the number of audio channels in the file. | |
| MY_FLOAT | getFileRate (void) const |
| Return the input file sample rate in Hz (not the data read rate). More... | |
| +bool | isFinished (void) const |
| Query whether reading is complete. | |
| void | setRate (MY_FLOAT aRate) |
| Set the data read rate in samples. The rate can be negative. More... | |
| +virtual void | addTime (MY_FLOAT aTime) |
| Increment the read pointer by aTime samples. | |
| void | setInterpolate (bool doInterpolate) |
| Turn linear interpolation on/off. More... | |
| +virtual MY_FLOAT | lastOut (void) const |
| Return the average across the last output sample frame. | |
| virtual MY_FLOAT | tick (void) |
| Read out the average across one sample frame of data. More... | |
| virtual MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
| Read out vectorSize averaged sample frames of data in vector. More... | |
| +virtual const MY_FLOAT* | lastFrame (void) const |
| Return a pointer to the last output sample frame. | |
| virtual const MY_FLOAT* | tickFrame (void) |
| Return a pointer to the next sample frame of data. More... | |
| virtual MY_FLOAT* | tickFrame (MY_FLOAT *frameVector, unsigned int frames) |
| Read out sample frames of data to frameVector. More... | |
+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 interpolation is used for fractional "read rates". +
+WvIn 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 tickFrame() 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 data types are not supported. 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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/maximum). For incrementally loaded files with floating- point data types, direct scaling by peak is performed. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. + |
+
+
+
|
+
| + + | +
+
+ +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. + |
+
+
+
|
+
| + + | +
+
+ +Return a pointer to the next sample frame of data. + +An StkError will be thrown if a file is read incrementally and a read error occurs. + |
+
+
+
|
+
| + + | +
+
+ +Read out sample frames of data to frameVector. + +An StkError will be thrown if a file is read incrementally and a read error occurs. + |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
[protected, static] [static] [static] [static] [protected] [static] [static] [static] [static] [static] [static] [static] [static] [virtual] [virtual] [virtual] [static] [static] [static] [static] [static] [protected, virtual] [virtual]| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+#include <WvOut.h>
+
+
Inheritance diagram for WvOut:: +

Public Methods | |
| + | WvOut () |
| Default constructor. | |
| WvOut (const char *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. More... | |
| +virtual | ~WvOut () |
| Class destructor. | |
| void | 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. More... | |
| +void | closeFile (void) |
| If a file is open, write out samples in the queue and then close it. | |
| +unsigned long | getFrames (void) const |
| Return the number of sample frames output. | |
| +MY_FLOAT | getTime (void) const |
| Return the number of seconds of data output. | |
| virtual void | tick (const MY_FLOAT sample) |
| Output a single sample to all channels in a sample frame. More... | |
| virtual void | tick (const MY_FLOAT *vector, unsigned int vectorSize) |
| Output each sample in vector to all channels in vectorSize sample frames. More... | |
| virtual void | tickFrame (const MY_FLOAT *frameVector, unsigned int frames=1) |
| Output the frameVector of sample frames of the given length. More... | |
Static Public Attributes | |
| const FILE_TYPE | WVOUT_RAW |
| const FILE_TYPE | WVOUT_WAV |
| const FILE_TYPE | WVOUT_SND |
| const FILE_TYPE | WVOUT_AIF |
| const FILE_TYPE | WVOUT_MAT |
+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 interleaved format. It is important to distinguish the tick() methods, which output single samples to all channels in a sample frame, from the tickFrame() 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 written 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. +
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +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. |
+
+
+
|
+
| + + | +
+
+ +Output a single sample to all channels in a sample frame. + +An StkError is thrown if a file read error occurs. + |
+
+
+
|
+
| + + | +
+
+ +Output each sample in vector to all channels in vectorSize sample frames. + +An StkError is thrown if a file read error occurs. + |
+
+
+
|
+
| + + | +
+
+ +Output the frameVector of sample frames of the given length. + +An StkError is thrown if a file read error occurs. + |
+
+
+
|
+
| + + | +
+
+ +STK RAW file type. |
+
+
+
|
+
| + + | +
+
+ +WAV file type. |
+
+
+
|
+
| + + | +
+
+ +SND (AU) file type. |
+
+
+
|
+
| + + | +
+
+ +AIFF file type. |
+
+
+
|
+
| + + | +
+
+ +Matlab MAT-file type. |
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+ STK Version 4.0: Source distribution (1.64 MB tar/gzipped)
+ STK Version 4.0: Source distribution with precompiled windows binaries (2.26 MB tar/gzipped)
+
+
+ +
+Release Notes:
+
+
+Version 4.0
+
+
+
+Version 3.2
+
+
+
+Version 3.1
+
+
+
+Version 3.0
+
+
+
+Version 2.02
+
+
+
+Version 2
+
+
+
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+Here is a list of all documented class members with links to the classes they belong to:- a -
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+ +
+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 completely 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" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, Sun, and other platforms and should work with any standard C++ compiler. +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+
+
+
+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 completely 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" support (audio and MIDI) on SGI (Irix), Linux, and Windows computer platforms. Generic, non-realtime support has been tested under NeXTStep, 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 Synthesis 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 interface for MIDI input and the simple Tcl/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. Snd, Cool Edit, Matlab). +
+
+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 Tcl/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 SKINI (Synthesis ToolKit Instrument Network Interface, a MIDI-like text message synthesis control format). +
+
+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 hardware, added real-time capabilities, and greatly expanded the synthesis techniques 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 Princeton Sound Kitchen, Perry Cook's home page at Princeton, Gary Scavone's home page 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 and MIDI has been provided by Tim Stilson, Bill Putnam, and Gabriel Maldonado. +
+
+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 documentation, 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. +
+
+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++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+ To join send a message to <stk-request@ccrma.stanford.edu> with the contents: subscribe
+
+ +
+ To be removed from the list send a message to <stk-request@ccrma.stanford.edu> with the contents: unsubscribe
+
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+
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 and depart. +
+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: +
+
+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. SKINI 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. +
+I am basically a bottom-up designer with an awareness of top-down design ideas, so SKINI above all reflects the needs of my particular research and creative projects as they have arisen and developed. SKINI 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. +
+SKINI Messages
+
+
+A basic SKINI message is a line of text. There are only three required fields, the message type (an ASCII 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, ControlChange, etc. MIDI extension message types (messages which look better than MIDI but actually get turned into MIDI-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, etc. 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. +
+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 SKINI 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 assigned 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. +
+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: +
+
+
/* Howdy!!! Welcome to SKINI, by P. Cook 1999 + + 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 0.000000 2 71 82 + NoteOff 0.000000 2 79 82
+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;
+};+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<n> is either:
+
+
+
{"NoteOff" , __SK_NoteOff_, SK_DBL, SK_DBL},
+ {"NoteOn" , __SK_NoteOn_, SK_DBL, SK_DBL},
+
+ {"ControlChange" , __SK_ControlChange_, SK_INT, SK_DBL},
+ {"Volume" , __SK_ControlChange_, __SK_Volume_ , SK_DBL},
+
+ {"StringDamping" , __SK_ControlChange_, __SK_StringDamping_, SK_DBL},
+ {"StringDetune" , __SK_ControlChange_, __SK_StringDetune_, SK_DBL},+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 message 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 byteTwo and byteThree variables of the SKINI 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 changed). +
+The Volume spec is a MIDI Extension message, which behaves like a ControlChange message with the controller number set explicitly to the value for MIDI 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 Volume 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. +
+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->getType() > 0) {
+ tempDouble = score->getDelta();
+ if (tempDouble < 0) {
+ tempDouble = - tempDouble;
+ tempDouble = tempDouble - output.getTime();
+ if (tempDouble < 0) {
+ printf("Bad News Here!!! Backward Absolute Time Required.\n");
+ tempDouble = 0.0;
+ }
+ }
+ tempLong = (long) (tempDouble * Stk::sampleRate());
+ for (i=0;i<tempLong;i++) {
+ output.tick(instrument->tick());
+ }
+ tempDouble3 = score->getByteThree();
+ if (score->getType()== __SK_NoteOn_ ) {
+ tempDouble3 *= NORM_MIDI;
+ if (score->getByteThree() == 0) {
+ tempDouble3 = 0.5;
+ instrument->noteOff(tempDouble3);
+ }
+ else {
+ tempLong = (int) score->getByteTwo();
+ tempDouble2 = Midi2Pitch[tempLong];
+ instrument->noteOn(tempDouble2,tempDouble3);
+ }
+ }
+ else if (score->getType() == __SK_NoteOff_) {
+ tempDouble3 *= NORM_MIDI;
+ instrument->noteOff(tempDouble3);
+ }
+ else if (score->getType() == __SK_ControlChange_) {
+ tempLong = score->getByteTwoInt();
+ instrument->controlChange(tempLong,temp3.0);
+ }
+ score->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->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 deltaTime 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 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 NoteOn 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++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+Windows95/98/2000/XP (specific)
+WindowsNT (specific)
+ +
+ +
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+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" is people who:
+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.). +
+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, WaveLoop, 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.
+ Stk::setSampleRate( 44100.0 );
+
+ // Define and load the sine wave file
+ WaveLoop *input = new WaveLoop("sinewave.raw", TRUE);
+ input->setFrequency(440.0);
+
+ // 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<40000; i++) {
+ output->tick( input->tick() );
+ }
+
+ // Clean up
+ delete input;
+ delete output;
+
+ return 0;
+}+WaveLoop is a subclass of WvIn, 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 WvIn and WvOut classes support multi-channel sample frames. To distinguish 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 from the Stk 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 precision of which can be controlled via the MY_FLOAT #define statement in Stk.h. Thus, the ToolKit can use any normalization scheme desired. The base instruments and algorithms are implemented with a general audio sample dynamic maximum of +/-1.0, and the WvIn and WvOut 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 properly "catch" such errors, the above example should be rewritten as shown below. +
+
// sineosc.cpp
+
+#include "WaveLoop.h"
+#include "RtWvOut.h"
+
+int main()
+{
+ // Set the global sample rate before creating class instances.
+ Stk::setSampleRate( 44100.0 );
+
+ WaveLoop *input = 0;
+ RtWvOut *output = 0;
+
+ try {
+ // Define and load the sine 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;
+ }
+
+ input->setFrequency(440.0);
+
+ // Play the oscillator for 40000 samples
+ for (int i=0; i<40000; i++) {
+ try {
+ output->tick(input->tick());
+ }
+ catch (StkError &) {
+ 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 attempt to recover from or fix a particular problem and, if successful, continue processing. +
+Compiling
+
+
+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__ -D__LITTLE_ENDIAN__ -o sineosc Stk.cpp WvIn.cpp WaveLoop.cpp WvOut.cpp RtWvOut.cpp RtAudio.cpp sineosc.cpp -lpthread
+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, WvIn, WaveLoop, WvOut, RtWvOut, 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 audio drivers installed and you wish to make use of native ALSA API calls, a link to the ALSA library must be specified in the above compile statement (-lasound) and the preprocessor definition should instead be __LINUX_ALSA__.
+
+Irix
+
+
+The irix (SGI) and linux operating systems are both flavors of unix and thus behave 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.cpp RtAudio.cpp sineosc.cpp -lpthread
+Windows
+
+
+I have personally only worked with Visual C++ when compiling programs under windoze. I'll 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 Stk, WvIn, WaveLoop, WvOut, RtWvOut, 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.lib), select the multithreaded library, and provide the __WINDOWS_DS__ and __LITTLE_ENDIAN__ preprocessor definitions.
+
+"Realtime" vs. "Non-Realtime"
+
+
+Most of the Synthesis ToolKit classes are platform independent. That means that they should compile on any reasonably current C++ compiler. The functionality 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 RtAudio, RtWvOut, RtWvIn, RtDuplex, RtMidi, TcpWvIn, TcpWvOut, Socket, and Thread. These classes currently can only be compiled on Linux, Irix, and Windows (except Windows NT) systems using the __LINUX_OSS__, __LINUX_ALSA__, __IRIX_AL__, or __WINDOWS_DS__ preprocessor definitions.
+
+Without the "realtime" classes, it is still possible to read SKINI 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.
+
+To Be Continued ...
+
+
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |

+Home Information Classes Download Usage Mail List Requirements Tutorial
+Directory Structure:
+
+
+The top level distribution contains the following directories: +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+This release of STK comes with four separate "project" directories: +
+
+ +
+
+ +
+
+ +
+
+Compiling:
+
+
+
__LITTLE_ENDIAN__ preprocessor definition to your compiler. The demo project will compile without realtime support, allowing the use of SKINI scorefiles for input control and output to a variety of soundfile formats. The following classes cannot be used without realtime support: RtAudio, RtWvIn, RtWvOut, RtDuplex, RtMidi, Socket, Thread, TcpWvIn, TcpWvOut. Because of this, it is not possible to compile the effects, ragamatic, and most of the examples projects for non-realtime use.
++
__LINUX_OSS__ or __LINUX_ALSA__ preprocessor definitions, which are used to select the underlying 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 compiling 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 system API and for big-endian processors. Special support exists under Linux for the MIDIator 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 system configuration information.
++
__IRIX_AL__ preprocessor definition and linkage with the audio, md, and pthread libraries. If your system has the GNU 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.
++
__WINDOWS_DS__ preprocessor definition and linkage with the dsound.lib, winmm.lib, and Wsock32.lib libraries. In addition, the __LITTLE_ENDIAN__ preprocessor definition 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 soundcard 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.
++
+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 SKINI 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: +
+
+Tcl/Tk graphical user interfaces (GUI) are provided with this distribution which can generate realtime SKINI messages. Note that the Messager class allows multiple 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. +
+The demo project demonstrates the behavior of all the distributed STK instruments. The instruments available with this release include:
+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 SKINI 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 < scores\bookert.ski
+from the demo directory will play the scorefile bookert.ski using the STK BeeThree instrument and write the resulting audio data to a WAV formatted soundfile called "myfile.wav". Typing demo without any arguments will provide a full program usage description.
+
+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 SKINI 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:
+Assuming a successful compilation of the demo program, typing: +
+
cat scores/bookert.ski | demo BeeThree -or
+or (on WindowsXX and/or Unix) +
+
demo BeeThree -or < scores\bookert.ski
+from the demo directory will play the scorefile bookert.ski using the STK BeeThree 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.
+
+Realtime Control Input using Tcl/Tk Graphical User Interfaces:
+
+
+There are a number of Tcl/Tk GUIs supplied with the STK projects. These scripts require Tcl/Tk version 8.0 or later, which can be downloaded for free 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 < 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:
wish < tcl/Physical.tcl in another DOS shell. +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. +
+Realtime MIDI Control Input:
+
+
+On all supported realtime platforms, you can direct realtime MIDI input to the STK Clarinet by typing: +
+
demo Clarinet -or -im
+
| The Synthesis ToolKit in C++ (STK) |
| ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |