Fixed segfault from missing vector resize
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user