Skip to content

Commit

Permalink
fixed the formant filter
Browse files Browse the repository at this point in the history
  • Loading branch information
David Griffiths committed Mar 30, 2011
1 parent 05c9578 commit 23f507f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
27 changes: 13 additions & 14 deletions fluxa/src/Modules.cpp
Expand Up @@ -640,7 +640,7 @@ void MoogFilter::Process(unsigned int BufSize, Sample &In, Sample *CutoffCV, Sam
///////////////////////////////////////////////////////////////////////////

//-------------------------------------------------------------VOWEL COEFFICIENTS
const float coeff[5][11]= {
const double coeff[5][11]= {
{ 8.11044e-06,
8.943665402, -36.83889529, 92.01697887, -154.337906, 181.6233289,
-151.8651235, 89.09614114, -35.10298511, 8.388101016, -0.923313471 ///A
Expand Down Expand Up @@ -695,18 +695,17 @@ void FormantFilter::Process(unsigned int BufSize, Sample &In, Sample *CutoffCV,
for (int v=0; v<5; v++)
{
res= (float) (coeff[v][0]*in +
coeff[v][1]*memory[v][0] +
coeff[v][2]*memory[v][1] +
coeff[v][3]*memory[v][2] +
coeff[v][4]*memory[v][3] +
coeff[v][5]*memory[v][4] +
coeff[v][6]*memory[v][5] +
coeff[v][7]*memory[v][6] +
coeff[v][8]*memory[v][7] +
coeff[v][9]*memory[v][8] +
coeff[v][10]*memory[v][9] );


coeff[v][1]*memory[v][0] +
coeff[v][2]*memory[v][1] +
coeff[v][3]*memory[v][2] +
coeff[v][4]*memory[v][3] +
coeff[v][5]*memory[v][4] +
coeff[v][6]*memory[v][5] +
coeff[v][7]*memory[v][6] +
coeff[v][8]*memory[v][7] +
coeff[v][9]*memory[v][8] +
coeff[v][10]*memory[v][9]);

memory[v][9]=memory[v][8];
memory[v][8]=memory[v][7];
memory[v][7]=memory[v][6];
Expand All @@ -716,7 +715,7 @@ void FormantFilter::Process(unsigned int BufSize, Sample &In, Sample *CutoffCV,
memory[v][3]=memory[v][2];
memory[v][2]=memory[v][1];
memory[v][1]=memory[v][0];
memory[v][0]=(float) res;
memory[v][0]=(double) res;

o[v]=res;
}
Expand Down
3 changes: 1 addition & 2 deletions fluxa/src/Modules.h
Expand Up @@ -243,8 +243,7 @@ class FormantFilter : public Module

private:
float m_Vowel;

float memory[5][10];
double memory[5][10];
};

// a wrapper for the other filters
Expand Down

0 comments on commit 23f507f

Please sign in to comment.