~ubuntu-branches/ubuntu/oneiric/muse/oneiric

« back to all changes in this revision

Viewing changes to synti/stklib/VoicForm.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
/*******************************************/
 
18
 
 
19
#if !defined(__VoicForm_h)
 
20
#define __VoicForm_h
 
21
 
 
22
#include "Instrmnt.h"
 
23
#include "Envelope.h"
 
24
#include "Noise.h"
 
25
#include "SingWave.h"
 
26
#include "FormSwep.h"
 
27
#include "OnePole.h"
 
28
#include "OneZero.h"
 
29
 
 
30
class VoicForm : public Instrmnt
 
31
{
 
32
  protected:  
 
33
    SingWave *voiced;
 
34
    Noise    *noise;
 
35
    Envelope *noiseEnv;
 
36
    FormSwep  *filters[4];
 
37
    OnePole  *onepole;
 
38
    OneZero  *onezero;
 
39
    MY_FLOAT lastFreq;
 
40
    MY_FLOAT lastGain;
 
41
  public:
 
42
    VoicForm();
 
43
    ~VoicForm();
 
44
    void clear();
 
45
    void setFreq(MY_FLOAT frequency);
 
46
    void setFormantAll(int whichOne, MY_FLOAT freq, MY_FLOAT reson, MY_FLOAT gain);
 
47
    int  setPhoneme(char* phoneme);
 
48
    void setVoiced(MY_FLOAT vGain);
 
49
    void setUnVoiced(MY_FLOAT nGain);
 
50
    void setVoicedUnVoiced(MY_FLOAT vGain, MY_FLOAT nGain);
 
51
    void setFiltSweepRate(int whichOne,MY_FLOAT rate);
 
52
    void setPitchSweepRate(MY_FLOAT rate);
 
53
    void speak();
 
54
    void quiet();
 
55
    virtual void noteOn(MY_FLOAT freq, MY_FLOAT amp);
 
56
    virtual void noteOff(MY_FLOAT amp);
 
57
    MY_FLOAT tick();
 
58
    virtual void controlChange(int number, MY_FLOAT value);
 
59
};
 
60
 
 
61
#endif