Merge pull request #15 from arielelkin/fix-variable-types-in-TapDelay

Fix variable types in tap delay
This commit is contained in:
garyscavone
2014-04-07 10:07:22 -04:00
2 changed files with 9 additions and 5 deletions

View File

@@ -166,8 +166,10 @@ inline StkFrames& TapDelay :: tick( StkFrames& frames, unsigned int channel )
StkFloat *iSamples = &frames[channel];
StkFloat *oSamples = &frames[0];
unsigned int j, iHop = frames.channels(), oHop = frames.channels() - outPoint_.size();
for ( unsigned int i=0; i<frames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
std::size_t j;
unsigned int iHop = frames.channels();
std::size_t oHop = frames.channels() - outPoint_.size();
for ( unsigned long i=0; i<frames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
inputs_[inPoint_++] = *iSamples * gain_;
if ( inPoint_ == inputs_.size() ) inPoint_ = 0;
for ( j=0; j<outPoint_.size(); j++ ) {
@@ -196,8 +198,10 @@ inline StkFrames& TapDelay :: tick( StkFrames& iFrames, StkFrames& oFrames, unsi
StkFloat *iSamples = &iFrames[iChannel];
StkFloat *oSamples = &oFrames[0];
unsigned int j, iHop = iFrames.channels(), oHop = oFrames.channels() - outPoint_.size();
for ( unsigned int i=0; i<iFrames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
std::size_t j;
unsigned int iHop = iFrames.channels();
std::size_t oHop = oFrames.channels() - outPoint_.size();
for ( unsigned long i=0; i<iFrames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
inputs_[inPoint_++] = *iSamples * gain_;
if ( inPoint_ == inputs_.size() ) inPoint_ = 0;
for ( j=0; j<outPoint_.size(); j++ ) {

View File

@@ -72,7 +72,7 @@ void TapDelay :: setTapDelays( std::vector<unsigned long> taps )
if ( taps.size() != outPoint_.size() ) {
outPoint_.resize( taps.size() );
delays_.resize( taps.size() );
lastFrame_.resize( 1, taps.size(), 0.0 );
lastFrame_.resize( 1, (unsigned int)taps.size(), 0.0 );
}
for ( unsigned int i=0; i<taps.size(); i++ ) {