Skip to content

Commit 94c9f2d

Browse files
author
Martin Klang
committed
init params and sensible smoothing
1 parent 270fc7a commit 94c9f2d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Maximilian/MaximilianPatch.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66

77
static maxiParam* maxiParameters[8];
88
static unsigned int maxiParameterCount = 0;
9-
maxiParam::maxiParam() : value(0.0), minValue(0.0), maxValue(1.0),
9+
maxiParam::maxiParam() : value(0.5), minValue(0.0), maxValue(1.0),
1010
name(NULL), pid(maxiParameterCount++){
1111
if(pid < 8)
1212
maxiParameters[pid] = this;
1313
}
1414

1515
void maxiParam::update(double v){
16+
#ifdef ARM_CORTEX
1617
const static double lambda = 0.9; // factor for exponential smoothing
18+
#else
19+
const static double lambda = 0.5; // factor for exponential smoothing
20+
#endif
1721
value = value*lambda + scale(v)*(1-lambda);
1822
}
1923

0 commit comments

Comments
 (0)