1 /*----------------------------------------------------------------------------
2  *
3  * File:
4  * eas_wtsynth.h
5  *
6  * Contents and purpose:
7  * This file defines the interface for synthesizer engine
8  *
9  * Copyright Sonic Network Inc. 2004
10 
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  *----------------------------------------------------------------------------
24  * Revision Control:
25  *   $Revision: 82 $
26  *   $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
27  *----------------------------------------------------------------------------
28 */
29 
30 #ifndef _EAS_WTSYNTH_H
31 #define _EAS_WTSYNTH_H
32 
33 #include "eas_sndlib.h"
34 #include "eas_wtengine.h"
35 
36 /* adjust the filter cutoff frequency to the sample rate */
37 #if defined (_SAMPLE_RATE_8000)
38 #define FILTER_CUTOFF_FREQ_ADJUST       0
39 #elif defined (_SAMPLE_RATE_16000)
40 #define FILTER_CUTOFF_FREQ_ADJUST       1200
41 #elif defined (_SAMPLE_RATE_20000)
42 #define FILTER_CUTOFF_FREQ_ADJUST       1586
43 #elif defined (_SAMPLE_RATE_22050)
44 #define FILTER_CUTOFF_FREQ_ADJUST       1756
45 #elif defined (_SAMPLE_RATE_24000)
46 #define FILTER_CUTOFF_FREQ_ADJUST       1902
47 #elif defined (_SAMPLE_RATE_32000)
48 #define FILTER_CUTOFF_FREQ_ADJUST       2400
49 #elif defined (_SAMPLE_RATE_44100)
50 #define FILTER_CUTOFF_FREQ_ADJUST       2956
51 #elif defined (_SAMPLE_RATE_48000)
52 #define FILTER_CUTOFF_FREQ_ADJUST       3102
53 #else
54 #error "_SAMPLE_RATE_XXXXX must be defined to valid rate"
55 #endif
56 
57 /* function prototypes */
58 void WT_UpdateLFO (S_LFO_CONTROL *pLFO, EAS_I16 phaseInc);
59 
60 #if defined(_FILTER_ENABLED) || defined(DLS_SYNTHESIZER)
61 void WT_SetFilterCoeffs (S_WT_INT_FRAME *pIntFrame, EAS_I32 cutoff, EAS_I32 resonance);
62 #endif
63 
64 #endif
65 
66 
67