diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2009-04-01 21:13:09 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2009-04-01 21:13:09 +0000 |
commit | 0ed7a8b68dd73e2b0473b8127aeca99f3bac9061 (patch) | |
tree | 5c67818b38a5cc2f9caa5ca7f8640ca356adf02b /externals/grill/fftease/src/cross~.cpp | |
parent | bb4c7f6a245394d09dac9adfb2efb093d3d98452 (diff) |
cleaned up grill externals - replaced with svn:externals to svn.grrrr.org/ext/trunk/
svn path=/trunk/; revision=10951
Diffstat (limited to 'externals/grill/fftease/src/cross~.cpp')
-rw-r--r-- | externals/grill/fftease/src/cross~.cpp | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/externals/grill/fftease/src/cross~.cpp b/externals/grill/fftease/src/cross~.cpp deleted file mode 100644 index cdbd9d0a..00000000 --- a/externals/grill/fftease/src/cross~.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - -FFTease - A set of Live Spectral Processors -Originally written by Eric Lyon and Christopher Penrose for the Max/MSP platform - -Copyright (c)Thomas Grill (xovo@gmx.net) -For information on usage and redistribution, and for a DISCLAIMER OF ALL -WARRANTIES, see the file, "license.txt," in this distribution. - -*/ - -#include "main.h" - - -class cross: - public fftease -{ - FLEXT_HEADER_S(cross,fftease,setup) - -public: - cross(); - -protected: - - F *amps; - BL memory; - - virtual V Set(); - virtual V Clear(); - virtual V Delete(); - - virtual V Transform(I _N2,S *const *in); - -private: - static V setup(t_classid c); - - FLEXT_ATTRVAR_B(memory) -}; - -FLEXT_LIB_DSP("cross~",cross) - - -V cross::setup(t_classid c) -{ - FLEXT_CADDATTR_VAR1(c,"memorize",memory); -} - -cross::cross(): - fftease(2,F_STEREO|F_BALANCED|F_BITSHUFFLE|F_NOPH2), - memory(true) -{ - AddInSignal("Messages and driver signal"); - AddInSignal("Filter signal"); - AddInSignal("Threshold signal for cross synthesis"); - AddOutSignal("Transformed signal"); -} - -V cross::Clear() -{ - amps = NULL; - fftease::Clear(); -} - -V cross::Delete() -{ - fftease::Delete(); - if(amps) delete[] amps; -} - -V cross::Set() -{ - fftease::Set(); - const I _N2 = get_N()/2; - amps = new F[_N2]; - ZeroMem(amps,_N2*sizeof(*amps)); -} - -V cross::Transform(I _N,S *const *in) -{ - // filled only once per signal vector!! - register const F threshie = *in[0]; - F *amp = amps; - - for (I i = 0; i <= _N; i += 2,amp++) - if( _channel2[i] > threshie ) - *amp = _channel1[i] *= _channel2[i]; - else if(memory) - // retrieve previous value - _channel1[i] = *amp; - -} - |