From ce8d118561bd86df80eae140f2e0a64db55998e3 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 28 Jan 2004 11:09:13 +0000 Subject: *** empty log message *** svn path=/trunk/externals/tb/; revision=1298 --- tbext/source/fftbuf.cpp | 38 +++++++++++++++++++++++++------------- tbext/source/main.cpp | 5 +++-- tbext/source/tbfft2.cpp | 2 +- 3 files changed, 29 insertions(+), 16 deletions(-) (limited to 'tbext/source') diff --git a/tbext/source/fftbuf.cpp b/tbext/source/fftbuf.cpp index eff81e3..13f0b9e 100644 --- a/tbext/source/fftbuf.cpp +++ b/tbext/source/fftbuf.cpp @@ -121,27 +121,36 @@ fftbuf::~fftbuf() void fftbuf::m_signal(int n, t_float *const *in, t_float *const *out) { - outs = out[0]; - - if (counter!=0) + if (check(buf)) { - n=n/2+1; + outs = out[0]; + + if (counter!=0) + { + n=n/2+1; while (--n) data[n] = data[n] - offset[n]; /* for(int i=0;i!=bs;++i) - { + { data[i] = data[i] - offset[i]; - } + } */ - + --counter; + } + + CopySamples(out[0],data,bs); } - - CopySamples(out[0],data,bs); + else + CopySamples(out[0],data,bs); + } +//perform und dsp gleichzeitig?!? + + void fftbuf::perform() { counter=blknumber(); @@ -196,7 +205,7 @@ void fftbuf::set_buf(int argc, t_atom *argv) } template -/*inline*/ void fftbuf::clear(T* buf) +inline void fftbuf::clear(T* buf) { if (buf) { @@ -207,6 +216,8 @@ template inline bool fftbuf::check(buffer * buf) { + if (buf==NULL) + return false; //code taken from the flext tutorial (buffer 1) by thomas grill if(buf->Update()) @@ -241,7 +252,8 @@ void fftbuf::set_line(int argc, t_atom *argv) inline int fftbuf::blknumber() { - // post("%i %i %i",delay,bs,sr); - // post("computer counter: %i",delay*bs/sr*1000); - return delay*bs/sr*1000; //ms/sample + post("%i %i %i",delay,bs,sr); + post("blknumber: %i",delay*bs/sr); + + return delay*bs/sr; //ms/sample } diff --git a/tbext/source/main.cpp b/tbext/source/main.cpp index dd007df..5a3bb14 100644 --- a/tbext/source/main.cpp +++ b/tbext/source/main.cpp @@ -51,10 +51,10 @@ void ttbext_setup() post("TBEXT: by tim blechmann"); post("version "TBEXT_VERSION); post("compiled on "__DATE__); - post(""); + post("contains: tbroute(~), tbsig~, tbpow~, tbfft1~, tbfft2~, bufline~, fftgrrev~"); + post(" fftgrsort~, fftgrshuf~"); FLEXT_SETUP(tbroute); - //FLEXT_SETUP(tbstrg); FLEXT_DSP_SETUP(tbsroute); // FLEXT_DSP_SETUP(tbssel); FLEXT_DSP_SETUP(tbsig); @@ -66,6 +66,7 @@ void ttbext_setup() FLEXT_DSP_SETUP(fftgrsort); FLEXT_DSP_SETUP(fftgrshuf); FLEXT_DSP_SETUP(fftgrrev); + FLEXT_DSP_SETUP(spigot_tilde); } FLEXT_LIB_SETUP(tbext,ttbext_setup) diff --git a/tbext/source/tbfft2.cpp b/tbext/source/tbfft2.cpp index 6ed71d9..99d16fe 100644 --- a/tbext/source/tbfft2.cpp +++ b/tbext/source/tbfft2.cpp @@ -72,7 +72,7 @@ private: float *ins; float *outs; float *tmps; - t_float tmp[2049]; + t_float tmp[17000]; t_float s; t_float b; -- cgit v1.2.1