Skip to content

Commit

Permalink
PV_Whiten now can use LocalBufs
Browse files Browse the repository at this point in the history
git-svn-id: https://sc3-plugins.svn.sourceforge.net/svnroot/sc3-plugins@441 a81c72af-a122-0410-9629-e4559562533e
  • Loading branch information
danstowell committed Jun 24, 2010
1 parent 314d243 commit a7a447b
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions source/MCLDFFTUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,10 +1386,30 @@ void PV_Whiten_next(PV_Whiten *unit, int inNumSamples){
uint32 ibufnum1 = (int)fbufnum1;
uint32 ibufnum2 = (int)fbufnum2;
World *world = unit->mWorld;
if (ibufnum1 >= world->mNumSndBufs) ibufnum1 = 0;
if (ibufnum2 >= world->mNumSndBufs) ibufnum2 = 0;
SndBuf *buf1 = world->mSndBufs + ibufnum1;
SndBuf *buf2 = world->mSndBufs + ibufnum2;
SndBuf *buf1;
if (ibufnum1 >= world->mNumSndBufs) {
int localBufNum = ibufnum1 - world->mNumSndBufs;
Graph *parent = unit->mParent;
if(localBufNum <= parent->localBufNum) {
buf1 = parent->mLocalSndBufs + localBufNum;
} else {
buf1 = world->mSndBufs;
}
} else {
buf1 = world->mSndBufs + ibufnum1;
}
SndBuf *buf2;
if (ibufnum2 >= world->mNumSndBufs) {
int localBufNum = ibufnum2 - world->mNumSndBufs;
Graph *parent = unit->mParent;
if(localBufNum <= parent->localBufNum) {
buf2 = parent->mLocalSndBufs + localBufNum;
} else {
buf2 = world->mSndBufs;
}
} else {
buf2 = world->mSndBufs + ibufnum2;
}
int numbins = buf1->samples - 2 >> 1;
// Print("\nibufnum1: %d; ibufnum2: %d", ibufnum1, ibufnum2);
// if (buf1->samples != buf2->samples) return;
Expand Down

0 comments on commit a7a447b

Please sign in to comment.