aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/fftease/src/dentist~.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-01-19 21:11:59 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-01-19 21:11:59 +0000
commitcada39a002fbbe9bc848f963c3eb7faa65122228 (patch)
treea6b4c611989fa15cf0f59c656c81a2e388041324 /externals/grill/fftease/src/dentist~.cpp
parent9ff5ccdea43ff2a954c1a400516dc6858e188e9c (diff)
""
svn path=/trunk/; revision=345
Diffstat (limited to 'externals/grill/fftease/src/dentist~.cpp')
-rw-r--r--externals/grill/fftease/src/dentist~.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/externals/grill/fftease/src/dentist~.cpp b/externals/grill/fftease/src/dentist~.cpp
index 14a08688..ec854adf 100644
--- a/externals/grill/fftease/src/dentist~.cpp
+++ b/externals/grill/fftease/src/dentist~.cpp
@@ -24,7 +24,7 @@ protected:
virtual V Transform(I _N2,S *const *in);
- I *_bin_selection;
+ BL *_bin_selection;
I _teeth;
F _knee;
I _max_bin; // determined by _knee and fundamental frequency
@@ -63,7 +63,7 @@ V dentist::setup(t_classid c)
dentist::dentist(I argc,const t_atom *argv):
- fftease(4,F_BALANCED|F_BITSHUFFLE|F_CONVERT),
+ fftease(4,F_BALANCED|F_BITSHUFFLE),
_knee(500),_teeth(10)
{
/* parse and set object's options given */
@@ -86,15 +86,13 @@ dentist::dentist(I argc,const t_atom *argv):
V dentist::Clear()
{
- fftease::Clear();
-
_bin_selection = NULL;
+ fftease::Clear();
}
V dentist::Delete()
{
fftease::Delete();
-
if(_bin_selection) delete[] _bin_selection;
}
@@ -119,17 +117,17 @@ V dentist::Set()
{
fftease::Set();
- _bin_selection = new I[get_N()/2];
+ _bin_selection = new BL[get_N()/2];
// calculation of _max_bin
ms_knee(_knee);
}
-V dentist::Transform(I _N2,S *const *in)
+V dentist::Transform(I _N,S *const *in)
{
- for(I i = 0; i < _N2 ; i++){
- if( !_bin_selection[i] ) _channel1[i*2] = 0;
- }
+ const BL *bs = _bin_selection;
+ for(I i = 0; i < _N ; i += 2)
+ if(!*(bs++)) _channel1[i] = 0;
}
@@ -145,7 +143,7 @@ V dentist::reset_shuffle()
// clear and set random bins
I i;
for( i = 0; i < _N2; i++ )
- _bin_selection[i] = 0;
+ _bin_selection[i] = false;
for( i = 0; i < t; i++ )
- _bin_selection[rand()%_max_bin] = 1;
+ _bin_selection[rand()%_max_bin] = true;
}