Mercurial > audlegacy-plugins
annotate src/modplug/snd_eq.cxx @ 2284:d19b53359b24
cleaned up the sndfile wav plugin, currently limiting it ONLY TO WAV
PLAYBACK. if somebody is more experienced with it and wants to restore
the other formats, go ahead (maybe change the name of the plugin too?).
author | mf0102 <0102@gmx.at> |
---|---|
date | Wed, 09 Jan 2008 15:41:22 +0100 |
parents | 3673c7ec4ea2 |
children |
rev | line source |
---|---|
2216
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1 /* |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2 * This program is free software; you can redistribute it and modify it |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
3 * under the terms of the GNU General Public License as published by the |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
4 * Free Software Foundation; either version 2 of the license or (at your |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
5 * option) any later version. |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
6 * |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
7 * Authors: Olivier Lapicque <olivierl@jps.net> |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
8 * |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
9 * Name Date Description |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
10 * |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
11 * Olivier Lapicque --/--/-- Creation |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
12 * Trevor Nunes 26/01/04 conditional compilation for AMD,MMX calls |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
13 * |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
14 */ |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
15 #include "stdafx.h" |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
16 #include "sndfile.h" |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
17 #include <math.h> |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
18 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
19 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
20 #define EQ_BANDWIDTH 2.0 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
21 #define EQ_ZERO 0.000001 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
22 #define REAL float |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
23 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
24 extern REAL MixFloatBuffer[]; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
25 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
26 extern void StereoMixToFloat(const int *pSrc, float *pOut1, float *pOut2, UINT nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
27 extern void FloatToStereoMix(const float *pIn1, const float *pIn2, int *pOut, UINT nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
28 extern void MonoMixToFloat(const int *pSrc, float *pOut, UINT nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
29 extern void FloatToMonoMix(const float *pIn, int *pOut, UINT nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
30 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
31 typedef struct _EQBANDSTRUCT |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
32 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
33 REAL a0, a1, a2, b1, b2; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
34 REAL x1, x2, y1, y2; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
35 REAL Gain, CenterFrequency; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
36 BOOL bEnable; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
37 } EQBANDSTRUCT, *PEQBANDSTRUCT; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
38 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
39 UINT gEqLinearToDB[33] = |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
40 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
41 16, 19, 22, 25, 28, 31, 34, 37, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
42 40, 43, 46, 49, 52, 55, 58, 61, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
43 64, 76, 88, 100, 112, 124, 136, 148, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
44 160, 172, 184, 196, 208, 220, 232, 244, 256 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
45 }; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
46 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
47 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
48 //static REAL f2ic = (REAL)(1 << 28); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
49 //static REAL i2fc = (REAL)(1.0 / (1 << 28)); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
50 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
51 static EQBANDSTRUCT gEQ[MAX_EQ_BANDS*2] = |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
52 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
53 // Default: Flat EQ |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
54 {0,0,0,0,0, 0,0,0,0, 1, 120, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
55 {0,0,0,0,0, 0,0,0,0, 1, 600, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
56 {0,0,0,0,0, 0,0,0,0, 1, 1200, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
57 {0,0,0,0,0, 0,0,0,0, 1, 3000, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
58 {0,0,0,0,0, 0,0,0,0, 1, 6000, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
59 {0,0,0,0,0, 0,0,0,0, 1, 10000, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
60 {0,0,0,0,0, 0,0,0,0, 1, 120, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
61 {0,0,0,0,0, 0,0,0,0, 1, 600, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
62 {0,0,0,0,0, 0,0,0,0, 1, 1200, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
63 {0,0,0,0,0, 0,0,0,0, 1, 3000, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
64 {0,0,0,0,0, 0,0,0,0, 1, 6000, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
65 {0,0,0,0,0, 0,0,0,0, 1, 10000, FALSE}, |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
66 }; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
67 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
68 void EQFilter(EQBANDSTRUCT *pbs, REAL *pbuffer, UINT nCount) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
69 //---------------------------------------------------------- |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
70 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
71 for (UINT i=0; i<nCount; i++) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
72 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
73 REAL x = pbuffer[i]; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
74 REAL y = pbs->a1 * pbs->x1 + pbs->a2 * pbs->x2 + pbs->a0 * x + pbs->b1 * pbs->y1 + pbs->b2 * pbs->y2; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
75 pbs->x2 = pbs->x1; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
76 pbs->y2 = pbs->y1; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
77 pbs->x1 = x; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
78 pbuffer[i] = y; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
79 pbs->y1 = y; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
80 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
81 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
82 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
83 void CSoundFile::EQMono(int *pbuffer, UINT nCount) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
84 //------------------------------------------------ |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
85 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
86 MonoMixToFloat(pbuffer, MixFloatBuffer, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
87 for (UINT b=0; b<MAX_EQ_BANDS; b++) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
88 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
89 if ((gEQ[b].bEnable) && (gEQ[b].Gain != 1.0f)) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
90 EQFilter(&gEQ[b], MixFloatBuffer, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
91 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
92 FloatToMonoMix(MixFloatBuffer, pbuffer, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
93 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
94 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
95 void CSoundFile::EQStereo(int *pbuffer, UINT nCount) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
96 //-------------------------------------------------- |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
97 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
98 StereoMixToFloat(pbuffer, MixFloatBuffer, MixFloatBuffer+MIXBUFFERSIZE, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
99 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
100 for (UINT bl=0; bl<MAX_EQ_BANDS; bl++) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
101 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
102 if ((gEQ[bl].bEnable) && (gEQ[bl].Gain != 1.0f)) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
103 EQFilter(&gEQ[bl], MixFloatBuffer, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
104 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
105 for (UINT br=MAX_EQ_BANDS; br<MAX_EQ_BANDS*2; br++) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
106 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
107 if ((gEQ[br].bEnable) && (gEQ[br].Gain != 1.0f)) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
108 EQFilter(&gEQ[br], MixFloatBuffer+MIXBUFFERSIZE, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
109 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
110 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
111 FloatToStereoMix(MixFloatBuffer, MixFloatBuffer+MIXBUFFERSIZE, pbuffer, nCount); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
112 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
113 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
114 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
115 void CSoundFile::InitializeEQ(BOOL bReset) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
116 //---------------------------------------- |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
117 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
118 REAL fMixingFreq = (REAL)gdwMixingFreq; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
119 // Gain = 0.5 (-6dB) .. 2 (+6dB) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
120 for (UINT band=0; band<MAX_EQ_BANDS*2; band++) if (gEQ[band].bEnable) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
121 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
122 REAL k, k2, r, f; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
123 REAL v0, v1; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
124 BOOL b = bReset; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
125 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
126 f = gEQ[band].CenterFrequency / fMixingFreq; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
127 if (f > 0.45f) gEQ[band].Gain = 1; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
128 // if (f > 0.25) f = 0.25; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
129 // k = tan(PI*f); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
130 k = f * 3.141592654f; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
131 k = k + k*f; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
132 // if (k > (REAL)0.707) k = (REAL)0.707; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
133 k2 = k*k; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
134 v0 = gEQ[band].Gain; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
135 v1 = 1; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
136 if (gEQ[band].Gain < 1.0) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
137 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
138 v0 *= (0.5f/EQ_BANDWIDTH); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
139 v1 *= (0.5f/EQ_BANDWIDTH); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
140 } else |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
141 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
142 v0 *= (1.0f/EQ_BANDWIDTH); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
143 v1 *= (1.0f/EQ_BANDWIDTH); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
144 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
145 r = (1 + v0*k + k2) / (1 + v1*k + k2); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
146 if (r != gEQ[band].a0) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
147 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
148 gEQ[band].a0 = r; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
149 b = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
150 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
151 r = 2 * (k2 - 1) / (1 + v1*k + k2); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
152 if (r != gEQ[band].a1) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
153 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
154 gEQ[band].a1 = r; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
155 b = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
156 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
157 r = (1 - v0*k + k2) / (1 + v1*k + k2); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
158 if (r != gEQ[band].a2) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
159 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
160 gEQ[band].a2 = r; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
161 b = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
162 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
163 r = - 2 * (k2 - 1) / (1 + v1*k + k2); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
164 if (r != gEQ[band].b1) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
165 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
166 gEQ[band].b1 = r; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
167 b = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
168 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
169 r = - (1 - v1*k + k2) / (1 + v1*k + k2); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
170 if (r != gEQ[band].b2) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
171 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
172 gEQ[band].b2 = r; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
173 b = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
174 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
175 if (b) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
176 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
177 gEQ[band].x1 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
178 gEQ[band].x2 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
179 gEQ[band].y1 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
180 gEQ[band].y2 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
181 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
182 } else |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
183 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
184 gEQ[band].a0 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
185 gEQ[band].a1 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
186 gEQ[band].a2 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
187 gEQ[band].b1 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
188 gEQ[band].b2 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
189 gEQ[band].x1 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
190 gEQ[band].x2 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
191 gEQ[band].y1 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
192 gEQ[band].y2 = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
193 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
194 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
195 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
196 |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
197 void CSoundFile::SetEQGains(const UINT *pGains, UINT nGains, const UINT *pFreqs, BOOL bReset) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
198 //------------------------------------------------------------------------------------------- |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
199 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
200 for (UINT i=0; i<MAX_EQ_BANDS; i++) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
201 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
202 REAL g, f = 0; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
203 if (i < nGains) |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
204 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
205 UINT n = pGains[i]; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
206 // if (n > 32) n = 32; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
207 g = 1.0 + (((double)n) / 64.0); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
208 if (pFreqs) f = (REAL)(int)pFreqs[i]; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
209 } else |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
210 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
211 g = 1; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
212 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
213 gEQ[i].Gain = g; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
214 gEQ[i].CenterFrequency = f; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
215 gEQ[i+MAX_EQ_BANDS].Gain = g; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
216 gEQ[i+MAX_EQ_BANDS].CenterFrequency = f; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
217 if (f > 20.0f && i < nGains) /* don't enable bands outside... */ |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
218 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
219 gEQ[i].bEnable = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
220 gEQ[i+MAX_EQ_BANDS].bEnable = TRUE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
221 } else |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
222 { |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
223 gEQ[i].bEnable = FALSE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
224 gEQ[i+MAX_EQ_BANDS].bEnable = FALSE; |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
225 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
226 } |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
227 InitializeEQ(bReset); |
3673c7ec4ea2
Sync with schism's modplug engine. Suggested by G¸«ärkan Seng¸«än.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
228 } |