xref: /aosp_15_r20/external/sonivox/arm-wt-22k/lib_src/eas_mdls.h (revision f81fb7c475c4b71ff83bdcc517de2a8c174e4e5c)
1*f81fb7c4SAndroid Build Coastguard Worker /*----------------------------------------------------------------------------
2*f81fb7c4SAndroid Build Coastguard Worker  *
3*f81fb7c4SAndroid Build Coastguard Worker  * File:
4*f81fb7c4SAndroid Build Coastguard Worker  * eas_mdls.h
5*f81fb7c4SAndroid Build Coastguard Worker  *
6*f81fb7c4SAndroid Build Coastguard Worker  * Contents and purpose:
7*f81fb7c4SAndroid Build Coastguard Worker  * Declarations, interfaces, and prototypes for eas_mdls.c
8*f81fb7c4SAndroid Build Coastguard Worker  *
9*f81fb7c4SAndroid Build Coastguard Worker  * Copyright Sonic Network Inc. 2004
10*f81fb7c4SAndroid Build Coastguard Worker 
11*f81fb7c4SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
12*f81fb7c4SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
13*f81fb7c4SAndroid Build Coastguard Worker  * You may obtain a copy of the License at
14*f81fb7c4SAndroid Build Coastguard Worker  *
15*f81fb7c4SAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
16*f81fb7c4SAndroid Build Coastguard Worker  *
17*f81fb7c4SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
18*f81fb7c4SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
19*f81fb7c4SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20*f81fb7c4SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
21*f81fb7c4SAndroid Build Coastguard Worker  * limitations under the License.
22*f81fb7c4SAndroid Build Coastguard Worker  *
23*f81fb7c4SAndroid Build Coastguard Worker  *----------------------------------------------------------------------------
24*f81fb7c4SAndroid Build Coastguard Worker */
25*f81fb7c4SAndroid Build Coastguard Worker 
26*f81fb7c4SAndroid Build Coastguard Worker #ifndef _EAS_MDLS_H
27*f81fb7c4SAndroid Build Coastguard Worker #define _EAS_MDLS_H
28*f81fb7c4SAndroid Build Coastguard Worker 
29*f81fb7c4SAndroid Build Coastguard Worker /*------------------------------------
30*f81fb7c4SAndroid Build Coastguard Worker  * includes
31*f81fb7c4SAndroid Build Coastguard Worker  *------------------------------------
32*f81fb7c4SAndroid Build Coastguard Worker */
33*f81fb7c4SAndroid Build Coastguard Worker #include "eas_data.h"
34*f81fb7c4SAndroid Build Coastguard Worker 
35*f81fb7c4SAndroid Build Coastguard Worker 
36*f81fb7c4SAndroid Build Coastguard Worker /*------------------------------------
37*f81fb7c4SAndroid Build Coastguard Worker  * Some defines for dls.h
38*f81fb7c4SAndroid Build Coastguard Worker  *------------------------------------
39*f81fb7c4SAndroid Build Coastguard Worker */
40*f81fb7c4SAndroid Build Coastguard Worker #ifndef DWORD
41*f81fb7c4SAndroid Build Coastguard Worker #define DWORD EAS_I32
42*f81fb7c4SAndroid Build Coastguard Worker #define FAR
43*f81fb7c4SAndroid Build Coastguard Worker #define SHORT EAS_I16
44*f81fb7c4SAndroid Build Coastguard Worker #define USHORT EAS_U16
45*f81fb7c4SAndroid Build Coastguard Worker #define LONG EAS_I32
46*f81fb7c4SAndroid Build Coastguard Worker #define ULONG EAS_U32
47*f81fb7c4SAndroid Build Coastguard Worker #endif
48*f81fb7c4SAndroid Build Coastguard Worker 
49*f81fb7c4SAndroid Build Coastguard Worker 
50*f81fb7c4SAndroid Build Coastguard Worker /* GUID struct (call it DLSID in case GUID is defined elsewhere) */
51*f81fb7c4SAndroid Build Coastguard Worker typedef struct
52*f81fb7c4SAndroid Build Coastguard Worker {
53*f81fb7c4SAndroid Build Coastguard Worker     EAS_U32 Data1;
54*f81fb7c4SAndroid Build Coastguard Worker     EAS_U16 Data2;
55*f81fb7c4SAndroid Build Coastguard Worker     EAS_U16 Data3;
56*f81fb7c4SAndroid Build Coastguard Worker     EAS_U8  Data4[8];
57*f81fb7c4SAndroid Build Coastguard Worker } DLSID;
58*f81fb7c4SAndroid Build Coastguard Worker 
59*f81fb7c4SAndroid Build Coastguard Worker #define DEFINE_DLSID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) const DLSID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
60*f81fb7c4SAndroid Build Coastguard Worker 
61*f81fb7c4SAndroid Build Coastguard Worker /*------------------------------------
62*f81fb7c4SAndroid Build Coastguard Worker  * defines
63*f81fb7c4SAndroid Build Coastguard Worker  *------------------------------------
64*f81fb7c4SAndroid Build Coastguard Worker */
65*f81fb7c4SAndroid Build Coastguard Worker 
66*f81fb7c4SAndroid Build Coastguard Worker /* maximum sample memory for DLS query support */
67*f81fb7c4SAndroid Build Coastguard Worker #ifndef MAX_DLS_MEMORY
68*f81fb7c4SAndroid Build Coastguard Worker #define MAX_DLS_MEMORY 65536
69*f81fb7c4SAndroid Build Coastguard Worker #endif
70*f81fb7c4SAndroid Build Coastguard Worker 
71*f81fb7c4SAndroid Build Coastguard Worker /* size of conditional chunk stack */
72*f81fb7c4SAndroid Build Coastguard Worker #ifndef CDL_STACK_SIZE
73*f81fb7c4SAndroid Build Coastguard Worker #define CDL_STACK_SIZE 8
74*f81fb7c4SAndroid Build Coastguard Worker #endif
75*f81fb7c4SAndroid Build Coastguard Worker 
76*f81fb7c4SAndroid Build Coastguard Worker /* size of read buffer for sample conversion */
77*f81fb7c4SAndroid Build Coastguard Worker #ifndef SAMPLE_CONVERT_CHUNK_SIZE
78*f81fb7c4SAndroid Build Coastguard Worker #define SAMPLE_CONVERT_CHUNK_SIZE 32
79*f81fb7c4SAndroid Build Coastguard Worker #endif
80*f81fb7c4SAndroid Build Coastguard Worker 
81*f81fb7c4SAndroid Build Coastguard Worker 
82*f81fb7c4SAndroid Build Coastguard Worker #define ZERO_TIME_IN_CENTS              -32768
83*f81fb7c4SAndroid Build Coastguard Worker 
84*f81fb7c4SAndroid Build Coastguard Worker /* Pan calculation macros */
85*f81fb7c4SAndroid Build Coastguard Worker #define PAN_CONVERSION_FACTOR       4129
86*f81fb7c4SAndroid Build Coastguard Worker #define MAX_PAN_VALUE               63
87*f81fb7c4SAndroid Build Coastguard Worker #define MIN_PAN_VALUE               -63
88*f81fb7c4SAndroid Build Coastguard Worker 
89*f81fb7c4SAndroid Build Coastguard Worker /* multiplier to convert time cents to 10-bit fraction log for EAS_LogToLinear16 */
90*f81fb7c4SAndroid Build Coastguard Worker #define TIME_CENTS_TO_LOG2          27962
91*f81fb7c4SAndroid Build Coastguard Worker 
92*f81fb7c4SAndroid Build Coastguard Worker /* conversion factor sustain level from percent to exponent for LogToLinear16 */
93*f81fb7c4SAndroid Build Coastguard Worker #define SUSTAIN_LOG_CONVERSION_FACTOR   536871
94*f81fb7c4SAndroid Build Coastguard Worker #define SUSTAIN_LOG_CONVERSION_SHIFT    15
95*f81fb7c4SAndroid Build Coastguard Worker 
96*f81fb7c4SAndroid Build Coastguard Worker /* conversion factor sustain level from percent to EG full scale */
97*f81fb7c4SAndroid Build Coastguard Worker #define SUSTAIN_LINEAR_CONVERSION_FACTOR    1073709
98*f81fb7c4SAndroid Build Coastguard Worker 
99*f81fb7c4SAndroid Build Coastguard Worker /* conversion factor to convert frame period to decay rate */
100*f81fb7c4SAndroid Build Coastguard Worker #define DECAY_CONVERSION_FACTOR     -16
101*f81fb7c4SAndroid Build Coastguard Worker 
102*f81fb7c4SAndroid Build Coastguard Worker /*----------------------------------------------------------------------------
103*f81fb7c4SAndroid Build Coastguard Worker  * These macros define the various characteristics of the defined sample rates
104*f81fb7c4SAndroid Build Coastguard Worker  *----------------------------------------------------------------------------
105*f81fb7c4SAndroid Build Coastguard Worker  * DLS_ATTACK_TIME_CONVERT      log offset for conversion from time cents to attack rate
106*f81fb7c4SAndroid Build Coastguard Worker  * DLS_LFO_FREQUENCY_CONVERT    pitch-cents offset for LFO frequency conversion
107*f81fb7c4SAndroid Build Coastguard Worker  *----------------------------------------------------------------------------
108*f81fb7c4SAndroid Build Coastguard Worker */
109*f81fb7c4SAndroid Build Coastguard Worker 
110*f81fb7c4SAndroid Build Coastguard Worker #if defined (_SAMPLE_RATE_8000)
111*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -9559
112*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5921
113*f81fb7c4SAndroid Build Coastguard Worker 
114*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_16000)
115*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -9559
116*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5921
117*f81fb7c4SAndroid Build Coastguard Worker 
118*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_20000)
119*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -8745
120*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5108
121*f81fb7c4SAndroid Build Coastguard Worker 
122*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_22050)
123*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -8914
124*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5277
125*f81fb7c4SAndroid Build Coastguard Worker 
126*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_24000)
127*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -9061
128*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5423
129*f81fb7c4SAndroid Build Coastguard Worker 
130*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_32000)
131*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -9559
132*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5921
133*f81fb7c4SAndroid Build Coastguard Worker 
134*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_44100)
135*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -8914
136*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5277
137*f81fb7c4SAndroid Build Coastguard Worker 
138*f81fb7c4SAndroid Build Coastguard Worker #elif defined (_SAMPLE_RATE_48000)
139*f81fb7c4SAndroid Build Coastguard Worker #define DLS_RATE_CONVERT                -9061
140*f81fb7c4SAndroid Build Coastguard Worker #define DLS_LFO_FREQUENCY_CONVERT       5423
141*f81fb7c4SAndroid Build Coastguard Worker 
142*f81fb7c4SAndroid Build Coastguard Worker #else
143*f81fb7c4SAndroid Build Coastguard Worker #error "_SAMPLE_RATE_XXXXX must be defined to valid rate"
144*f81fb7c4SAndroid Build Coastguard Worker #endif
145*f81fb7c4SAndroid Build Coastguard Worker 
146*f81fb7c4SAndroid Build Coastguard Worker /*
147*f81fb7c4SAndroid Build Coastguard Worker  * FILTER_Q_CONVERSION_FACTOR convers the 0.1dB steps in the DLS
148*f81fb7c4SAndroid Build Coastguard Worker  * file to our internal 0.75 dB steps. The value is calculated
149*f81fb7c4SAndroid Build Coastguard Worker  * as follows:
150*f81fb7c4SAndroid Build Coastguard Worker  *
151*f81fb7c4SAndroid Build Coastguard Worker  * 32768 / (10 * <step-size in dB>)
152*f81fb7c4SAndroid Build Coastguard Worker  *
153*f81fb7c4SAndroid Build Coastguard Worker  * FILTER_RESONANCE_NUM_ENTRIES is the number of entries in the table
154*f81fb7c4SAndroid Build Coastguard Worker */
155*f81fb7c4SAndroid Build Coastguard Worker #define FILTER_Q_CONVERSION_FACTOR          4369
156*f81fb7c4SAndroid Build Coastguard Worker #define FILTER_RESONANCE_NUM_ENTRIES        31
157*f81fb7c4SAndroid Build Coastguard Worker 
158*f81fb7c4SAndroid Build Coastguard Worker /*
159*f81fb7c4SAndroid Build Coastguard Worker  * Multiplier to convert DLS gain units (10ths of a dB) to a
160*f81fb7c4SAndroid Build Coastguard Worker  * power-of-two exponent for conversion to linear gain using our
161*f81fb7c4SAndroid Build Coastguard Worker  * piece-wise linear approximator. Note that we ignore the lower
162*f81fb7c4SAndroid Build Coastguard Worker  * 16-bits of the DLS gain value. The result is a 10-bit fraction
163*f81fb7c4SAndroid Build Coastguard Worker  * that works with the EAS_LogToLinear16 function.
164*f81fb7c4SAndroid Build Coastguard Worker  *
165*f81fb7c4SAndroid Build Coastguard Worker  * DLS_GAIN_FACTOR = (2^18) / (200 * log10(2))
166*f81fb7c4SAndroid Build Coastguard Worker  */
167*f81fb7c4SAndroid Build Coastguard Worker #define DLS_GAIN_FACTOR         4354
168*f81fb7c4SAndroid Build Coastguard Worker #define DLS_GAIN_SHIFT          8
169*f81fb7c4SAndroid Build Coastguard Worker 
170*f81fb7c4SAndroid Build Coastguard Worker /*
171*f81fb7c4SAndroid Build Coastguard Worker  * Reciprocal of 10 for quick divide by 10's
172*f81fb7c4SAndroid Build Coastguard Worker  *
173*f81fb7c4SAndroid Build Coastguard Worker  * DLS_GAIN_FACTOR = (2^18) / (200 * log10(2))
174*f81fb7c4SAndroid Build Coastguard Worker  */
175*f81fb7c4SAndroid Build Coastguard Worker #define DLS_DIV_10_FACTOR       3277
176*f81fb7c4SAndroid Build Coastguard Worker #define DLS_DIV_10_SHIFT        16
177*f81fb7c4SAndroid Build Coastguard Worker 
178*f81fb7c4SAndroid Build Coastguard Worker /*
179*f81fb7c4SAndroid Build Coastguard Worker  * Multiplier to convert DLS time cents units to a power-of-two
180*f81fb7c4SAndroid Build Coastguard Worker  * exponent for conversion to absolute time units using our
181*f81fb7c4SAndroid Build Coastguard Worker  * piece-wise linear approximator.
182*f81fb7c4SAndroid Build Coastguard Worker  *
183*f81fb7c4SAndroid Build Coastguard Worker  * DLS_TIME_FACTOR = (2^22) / 1200
184*f81fb7c4SAndroid Build Coastguard Worker  */
185*f81fb7c4SAndroid Build Coastguard Worker #define DLS_TIME_FACTOR         3495
186*f81fb7c4SAndroid Build Coastguard Worker #define DLS_TIME_SHIFT          22
187*f81fb7c4SAndroid Build Coastguard Worker 
188*f81fb7c4SAndroid Build Coastguard Worker 
189*f81fb7c4SAndroid Build Coastguard Worker /* LFO limits */
190*f81fb7c4SAndroid Build Coastguard Worker #define MAX_LFO_FREQUENCY_IN_HERTZ          20
191*f81fb7c4SAndroid Build Coastguard Worker #define MIN_LFO_FREQUENCY_IN_HERTZ          0.1
192*f81fb7c4SAndroid Build Coastguard Worker #define MAX_LFO_FREQUENCY_IN_PITCHCENTS     1549
193*f81fb7c4SAndroid Build Coastguard Worker #define MIN_LFO_FREQUENCY_IN_PITCHCENTS     -7624
194*f81fb7c4SAndroid Build Coastguard Worker #define MAX_LFO_AMPLITUDE_DEPTH             12  /* in dB, DLS2.1 p 31*/
195*f81fb7c4SAndroid Build Coastguard Worker #define MIN_LFO_AMPLITUDE_DEPTH             -12 /* in dB, DLS2.1 p 31*/
196*f81fb7c4SAndroid Build Coastguard Worker 
197*f81fb7c4SAndroid Build Coastguard Worker /* add to pitch cents before pow(2.0, n) to convert to frequency */
198*f81fb7c4SAndroid Build Coastguard Worker #define ABSOLUTE_PITCH_BIAS                 238395828
199*f81fb7c4SAndroid Build Coastguard Worker 
200*f81fb7c4SAndroid Build Coastguard Worker #define A5_PITCH_OFFSET                     6900
201*f81fb7c4SAndroid Build Coastguard Worker 
202*f81fb7c4SAndroid Build Coastguard Worker /*
203*f81fb7c4SAndroid Build Coastguard Worker CHUNK_TYPE is a macro that converts the 4 input args into a 32-bit int
204*f81fb7c4SAndroid Build Coastguard Worker where
205*f81fb7c4SAndroid Build Coastguard Worker argument a is placed at the MSB location and
206*f81fb7c4SAndroid Build Coastguard Worker argument d is placed at the LSB location.
207*f81fb7c4SAndroid Build Coastguard Worker This is useful for determining the DLS chunk types
208*f81fb7c4SAndroid Build Coastguard Worker */
209*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_TYPE(a,b,c,d) (   \
210*f81fb7c4SAndroid Build Coastguard Worker         ( ((EAS_U32)(a) & 0xFF) << 24 ) \
211*f81fb7c4SAndroid Build Coastguard Worker     +   ( ((EAS_U32)(b) & 0xFF) << 16 ) \
212*f81fb7c4SAndroid Build Coastguard Worker     +   ( ((EAS_U32)(c) & 0xFF) <<  8 ) \
213*f81fb7c4SAndroid Build Coastguard Worker     +   ( ((EAS_U32)(d) & 0xFF)       ) )
214*f81fb7c4SAndroid Build Coastguard Worker 
215*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_RIFF                  CHUNK_TYPE('R','I','F','F')
216*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_DLS                   CHUNK_TYPE('D','L','S',' ')
217*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_CDL                   CHUNK_TYPE('c','d','l',' ')
218*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_VERS                  CHUNK_TYPE('v','e','r','s')
219*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_DLID                  CHUNK_TYPE('d','l','i','d')
220*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_LIST                  CHUNK_TYPE('L','I','S','T')
221*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_COLH                  CHUNK_TYPE('c','o','l','h')
222*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_LINS                  CHUNK_TYPE('l','i','n','s')
223*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_PTBL                  CHUNK_TYPE('p','t','b','l')
224*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_WVPL                  CHUNK_TYPE('w','v','p','l')
225*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_INFO                  CHUNK_TYPE('I','N','F','O')
226*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_INAM                  CHUNK_TYPE('I','N','A','M')
227*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_INS                   CHUNK_TYPE('i','n','s',' ')
228*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_INSH                  CHUNK_TYPE('i','n','s','h')
229*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_LRGN                  CHUNK_TYPE('l','r','g','n')
230*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_RGN                   CHUNK_TYPE('r','g','n',' ')
231*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_RGN2                  CHUNK_TYPE('r','g','n','2')
232*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_RGNH                  CHUNK_TYPE('r','g','n','h')
233*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_WSMP                  CHUNK_TYPE('w','s','m','p')
234*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_WLNK                  CHUNK_TYPE('w','l','n','k')
235*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_LART                  CHUNK_TYPE('l','a','r','t')
236*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_LAR2                  CHUNK_TYPE('l','a','r','2')
237*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_ART1                  CHUNK_TYPE('a','r','t','1')
238*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_ART2                  CHUNK_TYPE('a','r','t','2')
239*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_WAVE                  CHUNK_TYPE('w','a','v','e')
240*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_FMT                   CHUNK_TYPE('f','m','t',' ')
241*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_DATA                  CHUNK_TYPE('d','a','t','a')
242*f81fb7c4SAndroid Build Coastguard Worker #define CHUNK_DMPR                  CHUNK_TYPE('d','m','p','r')
243*f81fb7c4SAndroid Build Coastguard Worker 
244*f81fb7c4SAndroid Build Coastguard Worker 
245*f81fb7c4SAndroid Build Coastguard Worker #define WAVE_FORMAT_PCM             0x0001 /* Microsoft PCM format, see DLS2.1 p60 */
246*f81fb7c4SAndroid Build Coastguard Worker #define WAVE_FORMAT_EXTENSIBLE      0xffff
247*f81fb7c4SAndroid Build Coastguard Worker 
248*f81fb7c4SAndroid Build Coastguard Worker /* defines for wave table structures */
249*f81fb7c4SAndroid Build Coastguard Worker 
250*f81fb7c4SAndroid Build Coastguard Worker /* initialize each articulation structure to a harmless state */
251*f81fb7c4SAndroid Build Coastguard Worker /* change art values after we've determined EAS internals */
252*f81fb7c4SAndroid Build Coastguard Worker #define DEFAULT_DLS_FILTER_CUTOFF_FREQUENCY     0x7FFF      /* DLS2.1, p 31 means leave filter off */
253*f81fb7c4SAndroid Build Coastguard Worker 
254*f81fb7c4SAndroid Build Coastguard Worker /**********/
255*f81fb7c4SAndroid Build Coastguard Worker 
256*f81fb7c4SAndroid Build Coastguard Worker /* define the waves that we expect to generate instead of store */
257*f81fb7c4SAndroid Build Coastguard Worker /* NOTE: our comparison routine converts the input string
258*f81fb7c4SAndroid Build Coastguard Worker to lowercase, so the following comparison values should all
259*f81fb7c4SAndroid Build Coastguard Worker be in lowercase.
260*f81fb7c4SAndroid Build Coastguard Worker */
261*f81fb7c4SAndroid Build Coastguard Worker #define STRING_NOISE            "noise"
262*f81fb7c4SAndroid Build Coastguard Worker 
263*f81fb7c4SAndroid Build Coastguard Worker 
264*f81fb7c4SAndroid Build Coastguard Worker /*------------------------------------
265*f81fb7c4SAndroid Build Coastguard Worker  * type definitions
266*f81fb7c4SAndroid Build Coastguard Worker  *------------------------------------
267*f81fb7c4SAndroid Build Coastguard Worker */
268*f81fb7c4SAndroid Build Coastguard Worker #ifdef _STANDALONE_CONVERTER
269*f81fb7c4SAndroid Build Coastguard Worker typedef struct s_dls_params
270*f81fb7c4SAndroid Build Coastguard Worker {
271*f81fb7c4SAndroid Build Coastguard Worker     EAS_INT     sampleRate;
272*f81fb7c4SAndroid Build Coastguard Worker     EAS_INT     samplesPerFrame;
273*f81fb7c4SAndroid Build Coastguard Worker     EAS_INT     bitDepth;
274*f81fb7c4SAndroid Build Coastguard Worker     double      ditherLevel;
275*f81fb7c4SAndroid Build Coastguard Worker     double      ditherFilterCoeff;
276*f81fb7c4SAndroid Build Coastguard Worker     EAS_BOOL    compatibility;
277*f81fb7c4SAndroid Build Coastguard Worker     EAS_BOOL    encodeADPCM;
278*f81fb7c4SAndroid Build Coastguard Worker } S_DLS_PARAMS;
279*f81fb7c4SAndroid Build Coastguard Worker #endif
280*f81fb7c4SAndroid Build Coastguard Worker 
281*f81fb7c4SAndroid Build Coastguard Worker 
282*f81fb7c4SAndroid Build Coastguard Worker /* function prototypes */
283*f81fb7c4SAndroid Build Coastguard Worker EAS_RESULT DLSParser (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE fileHandle, EAS_I32 offset, S_DLS **pDLS);
284*f81fb7c4SAndroid Build Coastguard Worker EAS_RESULT DLSCleanup (EAS_HW_DATA_HANDLE hwInstData, S_DLS *pDLS);
285*f81fb7c4SAndroid Build Coastguard Worker void DLSAddRef (S_DLS *pDLS);
286*f81fb7c4SAndroid Build Coastguard Worker EAS_I16 ConvertDelay (EAS_I32 timeCents);
287*f81fb7c4SAndroid Build Coastguard Worker EAS_I16 ConvertRate (EAS_I32 timeCents);
288*f81fb7c4SAndroid Build Coastguard Worker 
289*f81fb7c4SAndroid Build Coastguard Worker 
290*f81fb7c4SAndroid Build Coastguard Worker #ifdef _STANDALONE_CONVERTER
291*f81fb7c4SAndroid Build Coastguard Worker void DLSConvParams (S_DLS_PARAMS *pParams, EAS_BOOL set);
292*f81fb7c4SAndroid Build Coastguard Worker #endif
293*f81fb7c4SAndroid Build Coastguard Worker 
294*f81fb7c4SAndroid Build Coastguard Worker #endif
295*f81fb7c4SAndroid Build Coastguard Worker 
296