1 /* ========================================================================================== */
2 /* FMOD Ex - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.      */
3 /*                                                                                            */
4 /* Use this header if you are interested in delving deeper into the FMOD software mixing /    */
5 /* DSP engine.  In this header you can find parameter structures for FMOD system reigstered   */
6 /* DSP effects and generators.                                                                */
7 /* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's  */
8 /* dsp system.  With this header you can make your own DSP plugin that FMOD can               */
9 /* register and use.  See the documentation and examples on how to make a working plugin.     */
10 /*                                                                                            */
11 /* ========================================================================================== */
12 
13 #ifndef _FMOD_DSP_H
14 #define _FMOD_DSP_H
15 
16 typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
17 
18 /*
19     DSP callbacks
20 */
21 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_CREATECALLBACK)     (FMOD_DSP_STATE *dsp_state);
22 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RELEASECALLBACK)    (FMOD_DSP_STATE *dsp_state);
23 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RESETCALLBACK)      (FMOD_DSP_STATE *dsp_state);
24 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_READCALLBACK)       (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels);
25 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPOSITIONCALLBACK)(FMOD_DSP_STATE *dsp_state, unsigned int pos);
26 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAMCALLBACK)   (FMOD_DSP_STATE *dsp_state, int index, float value);
27 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAMCALLBACK)   (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
28 typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DIALOGCALLBACK)     (FMOD_DSP_STATE *dsp_state, void *hwnd, int show);
29 
30 /*
31 [ENUM]
32 [
33     [DESCRIPTION]
34     These definitions can be used for creating FMOD defined special effects or DSP units.
35 
36     [REMARKS]
37     To get them to be active, first create the unit, then add it somewhere into the DSP network, either at the front of the network near the soundcard unit to affect the global output (by using System::getDSPHead), or on a single channel (using Channel::getDSPHead).
38 
39     [PLATFORMS]
40     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
41 
42     [SEE_ALSO]
43     System::createDSPByType
44 ]
45 */
46 typedef enum
47 {
48     FMOD_DSP_TYPE_UNKNOWN,            /* This unit was created via a non FMOD plugin so has an unknown purpose. */
49     FMOD_DSP_TYPE_MIXER,              /* This unit does nothing but take inputs and mix them together then feed the result to the soundcard unit. */
50     FMOD_DSP_TYPE_OSCILLATOR,         /* This unit generates sine/square/saw/triangle or noise tones. */
51     FMOD_DSP_TYPE_LOWPASS,            /* This unit filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time. */
52     FMOD_DSP_TYPE_ITLOWPASS,          /* This unit filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker, but with limited cutoff range (0 to 8060hz). */
53     FMOD_DSP_TYPE_HIGHPASS,           /* This unit filters sound using a resonant highpass filter algorithm. */
54     FMOD_DSP_TYPE_ECHO,               /* This unit produces an echo on the sound and fades out at the desired rate. */
55     FMOD_DSP_TYPE_FLANGE,             /* This unit produces a flange effect on the sound. */
56     FMOD_DSP_TYPE_DISTORTION,         /* This unit distorts the sound. */
57     FMOD_DSP_TYPE_NORMALIZE,          /* This unit normalizes or amplifies the sound to a certain level. */
58     FMOD_DSP_TYPE_PARAMEQ,            /* This unit attenuates or amplifies a selected frequency range. */
59     FMOD_DSP_TYPE_PITCHSHIFT,         /* This unit bends the pitch of a sound without changing the speed of playback. */
60     FMOD_DSP_TYPE_CHORUS,             /* This unit produces a chorus effect on the sound. */
61     FMOD_DSP_TYPE_VSTPLUGIN,          /* This unit allows the use of Steinberg VST plugins */
62     FMOD_DSP_TYPE_WINAMPPLUGIN,       /* This unit allows the use of Nullsoft Winamp plugins */
63     FMOD_DSP_TYPE_ITECHO,             /* This unit produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker. */
64     FMOD_DSP_TYPE_COMPRESSOR,         /* This unit implements dynamic compression (linked multichannel, wideband) */
65     FMOD_DSP_TYPE_SFXREVERB,          /* This unit implements SFX reverb */
66     FMOD_DSP_TYPE_LOWPASS_SIMPLE,     /* This unit filters sound using a simple lowpass with no resonance, but has flexible cutoff and is fast. */
67     FMOD_DSP_TYPE_DELAY,              /* This unit produces different delays on individual channels of the sound. */
68     FMOD_DSP_TYPE_TREMOLO,            /* This unit produces a tremolo / chopper effect on the sound. */
69     FMOD_DSP_TYPE_LADSPAPLUGIN,       /* This unit allows the use of LADSPA standard plugins. */
70     FMOD_DSP_TYPE_HIGHPASS_SIMPLE,    /* This unit filters sound using a simple highpass with no resonance, but has flexible cutoff and is fast. */
71     FMOD_DSP_TYPE_HARDWARE = 1000,    /* Offset that platform specific FMOD_HARDWARE DSPs will start at. */
72     FMOD_DSP_TYPE_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */
73 } FMOD_DSP_TYPE;
74 
75 
76 /*
77 [STRUCTURE]
78 [
79     [DESCRIPTION]
80     Structure to define a parameter for a DSP unit.
81 
82     [REMARKS]
83     Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.
84     Members marked with [w] mean the variable can be written to.  The user can set the value.
85 
86     [PLATFORMS]
87     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
88 
89     [SEE_ALSO]
90     System::createDSP
91     DSP::setParameter
92 ]
93 */
94 typedef struct FMOD_DSP_PARAMETERDESC
95 {
96     float       min;                                /* [w] Minimum value of the parameter (ie 100.0). */
97     float       max;                                /* [w] Maximum value of the parameter (ie 22050.0). */
98     float       defaultval;                         /* [w] Default value of parameter. */
99     char        name[16];                           /* [w] Name of the parameter to be displayed (ie "Cutoff frequency"). */
100     char        label[16];                          /* [w] Short string to be put next to value to denote the unit type (ie "hz"). */
101     const char *description;                        /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */
102 } FMOD_DSP_PARAMETERDESC;
103 
104 
105 /*
106 [STRUCTURE]
107 [
108     [DESCRIPTION]
109     When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.
110 
111     [REMARKS]
112     Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.
113     Members marked with [w] mean the variable can be written to.  The user can set the value.
114 
115     There are 2 different ways to change a parameter in this architecture.
116     One is to use DSP::setParameter / DSP::getParameter.  This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.
117     The other is to use DSP::showConfigDialog.  This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.
118 
119     [PLATFORMS]
120     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
121 
122     [SEE_ALSO]
123     System::createDSP
124     FMOD_DSP_STATE
125 ]
126 */
127 typedef struct FMOD_DSP_DESCRIPTION
128 {
129     char                         name[32];           /* [w] Name of the unit to be displayed in the network. */
130     unsigned int                 version;            /* [w] Plugin writer's version number. */
131     int                          channels;           /* [w] Number of channels.  Use 0 to process whatever number of channels is currently in the network.  >0 would be mostly used if the unit is a unit that only generates sound. */
132     FMOD_DSP_CREATECALLBACK      create;             /* [w] Create callback.  This is called when DSP unit is created.  Can be null. */
133     FMOD_DSP_RELEASECALLBACK     release;            /* [w] Release callback.  This is called just before the unit is freed so the user can do any cleanup needed for the unit.  Can be null. */
134     FMOD_DSP_RESETCALLBACK       reset;              /* [w] Reset callback.  This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state.  Use to avoid clicks or artifacts. */
135     FMOD_DSP_READCALLBACK        read;               /* [w] Read callback.  Processing is done here.  Can be null. */
136     FMOD_DSP_SETPOSITIONCALLBACK setposition;        /* [w] Set position callback.  This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source.  Can be null. */
137 
138     int                          numparameters;      /* [w] Number of parameters used in this filter.  The user finds this with DSP::getNumParameters */
139     FMOD_DSP_PARAMETERDESC      *paramdesc;          /* [w] Variable number of parameter structures. */
140     FMOD_DSP_SETPARAMCALLBACK    setparameter;       /* [w] This is called when the user calls DSP::setParameter.  Can be null. */
141     FMOD_DSP_GETPARAMCALLBACK    getparameter;       /* [w] This is called when the user calls DSP::getParameter.  Can be null. */
142     FMOD_DSP_DIALOGCALLBACK      config;             /* [w] This is called when the user calls DSP::showConfigDialog.  Can be used to display a dialog to configure the filter.  Can be null. */
143     int                          configwidth;        /* [w] Width of config dialog graphic if there is one.  0 otherwise.*/
144     int                          configheight;       /* [w] Height of config dialog graphic if there is one.  0 otherwise.*/
145     void                        *userdata;           /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation.  Access via DSP::getUserData. */
146 } FMOD_DSP_DESCRIPTION;
147 
148 
149 /*
150 [STRUCTURE]
151 [
152     [DESCRIPTION]
153     DSP plugin structure that is passed into each callback.
154 
155     [REMARKS]
156     Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.
157     Members marked with [w] mean the variable can be written to.  The user can set the value.
158 
159     [PLATFORMS]
160     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
161 
162     [SEE_ALSO]
163     FMOD_DSP_DESCRIPTION
164 ]
165 */
166 struct FMOD_DSP_STATE
167 {
168     FMOD_DSP      *instance;      /* [r] Handle to the DSP hand the user created.  Not to be modified.  C++ users cast to FMOD::DSP to use.  */
169     void          *plugindata;    /* [w] Plugin writer created data the output author wants to attach to this object. */
170 	unsigned short speakermask;	  /* [w] Specifies which speakers the DSP effect is active on */
171 };
172 
173 
174 /*
175     ===================================================================================================
176 
177     FMOD built in effect parameters.
178     Use DSP::setParameter with these enums for the 'index' parameter.
179 
180     ===================================================================================================
181 */
182 
183 /*
184 [ENUM]
185 [
186     [DESCRIPTION]
187     Parameter types for the FMOD_DSP_TYPE_OSCILLATOR filter.
188 
189     [REMARKS]
190 
191     [PLATFORMS]
192     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
193 
194     [SEE_ALSO]
195     DSP::setParameter
196     DSP::getParameter
197     FMOD_DSP_TYPE
198 ]
199 */
200 typedef enum
201 {
202     FMOD_DSP_OSCILLATOR_TYPE,   /* Waveform type.  0 = sine.  1 = square. 2 = sawup. 3 = sawdown. 4 = triangle. 5 = noise.  */
203     FMOD_DSP_OSCILLATOR_RATE    /* Frequency of the sinewave in hz.  1.0 to 22000.0.  Default = 220.0. */
204 } FMOD_DSP_OSCILLATOR;
205 
206 
207 /*
208 [ENUM]
209 [
210     [DESCRIPTION]
211     Parameter types for the FMOD_DSP_TYPE_LOWPASS filter.
212 
213     [REMARKS]
214 
215     [PLATFORMS]
216     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
217 
218     [SEE_ALSO]
219     DSP::setParameter
220     DSP::getParameter
221     FMOD_DSP_TYPE
222 ]
223 */
224 typedef enum
225 {
226     FMOD_DSP_LOWPASS_CUTOFF,    /* Lowpass cutoff frequency in hz.   10.0 to 22000.0.  Default = 5000.0. */
227     FMOD_DSP_LOWPASS_RESONANCE  /* Lowpass resonance Q value. 1.0 to 10.0.  Default = 1.0. */
228 } FMOD_DSP_LOWPASS;
229 
230 
231 /*
232 [ENUM]
233 [
234     [DESCRIPTION]
235     Parameter types for the FMOD_DSP_TYPE_ITLOWPASS filter.
236     This is different to the default FMOD_DSP_TYPE_ITLOWPASS filter in that it uses a different quality algorithm and is
237     the filter used to produce the correct sounding playback in .IT files.
238     FMOD Ex's .IT playback uses this filter.
239 
240     [REMARKS]
241     Note! This filter actually has a limited cutoff frequency below the specified maximum, due to its limited design,
242     so for a more  open range filter use FMOD_DSP_LOWPASS or if you don't mind not having resonance,
243     FMOD_DSP_LOWPASS_SIMPLE.
244     The effective maximum cutoff is about 8060hz.
245 
246     [PLATFORMS]
247     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
248 
249     [SEE_ALSO]
250     DSP::setParameter
251     DSP::getParameter
252     FMOD_DSP_TYPE
253 ]
254 */
255 typedef enum
256 {
257     FMOD_DSP_ITLOWPASS_CUTOFF,    /* Lowpass cutoff frequency in hz.  1.0 to 22000.0.  Default = 5000.0/ */
258     FMOD_DSP_ITLOWPASS_RESONANCE  /* Lowpass resonance Q value.  0.0 to 127.0.  Default = 1.0. */
259 } FMOD_DSP_ITLOWPASS;
260 
261 
262 /*
263 [ENUM]
264 [
265     [DESCRIPTION]
266     Parameter types for the FMOD_DSP_TYPE_HIGHPASS filter.
267 
268     [REMARKS]
269 
270     [PLATFORMS]
271     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
272 
273     [SEE_ALSO]
274     DSP::setParameter
275     DSP::getParameter
276     FMOD_DSP_TYPE
277 ]
278 */
279 typedef enum
280 {
281     FMOD_DSP_HIGHPASS_CUTOFF,    /* Highpass cutoff frequency in hz.  1.0 to output 22000.0.  Default = 5000.0. */
282     FMOD_DSP_HIGHPASS_RESONANCE  /* Highpass resonance Q value.  1.0 to 10.0.  Default = 1.0. */
283 } FMOD_DSP_HIGHPASS;
284 
285 
286 /*
287 [ENUM]
288 [
289     [DESCRIPTION]
290     Parameter types for the FMOD_DSP_TYPE_ECHO filter.
291 
292     [REMARKS]
293     Note.  Every time the delay is changed, the plugin re-allocates the echo buffer.  This means the echo will dissapear at that time while it refills its new buffer.
294     Larger echo delays result in larger amounts of memory allocated.
295 
296     '<i>maxchannels</i>' also dictates the amount of memory allocated.  By default, the maxchannels value is 0.  If FMOD is set to stereo, the echo unit will allocate enough memory for 2 channels.  If it is 5.1, it will allocate enough memory for a 6 channel echo, etc.
297     If the echo effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.
298     When the echo is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly.  It is only in this case where you might want to increase the channel count above the output's channel count.
299     If a channel echo is set to a lower number than the sound's channel count that is coming in, it will not echo the sound.
300 
301     [PLATFORMS]
302     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
303 
304     [SEE_ALSO]
305     DSP::setParameter
306     DSP::getParameter
307     FMOD_DSP_TYPE
308 ]
309 */
310 typedef enum
311 {
312     FMOD_DSP_ECHO_DELAY,       /* Echo delay in ms.  10  to 5000.  Default = 500. */
313     FMOD_DSP_ECHO_DECAYRATIO,  /* Echo decay per delay.  0 to 1.  1.0 = No decay, 0.0 = total decay (ie simple 1 line delay).  Default = 0.5. */
314     FMOD_DSP_ECHO_MAXCHANNELS, /* Maximum channels supported.  0 to 16.  0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc.  See remarks for more.  Default = 0.  It is suggested to leave at 0! */
315     FMOD_DSP_ECHO_DRYMIX,      /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 1.0. */
316     FMOD_DSP_ECHO_WETMIX       /* Volume of echo signal to pass to output.  0.0 to 1.0. Default = 1.0. */
317 } FMOD_DSP_ECHO;
318 
319 
320 /*
321 [ENUM]
322 [
323     [DESCRIPTION]
324     Parameter types for the FMOD_DSP_TYPE_DELAY filter.
325 
326     [REMARKS]
327     Note.  Every time MaxDelay is changed, the plugin re-allocates the delay buffer.  This means the delay will dissapear at that time while it refills its new buffer.
328     A larger MaxDelay results in larger amounts of memory allocated.
329     Channel delays above MaxDelay will be clipped to MaxDelay and the delay buffer will not be resized.
330 
331 
332     [PLATFORMS]
333     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
334 
335     [SEE_ALSO]
336     DSP::setParameter
337     DSP::getParameter
338     FMOD_DSP_TYPE
339 ]
340 */
341 typedef enum
342 {
343     FMOD_DSP_DELAY_CH0,      /* Channel #0 Delay in ms.  0  to 10000.  Default = 0. */
344     FMOD_DSP_DELAY_CH1,      /* Channel #1 Delay in ms.  0  to 10000.  Default = 0. */
345     FMOD_DSP_DELAY_CH2,      /* Channel #2 Delay in ms.  0  to 10000.  Default = 0. */
346     FMOD_DSP_DELAY_CH3,      /* Channel #3 Delay in ms.  0  to 10000.  Default = 0. */
347     FMOD_DSP_DELAY_CH4,      /* Channel #4 Delay in ms.  0  to 10000.  Default = 0. */
348     FMOD_DSP_DELAY_CH5,      /* Channel #5 Delay in ms.  0  to 10000.  Default = 0. */
349     FMOD_DSP_DELAY_CH6,      /* Channel #6 Delay in ms.  0  to 10000.  Default = 0. */
350     FMOD_DSP_DELAY_CH7,      /* Channel #7 Delay in ms.  0  to 10000.  Default = 0. */
351     FMOD_DSP_DELAY_CH8,      /* Channel #8 Delay in ms.  0  to 10000.  Default = 0. */
352     FMOD_DSP_DELAY_CH9,      /* Channel #9 Delay in ms.  0  to 10000.  Default = 0. */
353     FMOD_DSP_DELAY_CH10,     /* Channel #10 Delay in ms.  0  to 10000.  Default = 0. */
354     FMOD_DSP_DELAY_CH11,     /* Channel #11 Delay in ms.  0  to 10000.  Default = 0. */
355     FMOD_DSP_DELAY_CH12,     /* Channel #12 Delay in ms.  0  to 10000.  Default = 0. */
356     FMOD_DSP_DELAY_CH13,     /* Channel #13 Delay in ms.  0  to 10000.  Default = 0. */
357     FMOD_DSP_DELAY_CH14,     /* Channel #14 Delay in ms.  0  to 10000.  Default = 0. */
358     FMOD_DSP_DELAY_CH15,     /* Channel #15 Delay in ms.  0  to 10000.  Default = 0. */
359     FMOD_DSP_DELAY_MAXDELAY  /* Maximum delay in ms.  0  to 10000.  Default = 10. */
360 } FMOD_DSP_DELAY;
361 
362 
363 /*
364 [ENUM]
365 [
366     [DESCRIPTION]
367     Parameter types for the FMOD_DSP_TYPE_FLANGE filter.
368 
369     [REMARKS]
370     Flange is an effect where the signal is played twice at the same time, and one copy slides back and forth creating a whooshing or flanging effect.
371     As there are 2 copies of the same signal, by default each signal is given 50% mix, so that the total is not louder than the original unaffected signal.
372 
373     Flange depth is a percentage of a 10ms shift from the original signal.  Anything above 10ms is not considered flange because to the ear it begins to 'echo' so 10ms is the highest value possible.
374 
375     [PLATFORMS]
376     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
377 
378     [SEE_ALSO]
379     DSP::setParameter
380     DSP::getParameter
381     FMOD_DSP_TYPE
382 ]
383 */
384 typedef enum
385 {
386     FMOD_DSP_FLANGE_DRYMIX,      /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 0.45. */
387     FMOD_DSP_FLANGE_WETMIX,      /* Volume of flange signal to pass to output.  0.0 to 1.0. Default = 0.55. */
388     FMOD_DSP_FLANGE_DEPTH,       /* Flange depth (percentage of 40ms delay).  0.01 to 1.0.  Default = 1.0. */
389     FMOD_DSP_FLANGE_RATE         /* Flange speed in hz.  0.0 to 20.0.  Default = 0.1. */
390 } FMOD_DSP_FLANGE;
391 
392 
393 /*
394 [ENUM]
395 [
396     [DESCRIPTION]
397     Parameter types for the FMOD_DSP_TYPE_TREMOLO filter.
398 
399     [REMARKS]
400     The tremolo effect varies the amplitude of a sound. Depending on the settings, this unit can produce a tremolo, chopper or auto-pan effect.
401 
402     The shape of the LFO (low freq. oscillator) can morphed between sine, triangle and sawtooth waves using the FMOD_DSP_TREMOLO_SHAPE and FMOD_DSP_TREMOLO_SKEW parameters.
403     FMOD_DSP_TREMOLO_DUTY and FMOD_DSP_TREMOLO_SQUARE are useful for a chopper-type effect where the first controls the on-time duration and second controls the flatness of the envelope.
404     FMOD_DSP_TREMOLO_SPREAD varies the LFO phase between channels to get an auto-pan effect. This works best with a sine shape LFO.
405     The LFO can be synchronized using the FMOD_DSP_TREMOLO_PHASE parameter which sets its instantaneous phase.
406 
407     [PLATFORMS]
408     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
409 
410     [SEE_ALSO]
411     DSP::setParameter
412     DSP::getParameter
413     FMOD_DSP_TYPE
414 ]
415 */
416 typedef enum
417 {
418     FMOD_DSP_TREMOLO_FREQUENCY,     /* LFO frequency in Hz.  0.1 to 20.  Default = 4. */
419     FMOD_DSP_TREMOLO_DEPTH,         /* Tremolo depth.  0 to 1.  Default = 0. */
420     FMOD_DSP_TREMOLO_SHAPE,         /* LFO shape morph between triangle and sine.  0 to 1.  Default = 0. */
421     FMOD_DSP_TREMOLO_SKEW,          /* Time-skewing of LFO cycle.  -1 to 1.  Default = 0. */
422     FMOD_DSP_TREMOLO_DUTY,          /* LFO on-time.  0 to 1.  Default = 0.5. */
423     FMOD_DSP_TREMOLO_SQUARE,        /* Flatness of the LFO shape.  0 to 1.  Default = 0. */
424     FMOD_DSP_TREMOLO_PHASE,         /* Instantaneous LFO phase.  0 to 1.  Default = 0. */
425     FMOD_DSP_TREMOLO_SPREAD         /* Rotation / auto-pan effect.  -1 to 1.  Default = 0. */
426 } FMOD_DSP_TREMOLO;
427 
428 
429 /*
430 [ENUM]
431 [
432     [DESCRIPTION]
433     Parameter types for the FMOD_DSP_TYPE_DISTORTION filter.
434 
435     [REMARKS]
436 
437     [PLATFORMS]
438     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
439 
440     [SEE_ALSO]
441     DSP::setParameter
442     DSP::getParameter
443     FMOD_DSP_TYPE
444 ]
445 */
446 typedef enum
447 {
448     FMOD_DSP_DISTORTION_LEVEL    /* Distortion value.  0.0 to 1.0.  Default = 0.5. */
449 } FMOD_DSP_DISTORTION;
450 
451 
452 /*
453 [ENUM]
454 [
455     [DESCRIPTION]
456     Parameter types for the FMOD_DSP_TYPE_NORMALIZE filter.
457 
458     [REMARKS]
459     Normalize amplifies the sound based on the maximum peaks within the signal.
460     For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.
461     The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.
462 
463     Because FMOD is a realtime audio processor, it doesn't have the luxury of knowing the peak for the whole sound (ie it can't see into the future), so it has to process data as it comes in.
464     To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control.  The fadetime parameter can control this.
465 
466     [PLATFORMS]
467     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
468 
469     [SEE_ALSO]
470     DSP::setParameter
471     DSP::getParameter
472     FMOD_DSP_TYPE
473 ]
474 */
475 typedef enum
476 {
477     FMOD_DSP_NORMALIZE_FADETIME,    /* Time to ramp the silence to full in ms.  0.0 to 20000.0. Default = 5000.0. */
478     FMOD_DSP_NORMALIZE_THRESHHOLD,  /* Lower volume range threshold to ignore.  0.0 to 1.0.  Default = 0.1.  Raise higher to stop amplification of very quiet signals. */
479     FMOD_DSP_NORMALIZE_MAXAMP       /* Maximum amplification allowed.  1.0 to 100000.0.  Default = 20.0.  1.0 = no amplifaction, higher values allow more boost. */
480 } FMOD_DSP_NORMALIZE;
481 
482 
483 /*
484 [ENUM]
485 [
486     [DESCRIPTION]
487     Parameter types for the FMOD_DSP_TYPE_PARAMEQ filter.
488 
489     [REMARKS]
490     Parametric EQ is a bandpass filter that attenuates or amplifies a selected frequency and its neighbouring frequencies.
491 
492     To create a multi-band EQ create multiple FMOD_DSP_TYPE_PARAMEQ units and set each unit to different frequencies, for example 1000hz, 2000hz, 4000hz, 8000hz, 16000hz with a range of 1 octave each.
493 
494     When a frequency has its gain set to 1.0, the sound will be unaffected and represents the original signal exactly.
495 
496     [PLATFORMS]
497     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
498 
499     [SEE_ALSO]
500     DSP::setParameter
501     DSP::getParameter
502     FMOD_DSP_TYPE
503 ]
504 */
505 typedef enum
506 {
507     FMOD_DSP_PARAMEQ_CENTER,     /* Frequency center.  20.0 to 22000.0.  Default = 8000.0. */
508     FMOD_DSP_PARAMEQ_BANDWIDTH,  /* Octave range around the center frequency to filter.  0.2 to 5.0.  Default = 1.0. */
509     FMOD_DSP_PARAMEQ_GAIN        /* Frequency Gain.  0.05 to 3.0.  Default = 1.0.  */
510 } FMOD_DSP_PARAMEQ;
511 
512 
513 
514 /*
515 [ENUM]
516 [
517     [DESCRIPTION]
518     Parameter types for the FMOD_DSP_TYPE_PITCHSHIFT filter.
519 
520     [REMARKS]
521     This pitch shifting unit can be used to change the pitch of a sound without speeding it up or slowing it down.
522     It can also be used for time stretching or scaling, for example if the pitch was doubled, and the frequency of the sound was halved, the pitch of the sound would sound correct but it would be twice as slow.
523 
524     <b>Warning!</b> This filter is very computationally expensive!  Similar to a vocoder, it requires several overlapping FFT and IFFT's to produce smooth output, and can require around 440mhz for 1 stereo 48khz signal using the default settings.
525     Reducing the signal to mono will half the cpu usage.
526     Reducing this will lower audio quality, but what settings to use are largely dependant on the sound being played.  A noisy polyphonic signal will need higher fft size compared to a speaking voice for example.
527 
528     This pitch shifter is based on the pitch shifter code at http://www.dspdimension.com, written by Stephan M. Bernsee.
529     The original code is COPYRIGHT 1999-2003 Stephan M. Bernsee <smb@dspdimension.com>.
530 
531     '<i>maxchannels</i>' dictates the amount of memory allocated.  By default, the maxchannels value is 0.  If FMOD is set to stereo, the pitch shift unit will allocate enough memory for 2 channels.  If it is 5.1, it will allocate enough memory for a 6 channel pitch shift, etc.
532     If the pitch shift effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.
533     When the pitch shift is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly.  It is only in this case where you might want to increase the channel count above the output's channel count.
534     If a channel pitch shift is set to a lower number than the sound's channel count that is coming in, it will not pitch shift the sound.
535 
536     [PLATFORMS]
537     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
538 
539     [SEE_ALSO]
540     DSP::setParameter
541     DSP::getParameter
542     FMOD_DSP_TYPE
543 ]
544 */
545 typedef enum
546 {
547     FMOD_DSP_PITCHSHIFT_PITCH,       /* Pitch value.  0.5 to 2.0.  Default = 1.0. 0.5 = one octave down, 2.0 = one octave up.  1.0 does not change the pitch. */
548     FMOD_DSP_PITCHSHIFT_FFTSIZE,     /* FFT window size.  256, 512, 1024, 2048, 4096.  Default = 1024.  Increase this to reduce 'smearing'.  This effect is a warbling sound similar to when an mp3 is encoded at very low bitrates. */
549     FMOD_DSP_PITCHSHIFT_OVERLAP,     /* Removed.  Do not use.  FMOD now uses 4 overlaps and cannot be changed. */
550     FMOD_DSP_PITCHSHIFT_MAXCHANNELS  /* Maximum channels supported.  0 to 16.  0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc.  See remarks for more.  Default = 0.  It is suggested to leave at 0! */
551 } FMOD_DSP_PITCHSHIFT;
552 
553 
554 
555 /*
556 [ENUM]
557 [
558     [DESCRIPTION]
559     Parameter types for the FMOD_DSP_TYPE_CHORUS filter.
560 
561     [REMARKS]
562     Chrous is an effect where the sound is more 'spacious' due to 1 to 3 versions of the sound being played along side the original signal but with the pitch of each copy modulating on a sine wave.
563 
564     [PLATFORMS]
565     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
566 
567     [SEE_ALSO]
568     DSP::setParameter
569     DSP::getParameter
570     FMOD_DSP_TYPE
571 ]
572 */
573 typedef enum
574 {
575     FMOD_DSP_CHORUS_DRYMIX,   /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 0.5. */
576     FMOD_DSP_CHORUS_WETMIX1,  /* Volume of 1st chorus tap.  0.0 to 1.0.  Default = 0.5. */
577     FMOD_DSP_CHORUS_WETMIX2,  /* Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap.  0.0 to 1.0.  Default = 0.5. */
578     FMOD_DSP_CHORUS_WETMIX3,  /* Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap.  0.0 to 1.0.  Default = 0.5. */
579     FMOD_DSP_CHORUS_DELAY,    /* Chorus delay in ms.  0.1 to 100.0.  Default = 40.0 ms. */
580     FMOD_DSP_CHORUS_RATE,     /* Chorus modulation rate in hz.  0.0 to 20.0.  Default = 0.8 hz. */
581     FMOD_DSP_CHORUS_DEPTH     /* Chorus modulation depth.  0.0 to 1.0.  Default = 0.03. */
582 } FMOD_DSP_CHORUS;
583 
584 
585 /*
586 [ENUM]
587 [
588     [DESCRIPTION]
589     Parameter types for the FMOD_DSP_TYPE_ITECHO filter.
590     This is effectively a software based echo filter that emulates the DirectX DMO echo effect.  Impulse tracker files can support this, and FMOD will produce the effect on ANY platform, not just those that support DirectX effects!
591 
592     [REMARKS]
593     Note.  Every time the delay is changed, the plugin re-allocates the echo buffer.  This means the echo will dissapear at that time while it refills its new buffer.
594     Larger echo delays result in larger amounts of memory allocated.
595 
596     As this is a stereo filter made mainly for IT playback, it is targeted for stereo signals.
597     With mono signals only the FMOD_DSP_ITECHO_LEFTDELAY is used.
598     For multichannel signals (>2) there will be no echo on those channels.
599 
600     [PLATFORMS]
601     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
602 
603     [SEE_ALSO]
604     DSP::SetParameter
605     DSP::GetParameter
606     FMOD_DSP_TYPE
607     System::addDSP
608 ]
609 */
610 typedef enum
611 {
612     FMOD_DSP_ITECHO_WETDRYMIX,      /* Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0.0 through 100.0 (all wet). The default value is 50. */
613     FMOD_DSP_ITECHO_FEEDBACK,       /* Percentage of output fed back into input, in the range from 0.0 through 100.0. The default value is 50. */
614     FMOD_DSP_ITECHO_LEFTDELAY,      /* Delay for left channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */
615     FMOD_DSP_ITECHO_RIGHTDELAY,     /* Delay for right channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */
616     FMOD_DSP_ITECHO_PANDELAY        /* Value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. Possible values are defined as 0.0 (equivalent to FALSE) and 1.0 (equivalent to TRUE).  CURRENTLY NOT SUPPORTED. */
617 } FMOD_DSP_ITECHO;
618 
619 /*
620 [ENUM]
621 [
622     [DESCRIPTION]
623     Parameter types for the FMOD_DSP_TYPE_COMPRESSOR unit.
624     This is a simple linked multichannel software limiter that is uniform across the whole spectrum.
625 
626     [REMARKS]
627     The limiter is not guaranteed to catch every peak above the threshold level,
628     because it cannot apply gain reduction instantaneously - the time delay is
629     determined by the attack time. However setting the attack time too short will
630     distort the sound, so it is a compromise. High level peaks can be avoided by
631     using a short attack time - but not too short, and setting the threshold a few
632     decibels below the critical level.
633 
634 
635     [PLATFORMS]
636     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
637 
638     [SEE_ALSO]
639     DSP::SetParameter
640     DSP::GetParameter
641     FMOD_DSP_TYPE
642     System::addDSP
643 ]
644 */
645 typedef enum
646 {
647     FMOD_DSP_COMPRESSOR_THRESHOLD,  /* Threshold level (dB) in the range from -60 through 0. The default value is 0. */
648     FMOD_DSP_COMPRESSOR_ATTACK,     /* Gain reduction attack time (milliseconds), in the range from 10 through 200. The default value is 50. */
649     FMOD_DSP_COMPRESSOR_RELEASE,    /* Gain reduction release time (milliseconds), in the range from 20 through 1000. The default value is 50. */
650     FMOD_DSP_COMPRESSOR_GAINMAKEUP  /* Make-up gain (dB) applied after limiting, in the range from 0 through 30. The default value is 0. */
651 } FMOD_DSP_COMPRESSOR;
652 
653 /*
654 [ENUM]
655 [
656     [DESCRIPTION]
657     Parameter types for the FMOD_DSP_TYPE_SFXREVERB unit.
658 
659     [REMARKS]
660     This is a high quality I3DL2 based reverb.
661     On top of the I3DL2 property set, "Dry Level" is also included to allow the dry mix to be changed.
662 
663     These properties can be set with presets in FMOD_REVERB_PRESETS.
664 
665     [PLATFORMS]
666     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
667 
668     [SEE_ALSO]
669     DSP::SetParameter
670     DSP::GetParameter
671     FMOD_DSP_TYPE
672     System::addDSP
673     FMOD_REVERB_PRESETS
674 ]
675 */
676 typedef enum
677 {
678     FMOD_DSP_SFXREVERB_DRYLEVEL,            /* Dry Level      : Mix level of dry signal in output in mB.  Ranges from -10000.0 to 0.0.  Default is 0. */
679     FMOD_DSP_SFXREVERB_ROOM,                /* Room           : Room effect level at low frequencies in mB.  Ranges from -10000.0 to 0.0.  Default is -10000.0. */
680     FMOD_DSP_SFXREVERB_ROOMHF,              /* Room HF        : Room effect high-frequency level re. low frequency level in mB.  Ranges from -10000.0 to 0.0.  Default is 0.0. */
681     FMOD_DSP_SFXREVERB_DECAYTIME,           /* Decay Time     : Reverberation decay time at low-frequencies in seconds.  Ranges from 0.1 to 20.0. Default is 1.0. */
682     FMOD_DSP_SFXREVERB_DECAYHFRATIO,        /* Decay HF Ratio : High-frequency to low-frequency decay time ratio.  Ranges from 0.1 to 2.0. Default is 0.5. */
683     FMOD_DSP_SFXREVERB_REFLECTIONSLEVEL,    /* Reflections    : Early reflections level relative to room effect in mB.  Ranges from -10000.0 to 1000.0.  Default is -10000.0. */
684     FMOD_DSP_SFXREVERB_REFLECTIONSDELAY,    /* Reflect Delay  : Delay time of first reflection in seconds.  Ranges from 0.0 to 0.3.  Default is 0.02. */
685     FMOD_DSP_SFXREVERB_REVERBLEVEL,         /* Reverb         : Late reverberation level relative to room effect in mB.  Ranges from -10000.0 to 2000.0.  Default is 0.0. */
686     FMOD_DSP_SFXREVERB_REVERBDELAY,         /* Reverb Delay   : Late reverberation delay time relative to first reflection in seconds.  Ranges from 0.0 to 0.1.  Default is 0.04. */
687     FMOD_DSP_SFXREVERB_DIFFUSION,           /* Diffusion      : Reverberation diffusion (echo density) in percent.  Ranges from 0.0 to 100.0.  Default is 100.0. */
688     FMOD_DSP_SFXREVERB_DENSITY,             /* Density        : Reverberation density (modal density) in percent.  Ranges from 0.0 to 100.0.  Default is 100.0. */
689     FMOD_DSP_SFXREVERB_HFREFERENCE,         /* HF Reference   : Reference high frequency in Hz.  Ranges from 20.0 to 20000.0. Default is 5000.0. */
690     FMOD_DSP_SFXREVERB_ROOMLF,              /* Room LF        : Room effect low-frequency level in mB.  Ranges from -10000.0 to 0.0.  Default is 0.0. */
691     FMOD_DSP_SFXREVERB_LFREFERENCE          /* LF Reference   : Reference low-frequency in Hz.  Ranges from 20.0 to 1000.0. Default is 250.0. */
692 } FMOD_DSP_SFXREVERB;
693 
694 /*
695 [ENUM]
696 [
697     [DESCRIPTION]
698     Parameter types for the FMOD_DSP_TYPE_LOWPASS_SIMPLE filter.
699     This is a very simple low pass filter, based on two single-pole RC time-constant modules.
700     The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.
701 
702     [REMARKS]
703 
704     [PLATFORMS]
705     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
706 
707     [SEE_ALSO]
708     DSP::setParameter
709     DSP::getParameter
710     FMOD_DSP_TYPE
711 ]
712 */
713 typedef enum
714 {
715     FMOD_DSP_LOWPASS_SIMPLE_CUTOFF     /* Lowpass cutoff frequency in hz.  10.0 to 22000.0.  Default = 5000.0 */
716 } FMOD_DSP_LOWPASS_SIMPLE;
717 
718 /*
719 [ENUM]
720 [
721     [DESCRIPTION]
722     Parameter types for the FMOD_DSP_TYPE_HIGHPASS_SIMPLE filter.
723     This is a very simple single-order high pass filter.
724     The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.
725 
726     [REMARKS]
727 
728     [PLATFORMS]
729     Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
730 
731     [SEE_ALSO]
732     DSP::setParameter
733     DSP::getParameter
734     FMOD_DSP_TYPE
735 ]
736 */
737 typedef enum
738 {
739     FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF     /* Highpass cutoff frequency in hz.  10.0 to 22000.0.  Default = 1000.0 */
740 } FMOD_DSP_HIGHPASS_SIMPLE;
741 
742 #endif
743 
744