Fixed segfault from missing vector resize

This commit is contained in:
Sam Perry
2017-03-06 16:23:08 +00:00
parent 87decc5009
commit 0375a564a7
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ class Compressor
else y_g[i] = x_g[i];
x_l[i] = x_g[i] - y_g[i];
//Ballistics- smoothing of the gain
if (x_l[i]>yL_prev) y_l[i]=alphaAttack * yL_prev+(1 - alphaAttack ) * x_l[i] ;
if (x_l[0]>yL_prev) y_l[i]=alphaAttack * yL_prev+(1 - alphaAttack ) * x_l[i] ;
else y_l[i]=alphaRelease* yL_prev+(1 - alphaRelease) * x_l[i] ;
//find control
c[i] = pow(10,(makeUpGain - y_l[i])/20);
+1
View File
@@ -213,6 +213,7 @@ void Assignment1Processor::prepareToPlay (double sampleRate, int samplesPerBlock
// Compressor initialisation
//////////////////////////////////////////////////////////////////////////
// Allocate memory for compressor objects
compressors_.resize(numChannels);
for( auto &it : compressors_ )
{
it.resize(numCompPerChannel);