10 |
#include "lfobench.h" |
#include "lfobench.h" |
11 |
|
|
12 |
#include "../src/engines/common/LFOSquareIntMath.h" |
#include "../src/engines/common/LFOSquareIntMath.h" |
13 |
#include "../src/engines/common/PulseLFO.h" |
#include "../src/engines/common/LFOSquarePulse.h" |
14 |
|
|
15 |
// return value of this benchmark |
// return value of this benchmark |
16 |
// to indicate the best performing solution |
// to indicate the best performing solution |
20 |
|
|
21 |
#if SIGNED |
#if SIGNED |
22 |
LFOSquareIntMath<LFO::range_signed>* pSquareIntLFO = NULL; |
LFOSquareIntMath<LFO::range_signed>* pSquareIntLFO = NULL; |
23 |
SquareLFO<LFO::range_signed>* pSquarePulse = NULL; |
LFOSquarePulse<LFO::range_signed>* pSquarePulse = NULL; |
24 |
#else // unsigned |
#else // unsigned |
25 |
LFOSquareIntMath<LFO::range_unsigned>* pSquareIntLFO = NULL; |
LFOSquareIntMath<LFO::range_unsigned>* pSquareIntLFO = NULL; |
26 |
SquareLFO<LFO::range_unsigned>* pSquarePulse = NULL; |
LFOSquarePulse<LFO::range_unsigned>* pSquarePulse = NULL; |
27 |
#endif |
#endif |
28 |
|
|
29 |
double square_int_math(smpl_t* pDestinationBuffer, float* pAmp, const int steps, const float frequency) { |
double square_int_math(smpl_t* pDestinationBuffer, float* pAmp, const int steps, const float frequency) { |
95 |
|
|
96 |
#if SIGNED |
#if SIGNED |
97 |
pSquareIntLFO = new LFOSquareIntMath<LFO::range_signed>(MAX); |
pSquareIntLFO = new LFOSquareIntMath<LFO::range_signed>(MAX); |
98 |
pSquarePulse = new SquareLFO<LFO::range_signed>(MAX); |
pSquarePulse = new LFOSquarePulse<LFO::range_signed>(MAX); |
99 |
#else // unsigned |
#else // unsigned |
100 |
pSquareIntLFO = new LFOSquareIntMath<LFO::range_unsigned>(MAX); |
pSquareIntLFO = new LFOSquareIntMath<LFO::range_unsigned>(MAX); |
101 |
pSquarePulse = new SquareLFO<LFO::range_unsigned>(MAX); |
pSquarePulse = new LFOSquarePulse<LFO::range_unsigned>(MAX); |
102 |
#endif |
#endif |
103 |
|
|
104 |
// output buffer for the calculated sinusoid wave |
// output buffer for the calculated sinusoid wave |