6 #define CASCADE_PARALLEL 1
13 int mF0FundamentalFreq
; // Voicing fund freq in Hz
14 int mVoicingAmpdb
; // Amp of voicing in dB, 0 to 70
15 int mFormant1Freq
; // First formant freq in Hz, 200 to 1300
16 int mFormant1Bandwidth
; // First formant bw in Hz, 40 to 1000
17 int mFormant2Freq
; // Second formant freq in Hz, 550 to 3000
18 int mFormant2Bandwidth
; // Second formant bw in Hz, 40 to 1000
19 int mFormant3Freq
; // Third formant freq in Hz, 1200 to 4999
20 int mFormant3Bandwidth
; // Third formant bw in Hz, 40 to 1000
21 int mFormant4Freq
; // Fourth formant freq in Hz, 1200 to 4999
22 int mFormant4Bandwidth
; // Fourth formant bw in Hz, 40 to 1000
23 int mFormant5Freq
; // Fifth formant freq in Hz, 1200 to 4999
24 int mFormant5Bandwidth
; // Fifth formant bw in Hz, 40 to 1000
25 int mFormant6Freq
; // Sixth formant freq in Hz, 1200 to 4999
26 int mFormant6Bandwidth
; // Sixth formant bw in Hz, 40 to 2000
27 int mNasalZeroFreq
; // Nasal zero freq in Hz, 248 to 528
28 int mNasalZeroBandwidth
; // Nasal zero bw in Hz, 40 to 1000
29 int mNasalPoleFreq
; // Nasal pole freq in Hz, 248 to 528
30 int mNasalPoleBandwidth
; // Nasal pole bw in Hz, 40 to 1000
31 int mAspirationAmpdb
; // Amp of aspiration in dB, 0 to 70
32 int mNoSamplesInOpenPeriod
; // # of samples in open period, 10 to 65
33 int mVoicingBreathiness
; // Breathiness in voicing, 0 to 80
34 int mVoicingSpectralTiltdb
; // Voicing spectral tilt in dB, 0 to 24
35 int mFricationAmpdb
; // Amp of frication in dB, 0 to 80
36 int mSkewnessOfAlternatePeriods
; // Skewness of alternate periods, 0 to 40 in sample#/2
37 int mFormant1Ampdb
; // Amp of par 1st formant in dB, 0 to 80
38 int mFormant1ParallelBandwidth
; // Par. 1st formant bw in Hz, 40 to 1000
39 int mFormant2Ampdb
; // Amp of F2 frication in dB, 0 to 80
40 int mFormant2ParallelBandwidth
; // Par. 2nd formant bw in Hz, 40 to 1000
41 int mFormant3Ampdb
; // Amp of F3 frication in dB, 0 to 80
42 int mFormant3ParallelBandwidth
; // Par. 3rd formant bw in Hz, 40 to 1000
43 int mFormant4Ampdb
; // Amp of F4 frication in dB, 0 to 80
44 int mFormant4ParallelBandwidth
; // Par. 4th formant bw in Hz, 40 to 1000
45 int mFormant5Ampdb
; // Amp of F5 frication in dB, 0 to 80
46 int mFormant5ParallelBandwidth
; // Par. 5th formant bw in Hz, 40 to 1000
47 int mFormant6Ampdb
; // Amp of F6 (same as r6pa), 0 to 80
48 int mFormant6ParallelBandwidth
; // Par. 6th formant bw in Hz, 40 to 2000
49 int mParallelNasalPoleAmpdb
; // Amp of par nasal pole in dB, 0 to 80
50 int mBypassFricationAmpdb
; // Amp of bypass fric. in dB, 0 to 80
51 int mPalallelVoicingAmpdb
; // Amp of voicing, par in dB, 0 to 70
52 int mOverallGaindb
; // Overall gain, 60 dB is unity, 0 to 60
62 float mValue
; /* boundary value */
63 int mTime
; /* transition time */
86 resonator mParallelFormant1
, mParallelFormant2
, mParallelFormant3
,
87 mParallelFormant4
, mParallelFormant5
, mParallelFormant6
,
88 mParallelResoNasalPole
, mNasalPole
, mNasalZero
,
89 mCritDampedGlotLowPassFilter
, mDownSampLowPassFilter
, mOutputLowPassFilter
;
93 float mBaseDeclination
;
99 int mF0FundamentalFreq
; // Voicing fund freq in Hz
100 int mVoicingAmpdb
; // Amp of voicing in dB, 0 to 70
101 int mSkewnessOfAlternatePeriods
; // Skewness of alternate periods,0 to 40
102 int mTimeCount
; // used for f0 flutter
103 int mNPer
; // Current loc in voicing period 40000 samp/s
104 int mT0
; // Fundamental period in output samples times 4
105 int mNOpen
; // Number of samples in open phase of period
106 int mNMod
; // Position in period to begin noise amp. modul
108 // Various amplitude variables used in main loop
110 float mAmpVoice
; // mVoicingAmpdb converted to linear gain
111 float mAmpBypas
; // mBypassFricationAmpdb converted to linear gain
112 float mAmpAspir
; // AP converted to linear gain
113 float mAmpFrica
; // mFricationAmpdb converted to linear gain
114 float mAmpBreth
; // ATURB converted to linear gain
116 // State variables of sound sources
118 int mSkew
; // Alternating jitter, in half-period units
119 float mVLast
; // Previous output of voice
120 float mNLast
; // Previous output of random number generator
121 float mGlotLast
; // Previous value of glotout
122 float mDecay
; // mVoicingSpectralTiltdb converted to exponential time const
123 float mOneMd
; // in voicing one-pole ELM_FEATURE_LOW-pass filter
125 unsigned int mSeed
; // random seed
129 float natural_source(int aNper
);
133 void pitch_synch_par_reset(int ns
);
134 void parwave(short int *jwave
);
135 void init(int aBaseFrequency
= 1330, float aBaseSpeed
= 10.0f
, float aBaseDeclination
= 0.5f
, int aBaseWaveform
= KW_SAW
);
136 static int phone_to_elm(char *aPhoneme
, int aCount
, darray
*aElement
);
139 unsigned char *mElement
;
142 Element
* mLastElement
;
148 void initsynth(int aElementCount
,unsigned char *aElement
);
149 int synth(int aSampleCount
, short *aSamplePointer
);