aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/fftease/src
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/fftease/src')
-rw-r--r--externals/grill/fftease/src/fftease.cpp33
-rw-r--r--externals/grill/fftease/src/main.cpp19
-rw-r--r--externals/grill/fftease/src/thresher~.cpp6
3 files changed, 20 insertions, 38 deletions
diff --git a/externals/grill/fftease/src/fftease.cpp b/externals/grill/fftease/src/fftease.cpp
index 378ae8ce..9a7641c1 100644
--- a/externals/grill/fftease/src/fftease.cpp
+++ b/externals/grill/fftease/src/fftease.cpp
@@ -35,10 +35,9 @@ V fftease::Exit()
V fftease::m_dsp(I n,S *const *,S *const *)
{
- const I _D = n;
const F sr = Samplerate();
- if(_D != blsz || sr != smprt) {
- blsz = _D;
+ if(n != blsz || sr != smprt) {
+ blsz = n;
smprt = sr;
MakeVar();
@@ -51,15 +50,15 @@ V fftease::m_signal(I n,S *const *in,S *const *out)
{
/* declare working variables */
I i;
- const I _D = n,_N = get_N(),_Nw = _N,_N2 = _N/2; //,_Nw2 = _Nw/2;
+ const I _N = get_N(),_Nw = _N,_N2 = _N/2; //,_Nw2 = _Nw/2;
/* fill our retaining buffers */
- _inCount += _D;
+ _inCount += n;
if(_flags&F_STEREO) {
- for(i = 0; i < _N-_D ; i++ ) {
- _input1[i] = _input1[i+_D];
- _input2[i] = _input2[i+_D];
+ for(i = 0; i < _N-n ; i++ ) {
+ _input1[i] = _input1[i+n];
+ _input2[i] = _input2[i+n];
}
for(I j = 0; i < _N; i++,j++) {
_input1[i] = in[0][j];
@@ -67,8 +66,8 @@ V fftease::m_signal(I n,S *const *in,S *const *out)
}
}
else {
- for (i = 0 ; i < _N-_D ; i++ )
- _input1[i] = _input1[i+_D];
+ for (i = 0 ; i < _N-n ; i++ )
+ _input1[i] = _input1[i+n];
for (I j = 0; i < _N; i++,j++ )
_input1[i] = in[0][j];
}
@@ -130,11 +129,11 @@ V fftease::m_signal(I n,S *const *in,S *const *out)
/* set our output and adjust our retaining output buffer */
const F mult = 1./_N;
- for ( i = 0; i < _D; i++ )
+ for ( i = 0; i < n; i++ )
out[0][i] = _output[i] * mult;
- for ( i = 0; i < _N-_D; i++ )
- _output[i] = _output[i+_D];
+ for ( i = 0; i < _N-n; i++ )
+ _output[i] = _output[i+n];
for (; i < _N; i++ )
_output[i] = 0.;
}
@@ -143,7 +142,7 @@ V fftease::m_signal(I n,S *const *in,S *const *out)
void fftease::Set()
{
/* preset the objects data */
- const I _D = Blocksize(),_N = _D*Mult(),_Nw = _N,_N2 = _N/2; //,_Nw2 = _Nw/2;
+ const I n = Blocksize(),_N = n*Mult(),_Nw = _N,_N2 = _N/2; //,_Nw2 = _Nw/2;
_inCount = -_Nw;
@@ -175,7 +174,7 @@ void fftease::Set()
_c_lastphase_out = new F[_N2+1];
ZeroMem(_c_lastphase_out,(_N2+1)*sizeof(*_c_lastphase_out));
- _c_factor_in = Samplerate()/(_D * PV_2PI);
+ _c_factor_in = Samplerate()/(n * PV_2PI);
}
}
@@ -192,9 +191,9 @@ void fftease::Set()
_Wanal = new F[_Nw];
_Wsyn = new F[_Nw];
if(_flags&F_BALANCED)
- makewindows( _Hwin, _Wanal, _Wsyn, _Nw, _N, _D, 0);
+ makewindows( _Hwin, _Wanal, _Wsyn, _Nw, _N, n, 0);
else
- makehanning( _Hwin, _Wanal, _Wsyn, _Nw, _N, _D, 0,0);
+ makehanning( _Hwin, _Wanal, _Wsyn, _Nw, _N, n, 0,0);
}
void fftease::Clear()
diff --git a/externals/grill/fftease/src/main.cpp b/externals/grill/fftease/src/main.cpp
index 3ce33e8f..75bea448 100644
--- a/externals/grill/fftease/src/main.cpp
+++ b/externals/grill/fftease/src/main.cpp
@@ -20,7 +20,7 @@ static V fftease_main()
post("FFTease - A set of Live Spectral Processors");
post("Originally written by Eric Lyon and Christopher Penrose for MAX/MSP");
post("");
- post("flext port (version " FFTEASE_VERSION ") provided by Thomas Grill, (C)2003");
+ post("flext port (version " FFTEASE_VERSION ") provided by Thomas Grill, (C)2003-2004");
post("-------------------------------------------------------------------");
post("");
@@ -44,23 +44,6 @@ static V fftease_main()
FLEXT_DSP_SETUP(pvoc);
*/
-
-#if FLEXT_SYS == FLEXT_SYS_MAX
- finder_addclass((C *)"FFTease",(C *)"burrow~");
- finder_addclass((C *)"FFTease",(C *)"cross~");
- finder_addclass((C *)"FFTease",(C *)"dentist~");
- finder_addclass((C *)"FFTease",(C *)"disarray~");
- finder_addclass((C *)"FFTease",(C *)"drown~");
- finder_addclass((C *)"FFTease",(C *)"ether~");
- finder_addclass((C *)"FFTease",(C *)"morphine~");
- finder_addclass((C *)"FFTease",(C *)"scrape~");
- finder_addclass((C *)"FFTease",(C *)"shapee~");
- finder_addclass((C *)"FFTease",(C *)"swinger~");
- finder_addclass((C *)"FFTease",(C *)"taint~");
- finder_addclass((C *)"FFTease",(C *)"thresher~");
- finder_addclass((C *)"FFTease",(C *)"vacancy~");
- finder_addclass((C *)"FFTease",(C *)"xsyn~");
-#endif
}
// setup the library
diff --git a/externals/grill/fftease/src/thresher~.cpp b/externals/grill/fftease/src/thresher~.cpp
index 29b042be..f8d16ab0 100644
--- a/externals/grill/fftease/src/thresher~.cpp
+++ b/externals/grill/fftease/src/thresher~.cpp
@@ -49,8 +49,8 @@ void thresher::Set()
{
fftease::Set();
- const F _R = Samplerate();
- const I _D = Blocksize(),_N = get_N(),_N2 = _N/2;
+ const F rate = Samplerate();
+ const I n = Blocksize(),_N = get_N(),_N2 = _N/2;
_compositeFrame = new F[_N+2];
_framesLeft = new I[_N2+1];
@@ -58,7 +58,7 @@ void thresher::Set()
_firstFrame = true;
_moveThreshold = .00001 ;
F _maxHoldTime = 5.0 ;
- _maxHoldFrames = (I)(_maxHoldTime *_R/_D);
+ _maxHoldFrames = (I)(_maxHoldTime *rate/n);
}
void thresher::Clear()