home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / NOTATION / SILENCE / VOICFORM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-25  |  2.0 KB  |  66 lines

  1. /*******************************************/
  2. /*  4 Formant Synthesis Instrument         */
  3. /*  by Perry R. Cook, 1995-96              */ 
  4. /*  This instrument contains an excitation */
  5. /*  singing wavetable (looping wave with   */
  6. /*  random and periodic vibrato, smoothing */
  7. /*  on frequency, etc.), excitation noise, */
  8. /*  and four sweepable complex resonances. */
  9. /*                       */
  10. /*  Measured Formant data (from me) is     */
  11. /*  included, and enough data is there to  */
  12. /*  support either parallel or cascade     */
  13. /*  synthesis.  In the floating point case */
  14. /*  cascade synthesis is the most natural  */
  15. /*  so that's what you'll find here.       */
  16. /*                       */
  17. /*  For right now, there's a simple command*/
  18. /*  line score interface consisting of 3   */
  19. /*  letter symbols for the phonemes, =xx   */
  20. /*  sets the pitch to x, + and - add and   */
  21. /*  subtract a half step, and ... makes it */
  22. /*  keep doing what it's doing for longer. */
  23. /*******************************************/
  24.  
  25. #if !defined(__VoicForm_h)
  26. #define __VoicForm_h
  27.  
  28. #include "Instrmnt.h"
  29. #include "Envelope.h"
  30. #include "Noise.h"
  31. #include "SingWave.h"
  32. #include "FormSwep.h"
  33. #include "OnePole.h"
  34. #include "OneZero.h"
  35.  
  36. class VoicForm : public Instrmnt
  37. {
  38.   protected:  
  39.     SingWave *voiced;
  40.     Noise    *noise;
  41.     Envelope *noiseEnv;
  42.     FormSwep  *filters[4];
  43.     OnePole  *onepole;
  44.     OneZero  *onezero;
  45.   public:
  46.     VoicForm();
  47.     ~VoicForm();
  48.     void clear();
  49.     void setFreq(double frequency);
  50.     void setFormantAll(int whichOne, double freq, double reson, double gain);
  51.     int  setPhoneme(char* phoneme);
  52.     void setVoiced(double vGain);
  53.     void setUnVoiced(double nGain);
  54.     void setVoicedUnVoiced(double vGain, double nGain);
  55.     void setFiltSweepRate(int whichOne,double rate);
  56.     void setPitchSweepRate(double rate);
  57.     void speak();
  58.     void quiet();
  59.     virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
  60.     virtual void noteOff(MY_FLOAT amp);
  61.     MY_FLOAT tick();
  62.     virtual void controlChange(int number, MY_FLOAT value);
  63. };
  64.  
  65. #endif
  66.