1 /*---------------------------------------------------------------------------*
2   Project: AUX effects for AX library
3   File:    axfx.h
4 
5   Copyright (C) Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 #ifndef __AXFX_H__
16 #define __AXFX_H__
17 
18 #include <cafe/ax.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 
25 /*==========================================================================*
26     lib version
27  *==========================================================================*/
28 
29 #define AXFX_VERSION          0x0200      // Version 2.0
30 
31 
32 /*==========================================================================*
33     memory allocation
34  *==========================================================================*/
35 
36 typedef void*   (*AXFXAlloc) (u32);
37 typedef void    (*AXFXFree)  (void*);
38 
39 void AXFXSetHooks(AXFXAlloc  alloc, AXFXFree  free);
40 void AXFXGetHooks(AXFXAlloc *alloc, AXFXFree *free);
41 
42 BOOL AXFX2SetMemAllocFns(AXFXAlloc alloc, AXFXFree free);
43 BOOL AXFX2GetMemAllocFns(AXFXAlloc *alloc, AXFXFree *free);
44 
45 /*==========================================================================*
46     buffer update
47  *==========================================================================*/
48 
49 /*----------------------------------------------*
50     for mono, stereo, surround
51  *----------------------------------------------*/
52 
53 typedef struct AXFX_BUFFERUPDATE
54 {
55     s32       *left;
56     s32       *right;
57     s32       *surround;
58 
59 } AXFX_BUFFERUPDATE;
60 
61 
62 /*----------------------------------------------*
63     for Dolby prologic2
64  *----------------------------------------------*/
65 
66 typedef struct AXFX_BUFFERUPDATE_DPL2
67 {
68     s32       *L;
69     s32       *R;
70     s32       *Ls;
71     s32       *Rs;
72 
73 } AXFX_BUFFERUPDATE_DPL2;
74 
75 
76 /*==========================================================================*
77     send bus (for connecting FXs)
78  *==========================================================================*/
79 
80 /*----------------------------------------------*
81     for mono, stereo, surround
82  *----------------------------------------------*/
83 
84 typedef struct AXFX_BUS
85 {
86     s32       *left;
87     s32       *right;
88     s32       *surround;
89 
90 } AXFX_BUS;
91 
92 
93 /*----------------------------------------------*
94     for Dolby prologic2
95  *----------------------------------------------*/
96 
97 typedef struct AXFX_BUS_DPL2
98 {
99     s32       *L;
100     s32       *R;
101     s32       *Ls;
102     s32       *Rs;
103 
104 } AXFX_BUS_DPL2;
105 
106 
107 /*==========================================================================*
108   ==========================================================================
109 
110     High Quality Reverb
111 
112   ==========================================================================
113  *==========================================================================*/
114 
115 /*==========================================================================*
116     expanded version
117  *==========================================================================*/
118 
119 // early reflection type
120 #define AXFX_REVERBHI_EXP_EARLY_MODE_5MS           0
121 #define AXFX_REVERBHI_EXP_EARLY_MODE_10MS          1
122 #define AXFX_REVERBHI_EXP_EARLY_MODE_15MS          2
123 #define AXFX_REVERBHI_EXP_EARLY_MODE_20MS          3
124 #define AXFX_REVERBHI_EXP_EARLY_MODE_25MS          4
125 #define AXFX_REVERBHI_EXP_EARLY_MODE_30MS          5
126 #define AXFX_REVERBHI_EXP_EARLY_MODE_35MS          6
127 #define AXFX_REVERBHI_EXP_EARLY_MODE_40MS          7
128 #define AXFX_REVERBHI_EXP_EARLY_MODE_MAX           8
129 
130 // fused reverb type
131 #define AXFX_REVERBHI_EXP_FUSED_MODE_OLD_AXFX      0
132 #define AXFX_REVERBHI_EXP_FUSED_MODE_METAL_TANK    1
133 #define AXFX_REVERBHI_EXP_FUSED_MODE_SMALL_ROOM    2
134 #define AXFX_REVERBHI_EXP_FUSED_MODE_LARGE_ROOM    3
135 #define AXFX_REVERBHI_EXP_FUSED_MODE_HALL          4
136 #define AXFX_REVERBHI_EXP_FUSED_MODE_CAVERNOUS     5
137 #define AXFX_REVERBHI_EXP_FUSED_MODE_LONGEST       6  // do not use this!
138 #define AXFX_REVERBHI_EXP_FUSED_MODE_MAX           7
139 
140 #define AXFX_REVHI_EXP_MIN_PREDELAYTIMEMAX      0.0f
141 //#define AXFX_REVHI_EXP_MAX_PREDELAYTIMEMAX
142 
143 #define AXFX_REVHI_EXP_MIN_PREDELAYTIME         0.0f
144 //#define AXFX_REVHI_EXP_MAX_PREDELAYTIME
145 
146 #define AXFX_REVHI_EXP_MIN_FUSEDTIME            0.0f
147 //#define AXFX_REVHI_EXP_MAX_FUSEDTIME
148 
149 #define AXFX_REVHI_EXP_MIN_COLORATION           0.0f
150 #define AXFX_REVHI_EXP_MAX_COLORATION           1.0f
151 
152 #define AXFX_REVHI_EXP_MIN_DAMPING              0.0f
153 #define AXFX_REVHI_EXP_MAX_DAMPING              1.0f
154 
155 #define AXFX_REVHI_EXP_MIN_CROSSTALK            0.0f
156 #define AXFX_REVHI_EXP_MAX_CROSSTALK            1.0f
157 
158 #define AXFX_REVHI_EXP_MIN_EARLYGAIN            0.0f
159 #define AXFX_REVHI_EXP_MAX_EARLYGAIN            1.0f
160 
161 #define AXFX_REVHI_EXP_MIN_FUSEDGAIN            0.0f
162 #define AXFX_REVHI_EXP_MAX_FUSEDGAIN            1.0f
163 
164 #define AXFX_REVHI_EXP_MIN_OUTGAIN              0.0f
165 #define AXFX_REVHI_EXP_MAX_OUTGAIN              1.0f
166 
167 #define AXFX_REVHI_EXP_MIN_SENDGAIN             0.0f
168 #define AXFX_REVHI_EXP_MAX_SENDGAIN             1.0f
169 
170 /*----------------------------------------------*
171     for mono, stereo, surround
172  *----------------------------------------------*/
173 
174 typedef struct AXFX_REVERBHI_EXP
175 {
176     // do not touch these!
177     f32       *earlyLine[3];
178     u32        earlyPos[3];
179     u32        earlyLength;
180     u32        earlyMaxLength;
181     f32        earlyCoef[3];
182     f32       *preDelayLine[3];
183     u32        preDelayPos;
184     u32        preDelayLength;
185     u32        preDelayMaxLength;
186     f32       *combLine[3][3];
187     u32        combPos[3];
188     u32        combLength[3];
189     u32        combMaxLength[3];
190     f32        combCoef[3];
191     f32       *allpassLine[3][2];
192     u32        allpassPos[2];
193     u32        allpassLength[2];
194     u32        allpassMaxLength[2];
195     f32       *lastAllpassLine[3];
196     u32        lastAllpassPos[3];
197     u32        lastAllpassLength[3];
198     u32        lastAllpassMaxLength[3];
199     f32        allpassCoef;
200     f32        lastLpfOut[3];
201     f32        lpfCoef;
202     u32        active;
203 
204     // user params
205     u32        earlyMode;        // early reflection mode
206     f32        preDelayTimeMax;  // max of pre-delay time of fused reverb (sec)
207     f32        preDelayTime;     // pre-delay time of fused reverb (sec)
208     u32        fusedMode;        // fused reverb mode
209     f32        fusedTime;        // fused reverb time (sec)
210     f32        coloration;       // coloration of all-pass filter (0.f - 1.f)
211     f32        damping;          // damping of timbre  (0.f - 1.f)
212     f32        crosstalk;        // crosstalk of each channels
213     f32        earlyGain;        // output gain of early reflection (0.f - 1.f)
214     f32        fusedGain;        // output gain of fused reverb (0.f - 1.f)
215 
216     AXFX_BUS  *busIn;
217     AXFX_BUS  *busOut;
218     f32        outGain;
219     f32        sendGain;
220 
221 } AXFX_REVERBHI_EXP;
222 
223 
224 s32  AXFXReverbHiExpGetMemSize     (AXFX_REVERBHI_EXP *reverb);
225 BOOL AXFXReverbHiExpInit           (AXFX_REVERBHI_EXP *reverb);
226 void AXFXReverbHiExpShutdown       (AXFX_REVERBHI_EXP *reverb);
227 BOOL AXFXReverbHiExpSettings       (AXFX_REVERBHI_EXP *reverb);
228 BOOL AXFXReverbHiExpSettingsUpdate (AXFX_REVERBHI_EXP *reverb);
229 void AXFXReverbHiExpCallback       (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_REVERBHI_EXP *reverb);
230 
231 
232 /*----------------------------------------------*
233     for Dolby prologic2
234  *----------------------------------------------*/
235 
236 typedef struct AXFX_REVERBHI_EXP_DPL2
237 {
238     // do not touch these!
239     f32       *earlyLine[4];
240     u32        earlyPos[3];
241     u32        earlyLength;
242     u32        earlyMaxLength;
243     f32        earlyCoef[3];
244     f32       *preDelayLine[4];
245     u32        preDelayPos;
246     u32        preDelayLength;
247     u32        preDelayMaxLength;
248     f32       *combLine[4][3];
249     u32        combPos[3];
250     u32        combLength[3];
251     u32        combMaxLength[3];
252     f32        combCoef[3];
253     f32       *allpassLine[4][2];
254     u32        allpassPos[2];
255     u32        allpassLength[2];
256     u32        allpassMaxLength[2];
257     f32       *lastAllpassLine[4];
258     u32        lastAllpassPos[4];
259     u32        lastAllpassLength[4];
260     u32        lastAllpassMaxLength[4];
261     f32        allpassCoef;
262     f32        lastLpfOut[4];
263     f32        lpfCoef;
264     u32        active;
265 
266     // user params
267     u32        earlyMode;      // early reflection mode
268     f32        preDelayTimeMax;// pre-delay max time of fused reverb (sec)
269     f32        preDelayTime;   // pre-delay time of fused reverb (sec)
270     u32        fusedMode;      // fused reverb mode
271     f32        fusedTime;      // fused reverb time (sec)
272     f32        coloration;     // coloration of all-pass filter (0.f-1.f)
273     f32        damping;        // damping of timbre  (0.f-1.f)
274     f32        crosstalk;      // crosstalk of each channels
275     f32        earlyGain;      // output gain of early reflection(0.f-1.f)
276     f32        fusedGain;      // output gain of fused reverb (0.f-1.f)
277 
278     AXFX_BUS_DPL2 *busIn;
279     AXFX_BUS_DPL2 *busOut;
280     f32        outGain;
281     f32        sendGain;
282 
283 } AXFX_REVERBHI_EXP_DPL2;
284 
285 
286 s32  AXFXReverbHiExpGetMemSizeDpl2     (AXFX_REVERBHI_EXP_DPL2 *reverb);
287 BOOL AXFXReverbHiExpInitDpl2           (AXFX_REVERBHI_EXP_DPL2 *reverb);
288 void AXFXReverbHiExpShutdownDpl2       (AXFX_REVERBHI_EXP_DPL2 *reverb);
289 BOOL AXFXReverbHiExpSettingsDpl2       (AXFX_REVERBHI_EXP_DPL2 *reverb);
290 BOOL AXFXReverbHiExpSettingsUpdateDpl2 (AXFX_REVERBHI_EXP_DPL2 *reverb);
291 void AXFXReverbHiExpCallbackDpl2       (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_REVERBHI_EXP_DPL2 *reverb);
292 
293 
294 /*==========================================================================*
295     classic version
296  *==========================================================================*/
297 
298 #define AXFX_REVHI_MIN_TIME                     0.0f
299 //#define AXFX_REVHI_MAX_TIME
300 
301 #define AXFX_REVHI_MIN_PREDELAY                 0.0f
302 //#define AXFX_REVHI_MAX_PREDELAY
303 
304 #define AXFX_REVHI_MIN_COLORATION               0.0f
305 #define AXFX_REVHI_MAX_COLORATION               1.0f
306 
307 #define AXFX_REVHI_MIN_DAMPING                  0.0f
308 #define AXFX_REVHI_MAX_DAMPING                  1.0f
309 
310 #define AXFX_REVHI_MIN_MIX                      0.0f
311 #define AXFX_REVHI_MAX_MIX                      1.0f
312 
313 #define AXFX_REVHI_MIN_CROSSTALK                0.0f
314 #define AXFX_REVHI_MAX_CROSSTALK                1.0f
315 
316 /*----------------------------------------------*
317     for mono, stereo, surround
318  *----------------------------------------------*/
319 
320 typedef struct AXFX_REVERBHI
321 {
322     // do not write to these
323     AXFX_REVERBHI_EXP  reverbInner;
324 
325     // user params
326     f32        coloration;
327     f32        mix;
328     f32        time;
329     f32        damping;
330     f32        preDelay;
331     f32        crosstalk;
332 
333 } AXFX_REVERBHI;
334 
335 
336 s32  AXFXReverbHiGetMemSize (AXFX_REVERBHI *reverb);
337 BOOL AXFXReverbHiInit       (AXFX_REVERBHI *reverb);
338 BOOL AXFXReverbHiShutdown   (AXFX_REVERBHI *reverb);
339 BOOL AXFXReverbHiSettings   (AXFX_REVERBHI *reverb);
340 void AXFXReverbHiCallback   (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_REVERBHI *reverb);
341 
342 
343 /*----------------------------------------------*
344     for Dolby prologic2
345  *----------------------------------------------*/
346 
347 typedef struct AXFX_REVERBHI_DPL2
348 {
349     // do not write to these
350     AXFX_REVERBHI_EXP_DPL2  reverbInner;
351 
352     // user params
353     f32        coloration;
354     f32        mix;
355     f32        time;
356     f32        damping;
357     f32        preDelay;
358     f32        crosstalk;
359 
360 } AXFX_REVERBHI_DPL2;
361 
362 
363 s32  AXFXReverbHiGetMemSizeDpl2 (AXFX_REVERBHI_DPL2 *reverb);
364 BOOL AXFXReverbHiInitDpl2       (AXFX_REVERBHI_DPL2 *reverb);
365 BOOL AXFXReverbHiShutdownDpl2   (AXFX_REVERBHI_DPL2 *reverb);
366 BOOL AXFXReverbHiSettingsDpl2   (AXFX_REVERBHI_DPL2 *reverb);
367 void AXFXReverbHiCallbackDpl2   (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_REVERBHI_DPL2 *reverb);
368 
369 
370 /*==========================================================================*
371   ==========================================================================
372 
373     Standard Reverb
374 
375   ==========================================================================
376  *==========================================================================*/
377 
378 /*==========================================================================*
379     expanded version
380  *==========================================================================*/
381 
382 // early reflection type
383 #define AXFX_REVERBSTD_EXP_EARLY_MODE_5MS           0
384 #define AXFX_REVERBSTD_EXP_EARLY_MODE_10MS          1
385 #define AXFX_REVERBSTD_EXP_EARLY_MODE_15MS          2
386 #define AXFX_REVERBSTD_EXP_EARLY_MODE_20MS          3
387 #define AXFX_REVERBSTD_EXP_EARLY_MODE_25MS          4
388 #define AXFX_REVERBSTD_EXP_EARLY_MODE_30MS          5
389 #define AXFX_REVERBSTD_EXP_EARLY_MODE_35MS          6
390 #define AXFX_REVERBSTD_EXP_EARLY_MODE_40MS          7
391 #define AXFX_REVERBSTD_EXP_EARLY_MODE_MAX           8
392 
393 // fused reverb type
394 #define AXFX_REVERBSTD_EXP_FUSED_MODE_OLD_AXFX      0
395 #define AXFX_REVERBSTD_EXP_FUSED_MODE_METAL_TANK    1
396 #define AXFX_REVERBSTD_EXP_FUSED_MODE_SMALL_ROOM    2
397 #define AXFX_REVERBSTD_EXP_FUSED_MODE_LARGE_ROOM    3
398 #define AXFX_REVERBSTD_EXP_FUSED_MODE_HALL          4
399 #define AXFX_REVERBSTD_EXP_FUSED_MODE_CAVERNOUS     5
400 #define AXFX_REVERBSTD_EXP_FUSED_MODE_LONGEST       6  // do not use this!
401 #define AXFX_REVERBSTD_EXP_FUSED_MODE_MAX           7
402 
403 
404 #define AXFX_REVSTD_EXP_MIN_PREDELAYTIMEMAX     0.0f
405 //#define AXFX_REVSTD_EXP_MAX_PREDELAYTIMEMAX
406 
407 #define AXFX_REVSTD_EXP_MIN_PREDELAYTIME        0.0f
408 //#define AXFX_REVSTD_EXP_MAX_PREDELAYTIME
409 
410 #define AXFX_REVSTD_EXP_MIN_FUSEDTIME           0.0f
411 //#define AXFX_REVSTD_EXP_MAX_FUSEDTIME
412 
413 #define AXFX_REVSTD_EXP_MIN_COLORATION          0.0f
414 #define AXFX_REVSTD_EXP_MAX_COLORATION          1.0f
415 
416 #define AXFX_REVSTD_EXP_MIN_DAMPING             0.0f
417 #define AXFX_REVSTD_EXP_MAX_DAMPING             1.0f
418 
419 #define AXFX_REVSTD_EXP_MIN_EARLYGAIN           0.0f
420 #define AXFX_REVSTD_EXP_MAX_EARLYGAIN           1.0f
421 
422 #define AXFX_REVSTD_EXP_MIN_FUSEDGAIN           0.0f
423 #define AXFX_REVSTD_EXP_MAX_FUSEDGAIN           1.0f
424 
425 #define AXFX_REVSTD_EXP_MIN_OUTGAIN             0.0f
426 #define AXFX_REVSTD_EXP_MAX_OUTGAIN             1.0f
427 
428 #define AXFX_REVSTD_EXP_MIN_SENDGAIN            0.0f
429 #define AXFX_REVSTD_EXP_MAX_SENDGAIN            1.0f
430 
431 /*----------------------------------------------*
432     for mono, stereo, surround
433  *----------------------------------------------*/
434 
435 typedef struct AXFX_REVERBSTD_EXP
436 {
437     // do not touch these!
438     f32       *earlyLine[3];
439     u32        earlyPos;
440     u32        earlyLength;
441     u32        earlyMaxLength;
442     f32        earlyCoef;
443     f32       *preDelayLine[3];
444     u32        preDelayPos;
445     u32        preDelayLength;
446     u32        preDelayMaxLength;
447     f32       *combLine[3][2];
448     u32        combPos[2];
449     u32        combLength[2];
450     u32        combMaxLength[2];
451     f32        combCoef[2];
452     f32       *allpassLine[3][2];
453     u32        allpassPos[2];
454     u32        allpassLength[2];
455     u32        allpassMaxLength[2];
456     f32        allpassCoef;
457     f32        lastLpfOut[3];
458     f32        lpfCoef;
459     u32        active;
460 
461     // user params
462     u32        earlyMode;        // early reflection mode
463     f32        preDelayTimeMax;  // pre-delay max time of fused reverb (sec)
464     f32        preDelayTime;     // pre-delay time of fused reverb (sec)
465     u32        fusedMode;        // fused reverb mode
466     f32        fusedTime;        // fused reverb time (sec)
467     f32        coloration;       // coloration of all-pass filter (0.f - 1.f)
468     f32        damping;          // damping of timbre  (0.f - 1.f)
469     f32        earlyGain;        // output gain of early reflection (0.f - 1.f)
470     f32        fusedGain;        // output gain of fused reverb (0.f - 1.f)
471 
472     AXFX_BUS  *busIn;
473     AXFX_BUS  *busOut;
474     f32        outGain;
475     f32        sendGain;
476 
477 } AXFX_REVERBSTD_EXP;
478 
479 
480 s32  AXFXReverbStdExpGetMemSize     (AXFX_REVERBSTD_EXP *reverb);
481 BOOL AXFXReverbStdExpInit           (AXFX_REVERBSTD_EXP *reverb);
482 void AXFXReverbStdExpShutdown       (AXFX_REVERBSTD_EXP *reverb);
483 BOOL AXFXReverbStdExpSettings       (AXFX_REVERBSTD_EXP *reverb);
484 BOOL AXFXReverbStdExpSettingsUpdate (AXFX_REVERBSTD_EXP *reverb);
485 void AXFXReverbStdExpCallback       (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_REVERBSTD_EXP *reverb);
486 
487 
488 /*----------------------------------------------*
489     for Dolby prologic2
490  *----------------------------------------------*/
491 
492 typedef struct AXFX_REVERBSTD_EXP_DPL2
493 {
494     // do not touch these!
495     f32       *earlyLine[4];
496     u32        earlyPos;
497     u32        earlyLength;
498     u32        earlyMaxLength;
499     f32        earlyCoef;
500     f32       *preDelayLine[4];
501     u32        preDelayPos;
502     u32        preDelayLength;
503     u32        preDelayMaxLength;
504     f32       *combLine[4][2];
505     u32        combPos[2];
506     u32        combLength[2];
507     u32        combMaxLength[2];
508     f32        combCoef[2];
509     f32       *allpassLine[4][2];
510     u32        allpassPos[2];
511     u32        allpassLength[2];
512     u32        allpassMaxLength[2];
513     f32        allpassCoef;
514     f32        lastLpfOut[4];
515     f32        lpfCoef;
516     u32        active;
517 
518     // user params
519     u32        earlyMode;      // early reflection mode
520     f32        preDelayTimeMax;// pre-delay max time of fused reverb(sec)
521     f32        preDelayTime;   // pre-delay time of fused reverb (sec)
522     u32        fusedMode;      // fused reverb mode
523     f32        fusedTime;      // fused reverb time (sec)
524     f32        coloration;     // coloration of all-pass filter (0.f-1.f)
525     f32        damping;        // damping of timbre  (0.f-1.f)
526     f32        earlyGain;      // output gain of early reflection(0.f-1.f)
527     f32        fusedGain;      // output gain of fused reverb (0.f-1.f)
528 
529     AXFX_BUS_DPL2 *busIn;
530     AXFX_BUS_DPL2 *busOut;
531     f32        outGain;
532     f32        sendGain;
533 
534 } AXFX_REVERBSTD_EXP_DPL2;
535 
536 
537 s32  AXFXReverbStdExpGetMemSizeDpl2     (AXFX_REVERBSTD_EXP_DPL2 *reverb);
538 BOOL AXFXReverbStdExpInitDpl2           (AXFX_REVERBSTD_EXP_DPL2 *reverb);
539 void AXFXReverbStdExpShutdownDpl2       (AXFX_REVERBSTD_EXP_DPL2 *reverb);
540 BOOL AXFXReverbStdExpSettingsDpl2       (AXFX_REVERBSTD_EXP_DPL2 *reverb);
541 BOOL AXFXReverbStdExpSettingsUpdateDpl2 (AXFX_REVERBSTD_EXP_DPL2 *reverb);
542 void AXFXReverbStdExpCallbackDpl2       (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_REVERBSTD_EXP_DPL2 *reverb);
543 
544 
545 /*==========================================================================*
546     classic version
547  *==========================================================================*/
548 
549 #define AXFX_REVSTD_MIN_TIME                    0.0f
550 //#define AXFX_REVSTD_MAX_TIME
551 
552 #define AXFX_REVSTD_MIN_PREDELAY                0.0f
553 //#define AXFX_REVSTD_MAX_PREDELAY
554 
555 #define AXFX_REVSTD_MIN_COLORATION              0.0f
556 #define AXFX_REVSTD_MAX_COLORATION              1.0f
557 
558 #define AXFX_REVSTD_MIN_DAMPING                 0.0f
559 #define AXFX_REVSTD_MAX_DAMPING                 1.0f
560 
561 #define AXFX_REVSTD_MIN_MIX                     0.0f
562 #define AXFX_REVSTD_MAX_MIX                     1.0f
563 
564 /*----------------------------------------------*
565     for mono, stereo, surround
566  *----------------------------------------------*/
567 
568 typedef struct AXFX_REVERBSTD
569 {
570     AXFX_REVERBSTD_EXP  reverbInner;
571 
572     // user params
573     f32    coloration;
574     f32    mix;
575     f32    time;
576     f32    damping;
577     f32    preDelay;
578 
579 } AXFX_REVERBSTD;
580 
581 
582 s32  AXFXReverbStdGetMemSize (AXFX_REVERBSTD *reverb);
583 BOOL AXFXReverbStdInit       (AXFX_REVERBSTD *reverb);
584 BOOL AXFXReverbStdShutdown   (AXFX_REVERBSTD *reverb);
585 BOOL AXFXReverbStdSettings   (AXFX_REVERBSTD *reverb);
586 void AXFXReverbStdCallback   (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_REVERBSTD *reverb);
587 
588 
589 /*----------------------------------------------*
590     for Dolby prologic2
591  *----------------------------------------------*/
592 
593 typedef struct AXFX_REVERBSTD_DPL2
594 {
595     AXFX_REVERBSTD_EXP_DPL2  reverbInner;
596 
597     // user params
598     f32        coloration;
599     f32        mix;
600     f32        time;
601     f32        damping;
602     f32        preDelay;
603 
604 } AXFX_REVERBSTD_DPL2;
605 
606 
607 s32  AXFXReverbStdGetMemSizeDpl2 (AXFX_REVERBSTD_DPL2 *reverb);
608 BOOL AXFXReverbStdInitDpl2       (AXFX_REVERBSTD_DPL2 *reverb);
609 BOOL AXFXReverbStdShutdownDpl2   (AXFX_REVERBSTD_DPL2 *reverb);
610 BOOL AXFXReverbStdSettingsDpl2   (AXFX_REVERBSTD_DPL2 *reverb);
611 void AXFXReverbStdCallbackDpl2   (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_REVERBSTD_DPL2 *reverb);
612 
613 
614 /*==========================================================================*
615   ==========================================================================
616 
617     Delay
618 
619   ==========================================================================
620  *==========================================================================*/
621 
622 /*==========================================================================*
623     expanded version
624  *==========================================================================*/
625 
626 #define AXFX_DELAY_EXP_MIN_MAXDELAY             0.04f // 0.0f < maxDelay
627 //#define AXFX_DELAY_EXP_MAX_MAXDELAY
628 
629 #define AXFX_DELAY_EXP_MIN_DELAY                0.04f
630 //#define AXFX_DELAY_EXP_MAX_DELAY
631 
632 #define AXFX_DELAY_EXP_MIN_FEEDBACK             0.0f
633 #define AXFX_DELAY_EXP_MAX_FEEDBACK             0.99f // feedback < 1.0f
634 
635 #define AXFX_DELAY_EXP_MIN_LPF                  0.0f
636 #define AXFX_DELAY_EXP_MAX_LPF                  1.0f
637 
638 #define AXFX_DELAY_EXP_MIN_OUTGAIN              0.0f
639 #define AXFX_DELAY_EXP_MAX_OUTGAIN              1.0f
640 
641 #define AXFX_DELAY_EXP_MIN_SENDGAIN             0.0f
642 #define AXFX_DELAY_EXP_MAX_SENDGAIN             1.0f
643 
644 /*----------------------------------------------*
645     for mono, stereo, surround
646  *----------------------------------------------*/
647 
648 typedef struct AXFX_DELAY_EXP
649 {
650     // do not touch these!
651     s32       *lineL;
652     s32       *lineR;
653     s32       *lineS;
654     u32        curPos;
655     u32        length;
656     u32        maxLength;
657     s32        feedbackGain;
658     s32        lastLpfOut[3];
659     s32        lpfCoef;
660     s32        outGainCalc;
661     s32        sendGainCalc;
662     u32        active;
663 
664     // user params
665     f32        maxDelay;  // max delay time (msec) (>0.f)
666     f32        delay;     // delay time (msec) (0.f< - <=maxDelay)
667     f32        feedback;  // feedback gain (0.f - <1.f)
668     f32        lpf;       // LPF param (0.f - 1.f) (cutoff : low - high)
669 
670     AXFX_BUS  *busIn;
671     AXFX_BUS  *busOut;
672     f32        outGain;
673     f32        sendGain;
674 
675 } AXFX_DELAY_EXP;
676 
677 
678 s32  AXFXDelayExpGetMemSize     (AXFX_DELAY_EXP *delay);
679 BOOL AXFXDelayExpInit           (AXFX_DELAY_EXP *delay);
680 void AXFXDelayExpShutdown       (AXFX_DELAY_EXP *delay);
681 BOOL AXFXDelayExpSettings       (AXFX_DELAY_EXP *delay);
682 BOOL AXFXDelayExpSettingsUpdate (AXFX_DELAY_EXP *delay);
683 void AXFXDelayExpCallback       (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_DELAY_EXP *delay);
684 
685 
686 /*----------------------------------------------*
687     for Dolby prologic2
688  *----------------------------------------------*/
689 
690 typedef struct AXFX_DELAY_EXP_DPL2
691 {
692     // do not touch these!
693     s32       *line[4];
694     u32        curPos;
695     u32        length;
696     u32        maxLength;
697     s32        feedbackGain;
698     s32        lastLpfOut[4];
699     s32        lpfCoef;
700     s32        outGainCalc;
701     s32        sendGainCalc;
702     u32        active;
703 
704     // user params
705     f32        maxDelay;  // max delay time (msec) (>0.f)
706     f32        delay;     // delay time (msec) (0.f< - <=maxDelay)
707     f32        feedback;  // feedback gain (0.f - <1.f)
708     f32        lpf;       // LPF param (0.f - 1.f) (cutoff : low - high)
709 
710     AXFX_BUS_DPL2 *busIn;
711     AXFX_BUS_DPL2 *busOut;
712     f32        outGain;
713     f32        sendGain;
714 
715 } AXFX_DELAY_EXP_DPL2;
716 
717 
718 s32  AXFXDelayExpGetMemSizeDpl2     (AXFX_DELAY_EXP_DPL2 *delay);
719 BOOL AXFXDelayExpInitDpl2           (AXFX_DELAY_EXP_DPL2 *delay);
720 void AXFXDelayExpShutdownDpl2       (AXFX_DELAY_EXP_DPL2 *delay);
721 BOOL AXFXDelayExpSettingsDpl2       (AXFX_DELAY_EXP_DPL2 *delay);
722 BOOL AXFXDelayExpSettingsUpdateDpl2 (AXFX_DELAY_EXP_DPL2 *delay);
723 void AXFXDelayExpCallbackDpl2       (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_DELAY_EXP_DPL2 *delay);
724 
725 
726 /*==========================================================================*
727     classic version
728  *==========================================================================*/
729 
730 #define AXFX_DELAY_MIN_DELAY                    1
731 //#define AXFX_DELAY_MAX_DELAY
732 
733 #define AXFX_DELAY_MIN_FEEDBACK                 0
734 #define AXFX_DELAY_MAX_FEEDBACK                99
735 
736 #define AXFX_DELAY_MIN_OUTPUT                   0
737 #define AXFX_DELAY_MAX_OUTPUT                 100
738 
739 /*----------------------------------------------*
740     for mono, stereo, surround
741  *----------------------------------------------*/
742 
743 typedef struct AXFX_DELAY
744 {
745     // do not touch these!
746     s32       *line[3];
747     u32        curPos[3];
748     u32        length[3];
749     s32        feedbackGain[3];
750     s32        outGain[3];
751     u32        active;
752 
753     // user params
754     u32        delay[3];       // Delay buffer length in ms per channel
755     u32        feedback[3];    // Feedback volume in % per channel
756     u32        output[3];      // Output volume in % per channel
757 
758 } AXFX_DELAY;
759 
760 
761 s32  AXFXDelayGetMemSize (AXFX_DELAY *delay);
762 BOOL AXFXDelayInit       (AXFX_DELAY *delay);
763 void AXFXDelayShutdown   (AXFX_DELAY *delay);
764 BOOL AXFXDelaySettings   (AXFX_DELAY *delay);
765 void AXFXDelayCallback   (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_DELAY *delay);
766 
767 
768 /*----------------------------------------------*
769     for Dolby prologic2
770  *----------------------------------------------*/
771 
772 typedef struct AXFX_DELAY_DPL2
773 {
774     // do not touch these!
775     s32       *line[4];
776     u32        curPos[4];
777     u32        length[4];
778     s32        feedbackGain[4];
779     s32        outGain[4];
780     u32        active;
781 
782     // user params
783     u32        delay[4];       // Delay buffer length in ms per channel
784     u32        feedback[4];    // Feedback volume in % per channel
785     u32        output[4];      // Output volume in % per channel
786 
787 } AXFX_DELAY_DPL2;
788 
789 
790 s32  AXFXDelayGetMemSizeDpl2 (AXFX_DELAY_DPL2 *delay);
791 BOOL AXFXDelayInitDpl2       (AXFX_DELAY_DPL2 *delay);
792 void AXFXDelayShutdownDpl2   (AXFX_DELAY_DPL2 *delay);
793 BOOL AXFXDelaySettingsDpl2   (AXFX_DELAY_DPL2 *delay);
794 void AXFXDelayCallbackDpl2   (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_DELAY_DPL2 *delay);
795 
796 
797 /*==========================================================================*
798   ==========================================================================
799 
800     Chorus
801 
802   ==========================================================================
803  *==========================================================================*/
804 
805 /*==========================================================================*
806     expanded version
807  *==========================================================================*/
808 
809 #define AXFX_CHORUS_EXP_MIN_DELAYTIME           0.1f
810 #define AXFX_CHORUS_EXP_MAX_DELAYTIME          50.0f
811 
812 #define AXFX_CHORUS_EXP_MIN_DEAPTH              0.0f
813 #define AXFX_CHORUS_EXP_MAX_DEAPTH              1.0f
814 
815 #define AXFX_CHORUS_EXP_MIN_RATE                0.1f
816 #define AXFX_CHORUS_EXP_MAX_RATE                2.0f
817 
818 #define AXFX_CHORUS_EXP_MIN_FEEDBACK            0.0f
819 #define AXFX_CHORUS_EXP_MAX_FEEDBACK            0.99f // feedback < 1.0f
820 
821 #define AXFX_CHORUS_EXP_MIN_OUTGAIN             0.0f
822 #define AXFX_CHORUS_EXP_MAX_OUTGAIN             1.0f
823 
824 #define AXFX_CHORUS_EXP_MIN_SENDGAIN            0.0f
825 #define AXFX_CHORUS_EXP_MAX_SENDGAIN            1.0f
826 
827 /*----------------------------------------------*
828     for mono, stereo, surround
829  *----------------------------------------------*/
830 
831 typedef struct AXFX_CHORUS_EXP_DELAY
832 {
833     f32       *line[3];
834     u32        inPos;
835     u32        outPos;
836     u32        lastPos;
837     u32        sizeFP;
838     u32        size;
839 
840 } AXFX_CHORUS_EXP_DELAY;
841 
842 
843 typedef struct AXFX_CHORUS_EXP_LFO
844 {
845     s32       *table;
846     s32        phaseAdd;
847     s32        stepSamp;
848     s32        depthSamp;
849     u32        phase;
850     u32        sign;
851     u32        lastNum;
852     s32        lastValue;
853     s32        grad;
854     s32        gradFactor;
855 
856 } AXFX_CHORUS_EXP_LFO;
857 
858 
859 typedef struct AXFX_CHORUS_EXP
860 {
861     // don't touch these
862     AXFX_CHORUS_EXP_DELAY  delay;
863     AXFX_CHORUS_EXP_LFO    lfo;
864     f32        history[3][4];
865     u32        histIndex;
866     u32        active;
867 
868     // user params
869     f32        delayTime;   // 0.1 - 50.f (msec)
870     f32        depth;       // 0.f - 1.f
871     f32        rate;        // 0.1 - 2.f (Hz)
872     f32        feedback;    // 0.f - < 1.f
873 
874     AXFX_BUS  *busIn;
875     AXFX_BUS  *busOut;
876     f32        outGain;
877     f32        sendGain;
878 
879 } AXFX_CHORUS_EXP;
880 
881 
882 s32  AXFXChorusExpGetMemSize     (AXFX_CHORUS_EXP *chorus);
883 BOOL AXFXChorusExpInit           (AXFX_CHORUS_EXP *chorus);
884 BOOL AXFXChorusExpSettings       (AXFX_CHORUS_EXP *chorus);
885 BOOL AXFXChorusExpSettingsUpdate (AXFX_CHORUS_EXP *chorus);
886 void AXFXChorusExpShutdown       (AXFX_CHORUS_EXP *chorus);
887 void AXFXChorusExpCallback       (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_CHORUS_EXP *chorus);
888 
889 
890 /*----------------------------------------------*
891     for Dolby prologic2
892  *----------------------------------------------*/
893 
894 typedef struct AXFX_CHORUS_EXP_DELAY_DPL2
895 {
896     f32       *line[4];
897     u32        inPos;
898     u32        outPos;
899     u32        lastPos;
900     u32        sizeFP;
901     u32        size;
902 
903 } AXFX_CHORUS_EXP_DELAY_DPL2;
904 
905 
906 typedef struct AXFX_CHORUS_EXP_LFO_DPL2
907 {
908     s32       *table;
909     s32        phaseAdd;
910     s32        stepSamp;
911     s32        depthSamp;
912     u32        phase;
913     u32        sign;
914     u32        lastNum;
915     s32        lastValue;
916     s32        grad;
917     s32        gradFactor;
918 
919 } AXFX_CHORUS_EXP_LFO_DPL2;
920 
921 
922 typedef struct AXFX_CHORUS_EXP_DPL2
923 {
924     // don't touch these
925     AXFX_CHORUS_EXP_DELAY_DPL2  delay;
926     AXFX_CHORUS_EXP_LFO_DPL2    lfo;
927     f32        history[4][4];
928     u32        histIndex;
929     u32        active;
930 
931     // user params
932     f32        delayTime;   // 0.1 - 50.f (msec)
933     f32        depth;       // 0.f - 1.f
934     f32        rate;        // 0.1f - 2.f (Hz)
935     f32        feedback;    // 0.f - < 1.f
936 
937     AXFX_BUS_DPL2 *busIn;
938     AXFX_BUS_DPL2 *busOut;
939     f32        outGain;
940     f32        sendGain;
941 
942 } AXFX_CHORUS_EXP_DPL2;
943 
944 
945 s32  AXFXChorusExpGetMemSizeDpl2     (AXFX_CHORUS_EXP_DPL2 *chorus);
946 BOOL AXFXChorusExpInitDpl2           (AXFX_CHORUS_EXP_DPL2 *chorus);
947 BOOL AXFXChorusExpSettingsDpl2       (AXFX_CHORUS_EXP_DPL2 *chorus);
948 BOOL AXFXChorusExpSettingsUpdateDpl2 (AXFX_CHORUS_EXP_DPL2 *chorus);
949 void AXFXChorusExpShutdownDpl2       (AXFX_CHORUS_EXP_DPL2 *chorus);
950 void AXFXChorusExpCallbackDpl2       (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_CHORUS_EXP_DPL2 *chorus);
951 
952 
953 /*==========================================================================*
954     classic version
955  *==========================================================================*/
956 
957 #define AXFX_CHORUS_MIN_DELAY                   1
958 #define AXFX_CHORUS_MAX_DELAY                  50
959 
960 #define AXFX_CHORUS_MIN_VARIATION               0
961 #define AXFX_CHORUS_MAX_VARIATION              50
962 
963 #define AXFX_CHORUS_MIN_PERIOD                500
964 #define AXFX_CHORUS_MAX_PERIOD              10000
965 
966 /*----------------------------------------------*
967     for mono, stereo, surround
968  *----------------------------------------------*/
969 
970 typedef struct AXFX_CHORUS
971 {
972     AXFX_CHORUS_EXP  chorusInner;
973 
974     // user params
975     u32        baseDelay;      // Base delay of chorus effect in ms
976     u32        variation;      // Variation of base delay in ms
977     u32        period;         // Period of variational oscillation in ms
978 
979 } AXFX_CHORUS;
980 
981 
982 s32  AXFXChorusGetMemSize (AXFX_CHORUS *chorus);
983 BOOL AXFXChorusInit       (AXFX_CHORUS *chorus);
984 BOOL AXFXChorusShutdown   (AXFX_CHORUS *chorus);
985 BOOL AXFXChorusSettings   (AXFX_CHORUS *chorus);
986 void AXFXChorusCallback   (AXFX_BUFFERUPDATE *bufferUpdate, AXFX_CHORUS *chorus);
987 
988 /*----------------------------------------------*
989     for Dolby prologic2
990  *----------------------------------------------*/
991 
992 typedef struct AXFX_CHORUS_DPL2
993 {
994     AXFX_CHORUS_EXP_DPL2  chorusInner;
995 
996     // user params
997     u32        baseDelay;      // Base delay of chorus effect in ms
998     u32        variation;      // Variation of base delay in ms
999     u32        period;         // Period of variational oscillation in ms
1000 
1001 } AXFX_CHORUS_DPL2;
1002 
1003 
1004 s32  AXFXChorusGetMemSizeDpl2 (AXFX_CHORUS_DPL2 *chorus);
1005 BOOL AXFXChorusInitDpl2       (AXFX_CHORUS_DPL2 *chorus);
1006 BOOL AXFXChorusShutdownDpl2   (AXFX_CHORUS_DPL2 *chorus);
1007 BOOL AXFXChorusSettingsDpl2   (AXFX_CHORUS_DPL2 *chorus);
1008 void AXFXChorusCallbackDpl2   (AXFX_BUFFERUPDATE_DPL2 *bufferUpdate, AXFX_CHORUS_DPL2 *chorus);
1009 
1010 
1011 
1012 /*--------------------------------------------------------------------------*
1013 
1014    Sound 1 and 2 common declarations for two, four, and six channel (5.1
1015    Surround Sound) effects.
1016 
1017  *--------------------------------------------------------------------------*/
1018 
1019 #define AXFX_MULTI_CH_MAX_CHANNELS 6
1020 
1021 typedef enum _AXFX_SAMPLE_RATE
1022 {
1023     AXFX_SAMPLE_RATE_INVALID=0,
1024     AXFX_SAMPLE_RATE_32000,
1025     AXFX_SAMPLE_RATE_48000,
1026     AXFX_SAMPLE_RATE_COUNT=AXFX_SAMPLE_RATE_48000
1027 } AXFX_SAMPLE_RATE;
1028 
1029 /* Left, Right, LeftSurround, RightSurround, Center, and Subwoofer
1030    Each an array of AXFX_AUX_BLOCKSIZE=96 or 144 samples */
1031 typedef struct _AXFX_6CH_BUFFERUPDATE
1032 {
1033     s32 *L;
1034     s32 *R;
1035     s32 *Ls;
1036     s32 *Rs;
1037     s32 *Ct;
1038     s32 *Sw;
1039 } AXFX_6CH_BUFFERUPDATE;
1040 
1041 // Reverb presets
1042 typedef enum _REVERB_CONFIGURATION_TYPE
1043 {
1044     REVERB_CONFIGURATION_SMALL_ROOM=1,
1045     REVERB_CONFIGURATION_LARGE_ROOM,
1046     REVERB_CONFIGURATION_HALL,
1047     REVERB_CONFIGURATION_CAVERNOUS_CATHEDRAL,
1048     REVERB_CONFIGURATION_METAL_CORRIDOR
1049 } REVERB_CONFIGURATION_TYPE;
1050 
1051 typedef enum _AXFX_REVERB_MODE
1052 {
1053     AXFX_REVERB_MODE_INVALID=0,
1054     AXFX_REVERB_MODE_6CH_MONO_MIXED,
1055     AXFX_REVERB_MODE_2CH,
1056     AXFX_REVERB_MODE_4CH,
1057     AXFX_REVERB_MODE_6CH,
1058     AXFX_REVERB_MODE_2CH_MONO_MIXED,
1059     AXFX_REVERB_MODE_4CH_MONO_MIXED,
1060     AXFX_REVERB_MODE_COUNT=AXFX_REVERB_MODE_4CH_MONO_MIXED
1061 } AXFX_REVERB_MODE;
1062 
1063 typedef enum _AXFX_CHORUS_MODE
1064 {
1065     AXFX_CHORUS_MODE_INVALID=0,
1066     AXFX_CHORUS_MODE_2CH,
1067     AXFX_CHORUS_MODE_4CH,
1068     AXFX_CHORUS_MODE_6CH,
1069     AXFX_CHORUS_MODE_2CH_2,
1070     AXFX_CHORUS_MODE_4CH_2,
1071     AXFX_CHORUS_MODE_6CH_2,
1072     AXFX_CHORUS_MODE_COUNT=AXFX_CHORUS_MODE_6CH
1073 } AXFX_CHORUS_MODE;
1074 
1075 typedef enum _AXFX_DELAY_MODE
1076 {
1077     AXFX_DELAY_MODE_INVALID=0,
1078     AXFX_DELAY_MODE_2CH,
1079     AXFX_DELAY_MODE_4CH,
1080     AXFX_DELAY_MODE_6CH,
1081     AXFX_DELAY_MODE_COUNT=AXFX_DELAY_MODE_6CH
1082 } AXFX_DELAY_MODE;
1083 
1084 typedef enum AXFX_FLANGER_MODE
1085 {
1086     AXFX_FLANGER_MODE_INVALID = 0,
1087     AXFX_FLANGER_MODE_2CH,
1088     AXFX_FLANGER_MODE_4CH,
1089     AXFX_FLANGER_MODE_6CH,
1090     AXFX_FLANGER_MODE_COUNT = AXFX_FLANGER_MODE_6CH
1091 } AXFX_FLANGER_MODE;
1092 
1093 typedef enum AXFX_PHASER_MODE
1094 {
1095     AXFX_PHASER_MODE_INVALID = 0,
1096     AXFX_PHASER_MODE_2CH,
1097     AXFX_PHASER_MODE_4CH,
1098     AXFX_PHASER_MODE_6CH,
1099     AXFX_PHASER_MODE_COUNT = AXFX_PHASER_MODE_6CH
1100 } AXFX_PHASER_MODE;
1101 
1102 typedef enum AXFX_OVERDRIVE_MODE
1103 {
1104     AXFX_OVERDRIVE_MODE_INVALID = 0,
1105     AXFX_OVERDRIVE_MODE_2CH,
1106     AXFX_OVERDRIVE_MODE_4CH,
1107     AXFX_OVERDRIVE_MODE_6CH,
1108     AXFX_OVERDRIVE_MODE_COUNT = AXFX_OVERDRIVE_MODE_6CH
1109 } AXFX_OVERDRIVE_MODE;
1110 
1111 typedef enum AXFX_COMPRESSOR_MODE
1112 {
1113     AXFX_COMPRESSOR_MODE_INVALID = 0,
1114     AXFX_COMPRESSOR_MODE_2CH,
1115     AXFX_COMPRESSOR_MODE_4CH,
1116     AXFX_COMPRESSOR_MODE_6CH,
1117     AXFX_COMPRESSOR_MODE_COUNT = AXFX_COMPRESSOR_MODE_6CH
1118 } AXFX_COMPRESSOR_MODE;
1119 
1120 typedef enum AXFX_PITCHSHIFT_MODE
1121 {
1122     AXFX_PITCHSHIFT_MODE_INVALID = 0,
1123     AXFX_PITCHSHIFT_MODE_2CH,
1124     AXFX_PITCHSHIFT_MODE_4CH,
1125     AXFX_PITCHSHIFT_MODE_6CH,
1126     AXFX_PITCHSHIFT_MODE_COUNT = AXFX_PITCHSHIFT_MODE_6CH
1127 } AXFX_PITCHSHIFT_MODE;
1128 
1129 
1130 
1131 /*---------------------------------------------------------------------------*
1132    Sound 1 multi-channel delay line library declarations used by reverb, chorus,
1133    and delay effects
1134  *---------------------------------------------------------------------------*/
1135 typedef enum _AXFX_DELAY_TYPE
1136 {
1137     AXFX_DELAY_TYPE_NONE=0,
1138     AXFX_DELAY_TYPE_DELAY,
1139     AXFX_DELAY_TYPE_ALLPASS
1140 } AXFX_DELAY_TYPE;
1141 
1142 typedef struct _AXFX_DELAY_LINE {
1143     AXFX_DELAY_TYPE type;
1144     s32             size;   // Buffer length in samples.  Must be 1 more than maximum delay size.
1145     f32             *buff;
1146     s32             delay;  // Delay sample size.  Maximum value can't be larger than size-1.
1147     s32             in;
1148     s32             out;
1149     f32             coef;   // Required for all pass.
1150 } AXFX_DELAY_LINE;
1151 
1152 typedef struct _AXFX_PS_DELAY_LINE {
1153     AXFX_DELAY_TYPE type;
1154     s32             size;   // Buffer length in samples.  Must be 1 more than maximum delay size.
1155     f32x2           *buff;
1156     s32             delay;  // Delay sample size.  Maximum value must be size-1.
1157     s32             in;     // Internal pointer.
1158     s32             out;    // Internal pointer.
1159     f32x2           coef;   // Required for all pass.
1160 } AXFX_PS_DELAY_LINE;
1161 
1162 
1163 
1164 /*---------------------------------------------------------------------------*
1165    Sound 1 multi-channel reverb effect
1166  *---------------------------------------------------------------------------*/
1167 #define AXFX_NUM_FDN           4
1168 #define AXFX_NUM_ER_TAPS       10
1169 
1170 typedef struct _AXFX_MULTI_CH_REVERB {
1171     // User configurable parameters
1172     u32 early_mode;          // presets 0 to 4 for early reflections
1173     u32 late_mode;           // presets 0 to 4 for late reverb
1174     f32 predelay_time;       // msec 0 to 100
1175     f32 decay_time;          // sec 0.1 to 20.0
1176     f32 hf_decay_ratio;      // 0.1 to 1.0
1177     f32 coloration;          // 0.0 to 1.0
1178     f32 early_gain;          // 0.0 to 1.0
1179     f32 late_gain;           // 0.0 to 1.0
1180     f32 reverb_gain;         // 0.0 to 1.0
1181 
1182     // DO NOT TOUCH THESE!
1183     // These are set once to configure the specific reverb algorithm.
1184     AXFX_REVERB_MODE mode;
1185     u32 fs;
1186     // Derived parameters and objects
1187     f32 early_level;
1188     f32 late_level;
1189     f32 reverb_level;
1190     // early reflections
1191     AXFX_DELAY_LINE   early_delay[AXFX_MULTI_CH_MAX_CHANNELS]; // Not all filters use 6 delay lines
1192     u32               early_tap[AXFX_NUM_ER_TAPS];
1193     f32               early_coef[AXFX_NUM_ER_TAPS];
1194     // late reverb
1195     u32          late_tap;
1196     f32          cos_w_hf;
1197     f32          ap_coef;
1198     AXFX_DELAY_LINE center_delay;
1199     AXFX_DELAY_LINE      fdn_delay[AXFX_NUM_FDN];
1200     AXFX_DELAY_LINE      ap[AXFX_NUM_FDN];
1201     f32        fdn_fb[AXFX_NUM_FDN];       // feedback coefficients
1202     f32        fdn_lp_coef[AXFX_NUM_FDN];  // low-pass filter coefficients
1203     f32        fdn_lp_z[AXFX_NUM_FDN];
1204 } AXFX_MULTI_CH_REVERB;
1205 
1206 s32  AXFXMultiChReverbGetMemSize            (AXFX_MULTI_CH_REVERB *reverb);
1207 BOOL AXFXMultiChReverbInit                  (AXFX_MULTI_CH_REVERB *reverb, AXFX_REVERB_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1208 void AXFXMultiChReverbShutdown              (AXFX_MULTI_CH_REVERB *reverb);
1209 BOOL AXFXMultiChReverbParametersPreset      (AXFX_MULTI_CH_REVERB *reverb, REVERB_CONFIGURATION_TYPE preset);
1210 BOOL AXFXMultiChReverbSettingsUpdate        (AXFX_MULTI_CH_REVERB *reverb);
1211 BOOL AXFXMultiChReverbSettingsUpdateNoReset (AXFX_MULTI_CH_REVERB *reverb);
1212 void AXFXMultiChReverbCallback              (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_REVERB *reverb, AXAUXCBSTRUCT *info);
1213 
1214 
1215 
1216 /*---------------------------------------------------------------------------*
1217    Sound 1 multi-channel delay effect
1218  *---------------------------------------------------------------------------*/
1219 typedef struct _AXFX_MULTI_CH_DELAY {
1220     // User configurable parameters
1221     f32 delay_time;        // 0 to 2000.0
1222     f32 feedback;          // 0.1 to 1.0
1223     f32 low_pass_amount;   // 0.1 to 1.0
1224     f32 channel_spread;    // 0.1 to 1.0
1225     f32 out_gain;          // 0.1 to 1.0
1226     // DO NOT TOUCH THESE!
1227     // Derived parameters and objects
1228     AXFX_DELAY_MODE mode;
1229     u32 fs;
1230     AXFX_PS_DELAY_LINE psdelay[AXFX_MULTI_CH_MAX_CHANNELS/2]; // Paired singles operate on two f32's at a time
1231     f32 fb;
1232     f32 fb_direct;
1233     f32 fb_cross;
1234     f32 lpf_b0;
1235     f32 lpf_a1;
1236     f32x2 pslpf_z[AXFX_MULTI_CH_MAX_CHANNELS/2];
1237     f32 gain;
1238     f32 max_delay;
1239 } AXFX_MULTI_CH_DELAY;
1240 
1241 s32  AXFXMultiChDelayGetMemSize     (AXFX_MULTI_CH_DELAY *delay);
1242 BOOL AXFXMultiChDelayInit           (AXFX_MULTI_CH_DELAY *delay, AXFX_DELAY_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1243 void AXFXMultiChDelayShutdown       (AXFX_MULTI_CH_DELAY *delay);
1244 BOOL AXFXMultiChDelaySettingsUpdate (AXFX_MULTI_CH_DELAY *delay);
1245 BOOL AXFXMultiChDelaySettingsUpdateNoReset (AXFX_MULTI_CH_DELAY *delay);
1246 void AXFXMultiChDelayCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_DELAY *delay, AXAUXCBSTRUCT *info);
1247 
1248 
1249 
1250 /*---------------------------------------------------------------------------*
1251    Sound 1 multi-channel chorus effect
1252 
1253    Includes support for the previous algorithm as well as an
1254    updated optimized algorithm
1255  *---------------------------------------------------------------------------*/
1256 #define AXFX_CHORUS_HIST_SIZE 4
1257 
1258 typedef struct AXFX_6CH_CHORUS_DELAY
1259 {
1260     f32       *line[AXFX_MULTI_CH_MAX_CHANNELS];
1261     u32        inPos;
1262     u32        outPos;
1263     u32        lastPos;
1264     u32        sizeFP;
1265     u32        size;
1266 } AXFX_6CH_CHORUS_DELAY;
1267 
1268 typedef struct AXFX_6CH_CHORUS_LFO
1269 {
1270     s32       *table;
1271     s32        phaseAdd;
1272     s32        stepSamp;
1273     s32        depthSamp;
1274     u32        phase;
1275     u32        sign;
1276     u32        lastNum;
1277     s32        lastValue;
1278     s32        grad;
1279     s32        gradFactor;
1280 
1281 } AXFX_6CH_CHORUS_LFO;
1282 
1283 typedef struct AXFX_MULTI_CH_CHORUS
1284 {
1285     // don't touch these
1286     AXFX_CHORUS_MODE mode;
1287     u32 fs;
1288     AXFX_6CH_CHORUS_DELAY  delay;
1289     AXFX_6CH_CHORUS_LFO    lfo;
1290     f32        history[AXFX_MULTI_CH_MAX_CHANNELS][AXFX_CHORUS_HIST_SIZE];
1291     u32        histIndex;
1292     u32        active;
1293     // user params          // Original Chorus      Chorus_2
1294                             // -----------------    ------------------------
1295     f32        delayTime;   // 0.1 - 50.0 (msec)    same as original version
1296     f32        depth;       // 0.1 -  1.0           0.1 - 1.0
1297     f32        rate;        // 0.1 -  2.0 (Hz)      same as original version
1298     f32        feedback;    // 0.0 - <1.0           0.1 - 1.0
1299     AXFX_6CH_BUFFERUPDATE  *busIn;  //              unused
1300     AXFX_6CH_BUFFERUPDATE  *busOut; //              unused
1301     f32        outGain;     // 0.0 - 1.0            same as original version
1302     f32        sendGain;    // 0.0 - 1.0            unused
1303 } AXFX_MULTI_CH_CHORUS;
1304 
1305 s32  AXFXMultiChChorusGetMemSize     (AXFX_MULTI_CH_CHORUS *chorus);
1306 BOOL AXFXMultiChChorusInit           (AXFX_MULTI_CH_CHORUS *chorus, AXFX_CHORUS_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1307 void AXFXMultiChChorusShutdown       (AXFX_MULTI_CH_CHORUS *chorus);
1308 BOOL AXFXMultiChChorusSettings       (AXFX_MULTI_CH_CHORUS *chorus);
1309 BOOL AXFXMultiChChorusSettingsUpdate (AXFX_MULTI_CH_CHORUS *chorus);
1310 BOOL AXFXMultiChChorusSettingsUpdateNoReset (AXFX_MULTI_CH_CHORUS *chorus);
1311 void AXFXMultiChChorusCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_CHORUS *chorus, AXAUXCBSTRUCT *info);
1312 
1313 
1314 
1315 /*---------------------------------------------------------------------------*
1316   Deprecated 2/4/6 channel effects API.  Use above Multi Channel API instead
1317  *---------------------------------------------------------------------------*/
1318 s32  AXFX2chReverbGetMemSize       (AXFX_MULTI_CH_REVERB *reverb);
1319 BOOL AXFX2chReverbInit             (AXFX_MULTI_CH_REVERB *reverb);
1320 void AXFX2chReverbShutdown         (AXFX_MULTI_CH_REVERB *reverb);
1321 BOOL AXFX2chReverbParametersPreset (AXFX_MULTI_CH_REVERB *params, REVERB_CONFIGURATION_TYPE preset);
1322 BOOL AXFX2chReverbSettingsUpdate   (AXFX_MULTI_CH_REVERB *params);
1323 void AXFX2chReverbCallback         (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_REVERB *reverb);
1324 
1325 s32  AXFX4chReverbGetMemSize       (AXFX_MULTI_CH_REVERB *reverb);
1326 BOOL AXFX4chReverbInit             (AXFX_MULTI_CH_REVERB *reverb);
1327 void AXFX4chReverbShutdown         (AXFX_MULTI_CH_REVERB *reverb);
1328 BOOL AXFX4chReverbParametersPreset (AXFX_MULTI_CH_REVERB *params, REVERB_CONFIGURATION_TYPE preset);
1329 BOOL AXFX4chReverbSettingsUpdate   (AXFX_MULTI_CH_REVERB *params);
1330 void AXFX4chReverbCallback         (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_REVERB *reverb);
1331 
1332 s32  AXFX6chReverbGetMemSize       (AXFX_MULTI_CH_REVERB *reverb);
1333 BOOL AXFX6chReverbInit             (AXFX_MULTI_CH_REVERB *reverb);
1334 void AXFX6chReverbShutdown         (AXFX_MULTI_CH_REVERB *reverb);
1335 BOOL AXFX6chReverbParametersPreset (AXFX_MULTI_CH_REVERB *params, REVERB_CONFIGURATION_TYPE preset);
1336 BOOL AXFX6chReverbSettingsUpdate   (AXFX_MULTI_CH_REVERB *params);
1337 void AXFX6chReverbCallback         (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_REVERB *reverb);
1338 
1339 s32  AXFX6ch6chReverbGetMemSize       (AXFX_MULTI_CH_REVERB *reverb);
1340 BOOL AXFX6ch6chReverbInit             (AXFX_MULTI_CH_REVERB *reverb);
1341 void AXFX6ch6chReverbShutdown         (AXFX_MULTI_CH_REVERB *reverb);
1342 BOOL AXFX6ch6chReverbParametersPreset (AXFX_MULTI_CH_REVERB *params, REVERB_CONFIGURATION_TYPE preset);
1343 BOOL AXFX6ch6chReverbSettingsUpdate   (AXFX_MULTI_CH_REVERB *params);
1344 void AXFX6ch6chReverbCallback         (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_REVERB *reverb);
1345 
1346 
1347 s32  AXFX6chMultiDelayGetMemSize     (AXFX_MULTI_CH_DELAY *multi_delay);
1348 BOOL AXFX6chMultiDelayInit           (AXFX_MULTI_CH_DELAY *multi_delay);
1349 void AXFX6chMultiDelayShutdown       (AXFX_MULTI_CH_DELAY *multi_delay);
1350 BOOL AXFX6chMultiDelaySettingsUpdate (AXFX_MULTI_CH_DELAY *multi_delay);
1351 void AXFX6chMultiDelayCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_DELAY *multi_delay);
1352 
1353 s32  AXFX2chMultiDelayGetMemSize     (AXFX_MULTI_CH_DELAY *multi_delay);
1354 BOOL AXFX2chMultiDelayInit           (AXFX_MULTI_CH_DELAY *multi_delay);
1355 void AXFX2chMultiDelayShutdown       (AXFX_MULTI_CH_DELAY *multi_delay);
1356 BOOL AXFX2chMultiDelaySettingsUpdate (AXFX_MULTI_CH_DELAY *multi_delay);
1357 void AXFX2chMultiDelayCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_DELAY *multi_delay);
1358 
1359 s32  AXFX4chMultiDelayGetMemSize     (AXFX_MULTI_CH_DELAY *multi_delay);
1360 BOOL AXFX4chMultiDelayInit           (AXFX_MULTI_CH_DELAY *multi_delay);
1361 void AXFX4chMultiDelayShutdown       (AXFX_MULTI_CH_DELAY *multi_delay);
1362 BOOL AXFX4chMultiDelaySettingsUpdate (AXFX_MULTI_CH_DELAY *multi_delay);
1363 void AXFX4chMultiDelayCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_DELAY *multi_delay);
1364 
1365 
1366 s32  AXFX6chChorusGetMemSize     (AXFX_MULTI_CH_CHORUS *chorus);
1367 BOOL AXFX6chChorusInit           (AXFX_MULTI_CH_CHORUS *chorus);
1368 void AXFX6chChorusShutdown       (AXFX_MULTI_CH_CHORUS *chorus);
1369 BOOL AXFX6chChorusSettings       (AXFX_MULTI_CH_CHORUS *chorus);
1370 BOOL AXFX6chChorusSettingsUpdate (AXFX_MULTI_CH_CHORUS *chorus);
1371 void AXFX6chChorusCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_CHORUS *chorus);
1372 
1373 s32  AXFX2chChorusGetMemSize     (AXFX_MULTI_CH_CHORUS *chorus);
1374 BOOL AXFX2chChorusInit           (AXFX_MULTI_CH_CHORUS *chorus);
1375 void AXFX2chChorusShutdown       (AXFX_MULTI_CH_CHORUS *chorus);
1376 BOOL AXFX2chChorusSettings       (AXFX_MULTI_CH_CHORUS *chorus);
1377 BOOL AXFX2chChorusSettingsUpdate (AXFX_MULTI_CH_CHORUS *chorus);
1378 void AXFX2chChorusCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_CHORUS *chorus);
1379 
1380 s32  AXFX4chChorusGetMemSize     (AXFX_MULTI_CH_CHORUS *chorus);
1381 BOOL AXFX4chChorusInit           (AXFX_MULTI_CH_CHORUS *chorus);
1382 void AXFX4chChorusShutdown       (AXFX_MULTI_CH_CHORUS *chorus);
1383 BOOL AXFX4chChorusSettings       (AXFX_MULTI_CH_CHORUS *chorus);
1384 BOOL AXFX4chChorusSettingsUpdate (AXFX_MULTI_CH_CHORUS *chorus);
1385 void AXFX4chChorusCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX_MULTI_CH_CHORUS *chorus);
1386 
1387 
1388 BOOL AXFXReverbSettingsUpdate        (AXFX_MULTI_CH_REVERB *reverb);
1389 BOOL AXFXReverbSettingsUpdateNoReset (AXFX_MULTI_CH_REVERB *reverb);
1390 
1391 
1392 
1393 /*---------------------------------------------------------------------------*
1394    Sound 2 reverb effect
1395  *---------------------------------------------------------------------------*/
1396 typedef struct
1397 {
1398     // User params
1399     f32 reverb_gain;         // 0.0 to 1.0
1400     u32 early_mode;          // presets 0 to 4 for early reflections
1401     u32 late_mode;           // presets 0 to 4 for late reverb
1402     f32 predelay_time;       // msec 0 to 100
1403     f32 decay_time;          // sec 0.1 to 20.0
1404     f32 hf_decay_ratio;      // 0.1 to 1.0
1405     f32 coloration;          // 0.0 to 1.0
1406     f32 early_gain;          // 0.0 to 1.0
1407     f32 late_gain;           // 0.0 to 1.0
1408     f32 out_gain;            // 0.0 to 1.0
1409     f32 dry_gain;            // 0.0 to 1.0
1410     // Do not touch these!
1411     void *priv;  // Private runtime structure
1412     u32 pad[4];
1413 } AXFX2_REVERB;
1414 
1415 s32  AXFX2ReverbGetMemSize             (AXFX_REVERB_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1416 BOOL AXFX2ReverbInit                   (AXFX2_REVERB *reverb, AXFX_REVERB_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1417 void AXFX2ReverbShutdown               (AXFX2_REVERB *reverb);
1418 BOOL AXFX2ReverbParametersPreset       (AXFX2_REVERB *reverb, REVERB_CONFIGURATION_TYPE preset);
1419 BOOL AXFX2ReverbSettingsUpdate         (AXFX2_REVERB *reverb);
1420 BOOL AXFX2ReverbSettingsUpdateNoReset  (AXFX2_REVERB *reverb);
1421 void AXFX2ReverbCallback               (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_REVERB *reverb, AXAUXCBSTRUCT *info);
1422 
1423 
1424 
1425 /*---------------------------------------------------------------------------*
1426    Sound 2 reverb I3DL2
1427  *---------------------------------------------------------------------------*/
1428 typedef struct
1429 {
1430     // User params
1431     s32 room;                 // [-10000, 0], mB
1432     s32 room_hf;              // [-10000, 0], mB
1433     f32 decay_time;           // [0.1, 20.0], seconds
1434     f32 decay_hf_ratio;       // [0.1, 2.0], unitless ratio
1435     s32 reflections;          // [-10000, 0], mB
1436     f32 reflections_delay;    // [0.0, 0.3], seconds
1437     s32 reverb;               // [-10000, 20000], mB
1438     f32 reverb_delay;         // [0.0, 0.1], seconds
1439     f32 diffusion;            // [0.0, 100.0], percent
1440     f32 density;              // [0.0, 100.0], percent
1441     f32 hf_reference;         // [20.0, 20000.0], Hz
1442     f32 out_gain;             // [0.0, 1.0]
1443     f32 dry_gain;             // [0.0, 1.0]
1444     // Do not touch this!
1445     void *priv;  // Private runtime structure
1446     u32 pad[4];
1447 } AXFX2_REVERB_I3DL2;
1448 
1449 s32  AXFX2ReverbI3dl2GetMemSize                  (AXFX_REVERB_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1450 BOOL AXFX2ReverbI3dl2Init                        (AXFX2_REVERB_I3DL2 *reverb_i3dl2, AXFX_REVERB_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1451 void AXFX2ReverbI3dl2Shutdown                    (AXFX2_REVERB_I3DL2 *reverb_i3dl2);
1452 BOOL AXFX2ReverbI3dl2ParametersPreset            (AXFX2_REVERB_I3DL2 *reverb_i3dl2, REVERB_CONFIGURATION_TYPE preset);
1453 void AXFX2ReverbI3dl2ParametersMigrateFromReverb (AXFX2_REVERB_I3DL2 *reverb_i3dl2, AXFX2_REVERB *reverb);
1454 BOOL AXFX2ReverbI3dl2SettingsUpdate              (AXFX2_REVERB_I3DL2 *reverb_i3dl2);
1455 BOOL AXFX2ReverbI3dl2SettingsUpdateNoReset       (AXFX2_REVERB_I3DL2 *reverb_i3dl2);
1456 void AXFX2ReverbI3dl2Callback                    (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_REVERB_I3DL2 *reverb_i3dl2, AXAUXCBSTRUCT *info);
1457 
1458 
1459 /*---------------------------------------------------------------------------*
1460    Sound 2 multi-channel delay effect
1461  *---------------------------------------------------------------------------*/
1462 typedef struct
1463 {
1464     // User params
1465     f32 delay_time;        // 0.0 to max_delay_time
1466     f32 gain;              // 0.1 to 1.0
1467     f32 feedback;          // 0.1 to 1.0
1468     f32 low_pass_amount;   // 0.1 to 1.0
1469     f32 channel_spread;    // 0.1 to 1.0
1470     f32 out_gain;          // 0.0 to 1.0
1471     f32 dry_gain;          // 0.0 to 1.0
1472     void *priv;  // Private runtime structure
1473     f32 max_delay_time;    // Unbounded positive delay time in milliseconds
1474     u32 pad[3];
1475 } AXFX2_DELAY;
1476 
1477 s32  AXFX2DelayGetMemSize            (AXFX2_DELAY *delay, AXFX_DELAY_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1478 BOOL AXFX2DelayInit                  (AXFX2_DELAY *delay, AXFX_DELAY_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1479 void AXFX2DelayShutdown              (AXFX2_DELAY *delay);
1480 BOOL AXFX2DelaySettings              (AXFX2_DELAY *delay);
1481 BOOL AXFX2DelaySettingsUpdate        (AXFX2_DELAY *delay);
1482 BOOL AXFX2DelaySettingsUpdateNoReset (AXFX2_DELAY *delay);
1483 void AXFX2DelayCallback              (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_DELAY *delay, AXAUXCBSTRUCT *info);
1484 
1485 
1486 
1487 /*---------------------------------------------------------------------------*
1488     Sound 2 multi-channel chorus effect
1489  *---------------------------------------------------------------------------*/
1490 typedef struct
1491 {
1492     // User params
1493     f32 delay_time;          // 1.0 to 50 ms. The average delay.
1494     f32 mod_depth;           // 0.1 to 1.0.  How much delay is modulated
1495     f32 mod_rate;            // 0.1 to 2.0 Hz.  How fast the delay is modulated.
1496     f32 mod_spread;          // 0.0 to 1.0. Spreads the phase of the modulation between channels.
1497     f32 feedback;            // 0.1 to 1.0. How much of the delay output is fed back to the input.
1498     f32 out_gain;            // 0.0 to 1.0. The gain of the effect output.
1499     f32 dry_gain;            // 0.0 to 1.0. The gain of the dry signal.  Set to non-zero when no dry signal is being added in the mixer.
1500     // Do not touch these!
1501     void *priv;  // Private runtime structure
1502     u32 pad[4];
1503 } AXFX2_CHORUS;
1504 
1505 s32  AXFX2ChorusGetMemSize            (AXFX_CHORUS_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1506 BOOL AXFX2ChorusInit                  (AXFX2_CHORUS *chorus, AXFX_CHORUS_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1507 void AXFX2ChorusShutdown              (AXFX2_CHORUS *chorus);
1508 BOOL AXFX2ChorusSettingsUpdate        (AXFX2_CHORUS *chorus);
1509 BOOL AXFX2ChorusSettingsUpdateNoReset (AXFX2_CHORUS *chorus);
1510 void AXFX2ChorusCallback              (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_CHORUS *chorus, AXAUXCBSTRUCT *info);
1511 
1512 
1513 
1514 /*---------------------------------------------------------------------------*
1515    Sound 2 multi-channel flanger effect
1516  *---------------------------------------------------------------------------*/
1517 typedef struct
1518 {
1519     // User params
1520     f32 delay_time; //  0.1  to   7.0 ms
1521     f32 mod_depth;  //  0.1  to   1.0
1522     f32 mod_rate;   //  0.1  to  10.0 Hz
1523     f32 feedback;   // -1.0  to   1.0
1524     f32 feedforward;//  0.0  to   1.0
1525     f32 out_gain;   //  0.0  to   1.0
1526     f32 dry_gain;   //  0.0  to   1.0
1527     // Do not touch these!
1528     void *priv;  // Private runtime structure
1529     u32 pad[4];
1530 } AXFX2_FLANGER;
1531 
1532 s32  AXFX2FlangerGetMemSize            (AXFX_FLANGER_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1533 BOOL AXFX2FlangerInit                  (AXFX2_FLANGER *flanger, AXFX_FLANGER_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1534 void AXFX2FlangerShutdown              (AXFX2_FLANGER *flanger);
1535 BOOL AXFX2FlangerSettingsUpdate        (AXFX2_FLANGER *flanger);
1536 BOOL AXFX2FlangerSettingsUpdateNoReset (AXFX2_FLANGER *flanger);
1537 void AXFX2FlangerCallback              (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_FLANGER *flanger, AXAUXCBSTRUCT *info);
1538 
1539 
1540 
1541 /*---------------------------------------------------------------------------*
1542    This structure is currently unused in Sound 2
1543  *---------------------------------------------------------------------------*/
1544 typedef struct
1545 {
1546     // User params
1547     f32 notch_freq;     // 70.0  to  1000.0 Hz   The center frequency of the lowest notch or peak
1548     f32 notch_spread;   //  0.0  to     1.0      How far apart the three notches are
1549     f32 feedback;       //  0.0  to     1.0      Adding feedback increases the size of the notches or peak
1550     f32 mod_depth;      //  0.0  to     1.0      How much the LFO modulates the notch/peak frequencies
1551     f32 mod_rate;       //  0.1  to     5.0 Hz   How fast the notche/peak frequencies
1552     f32 mod_spread;     //  0.0  to     1.0      Spreads the phase of the modulation between channels
1553     u32 notch_or_peak;  // 0, 1                  When this is 0 the phaser has notches.  When this is 1 there are peaks instead.
1554     f32 out_gain;       //  0.0  to     2.0      The output level of the effect
1555     f32 dry_gain;       //  0.0  to     1.0      The level of the mixed input signal
1556     // Do not touch these!
1557     void *priv;  // Private runtime structure
1558     u32 pad[4];
1559 } AXFX2_PHASER;
1560 
1561 
1562 
1563 
1564 /*---------------------------------------------------------------------------*
1565    Sound 2 multi-channel overdrive effect
1566  *---------------------------------------------------------------------------*/
1567 typedef struct
1568 {
1569     // User params
1570     f32 drive;          // -30.0  to  30.0 dB  The gain applied to the input signal before the distortion
1571     u32 distortion_type;// 0, 1, 2             The type of distortion: 0=soft clip, 1=medium curve, 2=hard clip
1572     f32 out_gain;       // -30.0  to  10.0 dB  Gain applied after the distortion
1573     f32 tone;           //  -1.0  to   1.0     Negative values emphasize low frequencies. Positive values emphasize high frequencies.
1574     f32 dry_gain;       //   0.0  to   2.0     The level of the original dry signal mixed in to the output
1575     // Do not touch these!
1576     void *priv;  // Private runtime structure
1577     u32 pad[4];
1578 } AXFX2_OVERDRIVE;
1579 
1580 s32  AXFX2OverdriveGetMemSize     (AXFX_OVERDRIVE_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1581 BOOL AXFX2OverdriveInit           (AXFX2_OVERDRIVE *overdrive, AXFX_OVERDRIVE_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1582 BOOL AXFX2OverdriveSettingsUpdate (AXFX2_OVERDRIVE *overdrive);
1583 void AXFX2OverdriveShutdown       (AXFX2_OVERDRIVE *overdrive);
1584 void AXFX2OverdriveCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_OVERDRIVE *overdrive, AXAUXCBSTRUCT *info);
1585 
1586 
1587 
1588 /*---------------------------------------------------------------------------*
1589    Sound 2 multi-channel compressor effect
1590  *---------------------------------------------------------------------------*/
1591 typedef struct
1592 {
1593     // User params
1594     f32 threshold;       // -50.0  to     0.0 dB    The level the signal must reach to start being compressed
1595     f32 ratio;           //   1.0  to    30.0       The amount of compression that occurs once the signal exceeds the threshold. 1.0 == no compression
1596     f32 attack_time;     //   1.0  to  1000.0 msec  The time it takes the gain to adjust when the signal level increases
1597     f32 release_time;    //   1.0  to  5000.0 msec  The time it takes the gain to adjust when the signal level decreases
1598     u32 makeup_gain;     // 0, 1                    Whether the overall gain is boosted to compensate for the reduced maximum output level caused by compression.  0=off, 1=on
1599     f32 out_gain;        // -30.0  to    10.0 dB    Gain applied after the compressor. 0dB = gain of 1.0
1600     // Do not touch these!
1601     void *priv;  // Private runtime structure
1602     u32 pad[4];
1603 } AXFX2_COMPRESSOR;
1604 
1605 s32  AXFX2CompressorGetMemSize     (AXFX_COMPRESSOR_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1606 BOOL AXFX2CompressorInit           (AXFX2_COMPRESSOR *compressor, AXFX_COMPRESSOR_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1607 BOOL AXFX2CompressorSettingsUpdate (AXFX2_COMPRESSOR *compressor);
1608 void AXFX2CompressorShutdown       (AXFX2_COMPRESSOR *compressor);
1609 void AXFX2CompressorCallback       (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_COMPRESSOR *compressor, AXAUXCBSTRUCT *info);
1610 
1611 
1612 
1613 /*---------------------------------------------------------------------------*
1614    Sound 2 Pitchshift
1615  *---------------------------------------------------------------------------*/
1616 typedef struct
1617 {
1618     // User params
1619     f32 pitch_shift;   // -24.0 to +24.0. The amount of pitch shift in semitones
1620     f32 out_gain;      // 0.0 to 2.0. The gain of the effect output.
1621     f32 dry_gain;      // 0.0 to 2.0. The gain of the dry signal.
1622     // Do not touch these!
1623     void *priv;  // Private runtime structure
1624     u32 pad[4];
1625 } AXFX2_PITCHSHIFT;
1626 
1627 s32  AXFX2PitchshiftGetMemSize            (AXFX_PITCHSHIFT_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1628 BOOL AXFX2PitchshiftInit                  (AXFX2_PITCHSHIFT *pitchshift, AXFX_PITCHSHIFT_MODE mode, AXFX_SAMPLE_RATE sampleRate);
1629 BOOL AXFX2PitchshiftSettingsUpdate        (AXFX2_PITCHSHIFT *pitchshift);
1630 BOOL AXFX2PitchshiftSettingsUpdateNoReset (AXFX2_PITCHSHIFT *pitchshift);
1631 void AXFX2PitchshiftShutdown              (AXFX2_PITCHSHIFT *pitchshift);
1632 void AXFX2PitchshiftCallback              (AXFX_6CH_BUFFERUPDATE *bufferUpdate, AXFX2_PITCHSHIFT *pitchshift, AXAUXCBSTRUCT *info);
1633 
1634 
1635 
1636 #ifdef __cplusplus
1637 }
1638 #endif
1639 
1640 #endif // __AXFX_H__
1641