Mercurial > hg > wabletios
diff scanpath.mm @ 13:426d645d8e69
Changed max min audio, saving now saves rest lump positions.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 26 Jun 2013 17:23:30 +0100 |
parents | 0e03760cf2d9 |
children | 4ba81a12b008 |
line wrap: on
line diff
--- a/scanpath.mm Mon May 20 11:09:14 2013 +0100 +++ b/scanpath.mm Wed Jun 26 17:23:30 2013 +0100 @@ -295,17 +295,21 @@ double sample = (1 - frameInterpolator)*oldsample + frameInterpolator*newsample; //cout << sample << endl; // keep within the bounds of acceptability + sample = sample*3.0; + if(sample > 0.99){ - // cout << "OUCH\n"; + cout << "BIG" << endl; + sample = 0.99; - }else if(sample < -0.99){ - sample = -0.99; + }else if(sample < -0.0){ + cout << "SMALL" << endl; + sample = 0.0; } return sample; } //---------------------------------------------------------------- -// get next sample +// get next sample: just one sample at a time at sample rate double ScanPath::getNextSample(){ // move along wavetable, no interpolation ie: length of path is pitch static int n = 0; @@ -324,7 +328,17 @@ } double sample = (1 - frameInterpolator)*oldsample + frameInterpolator*newsample; - return sample*3.0; + // beef up + sample = sample*10.0; + + if(sample > 0.99){ + cout << "BIG" << endl; + + sample = 0.99; + }else if(sample < -0.0){ + cout << "SMALL" << endl; + sample = 0.0; + } } //---------------------------------------------------------------- @@ -395,12 +409,15 @@ // keep within the bounds of acceptability // beef up - sample = sample*3.0; + sample = sample*10.0; if(sample > 0.99){ + cout << "BIG" << endl; + sample = 0.99; - }else if(sample < -0.99){ - sample = -0.99; + }else if(sample < -0.0){ + cout << "SMALL" << endl; + sample = 0.0; } return sample;