mirror of https://github.com/probonopd/MiniDexed
parent
6fb78be603
commit
a264fdf230
@ -0,0 +1,11 @@ |
||||
*:../../CMSIS_5/* |
||||
toomanyconfigs:* |
||||
noExplicitConstructor:* |
||||
unusedFunction:* |
||||
missingIncludeSystem:* |
||||
unmatchedSuppression:* |
||||
|
||||
// unexplained exceptions |
||||
syntaxError:beta.cpp:52 |
||||
syntaxError:test_fx_mixing_console.cpp:207 |
||||
internalAstError:test_cpp_performance.cpp:22 |
Binary file not shown.
@ -1,67 +0,0 @@ |
||||
#include <gtest/gtest.h> |
||||
|
||||
#include "../fx_components.h" |
||||
|
||||
int nb = 0; |
||||
|
||||
int NbIteration() { |
||||
nb++; |
||||
return 3; |
||||
} |
||||
|
||||
TEST(Cpp, NbCallsInUpperBoudariesInForLoop) |
||||
{ |
||||
for(int i = 0; i < NbIteration(); ++i) |
||||
{ |
||||
// Does something
|
||||
} |
||||
EXPECT_EQ(nb, 4); |
||||
} |
||||
|
||||
#define CLASS_INIT(clazz) clazz::StaticInit() |
||||
class StaticCtorTest |
||||
{ |
||||
private: |
||||
static int n_; |
||||
|
||||
public: |
||||
int i_; |
||||
|
||||
static int StaticInit() |
||||
{ |
||||
static int i = 0; |
||||
i++; |
||||
|
||||
StaticCtorTest::n_ = 2; |
||||
|
||||
return i; |
||||
} |
||||
|
||||
StaticCtorTest() : i_(0) |
||||
{ |
||||
static int init = CLASS_INIT(StaticCtorTest); |
||||
static int NB = 0; |
||||
EXPECT_EQ(init, 1); |
||||
|
||||
this->i_ = ++NB; |
||||
|
||||
EXPECT_EQ(StaticCtorTest::n_, 2); |
||||
} |
||||
|
||||
~StaticCtorTest() |
||||
{ |
||||
} |
||||
}; |
||||
|
||||
int StaticCtorTest::n_ = 0; |
||||
|
||||
TEST(Cpp, StaticCtorTest) |
||||
{ |
||||
StaticCtorTest obj1; |
||||
StaticCtorTest obj2; |
||||
StaticCtorTest obj3; |
||||
|
||||
EXPECT_EQ(obj1.i_, 1); |
||||
EXPECT_EQ(obj2.i_, 2); |
||||
EXPECT_EQ(obj3.i_, 3); |
||||
} |
@ -0,0 +1,363 @@ |
||||
#include "test_fx_helper.h" |
||||
|
||||
#include "../fx_tube.h" |
||||
#include "../fx_chorus.h" |
||||
#include "../fx_flanger.h" |
||||
#include "../fx_orbitone.h" |
||||
#include "../fx_phaser.h" |
||||
#include "../fx_delay.h" |
||||
#include "../effect_platervbstereo.h" |
||||
#include "../fx_shimmer_reverb.h" |
||||
|
||||
TEST(LevelTuning, Tube) |
||||
{ |
||||
Tube fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setOverdrive(0.75f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for Tube"; |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, Chorus) |
||||
{ |
||||
Chorus fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setRate(0.4f); |
||||
fx.setDepth(0.5f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for Chorus"; |
||||
EXPECT_LE(ratio, 1.0f); |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, Flanger) |
||||
{ |
||||
Flanger fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setRate(0.03f); |
||||
fx.setDepth(0.75f); |
||||
fx.setFeedback(0.5f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for Flanger"; |
||||
EXPECT_LE(ratio, 1.0f); |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, Orbitone) |
||||
{ |
||||
Orbitone fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setRate(0.4f); |
||||
fx.setDepth(0.5f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for Orbitone"; |
||||
EXPECT_LE(ratio, 1.0f); |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, Phaser) |
||||
{ |
||||
Phaser fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setRate(0.1f); |
||||
fx.setDepth(1.0f); |
||||
fx.setFeedback(0.5f); |
||||
fx.setNbStages(12); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for Phaser"; |
||||
EXPECT_LE(ratio, 1.0f); |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, Delay) |
||||
{ |
||||
Delay fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setLeftDelayTime(0.15f); |
||||
fx.setLeftDelayTime(0.2f); |
||||
fx.setFeedback(0.35f); |
||||
fx.setFlutterRate(0.0f); |
||||
fx.setFlutterAmount(0.0f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for Delay"; |
||||
EXPECT_LE(ratio, 1.0f); |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, PlateReverb) |
||||
{ |
||||
AudioEffectPlateReverb fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.set_bypass(false); |
||||
fx.size(0.7f); |
||||
fx.hidamp(0.5f); |
||||
fx.lodamp(0.5f); |
||||
fx.lowpass(0.3f); |
||||
fx.diffusion(0.65f); |
||||
fx.level(1.0f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for PlateReverb"; |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
||||
|
||||
TEST(LevelTuning, ShimmerReverb) |
||||
{ |
||||
ShimmerReverb fx(SAMPLING_FREQUENCY); |
||||
fx.reset(); |
||||
fx.setInputGain(0.35f); |
||||
fx.setTime(0.89f); |
||||
fx.setDiffusion(0.75f); |
||||
fx.setLP(0.8f); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t sumIn = 0.0f; |
||||
float32_t sumOut = 0.0f; |
||||
|
||||
size_t nb_errors = 0; |
||||
|
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
float32_t inL = inSamples[0][i]; |
||||
float32_t inR = inSamples[1][i]; |
||||
float32_t outL; |
||||
float32_t outR; |
||||
sumIn += inL * inL; |
||||
|
||||
fx.processSample(inL, inR, outL, outR); |
||||
|
||||
sumOut += outL * outL; |
||||
|
||||
nb_errors += std::abs(outL) > 1.0f ? 1 : 0; |
||||
nb_errors += std::abs(outR) > 1.0f ? 1 : 0; |
||||
} |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
float32_t ratio = std::sqrt(sumOut / sumIn); |
||||
|
||||
ASSERT_EQ(nb_errors, 0) << "Sample value error for ShimmerReverb"; |
||||
EXPECT_GE(ratio, 0.9f); |
||||
EXPECT_LE(1.0f / ratio, 1.1f); |
||||
} |
@ -0,0 +1,182 @@ |
||||
#include <gtest/gtest.h> |
||||
|
||||
#include "test_fx_helper.h" |
||||
#include "../fx_shimmer_reverb.h" |
||||
|
||||
TEST(FXShimmerReverb, TransientSilence) |
||||
{ |
||||
const testing::TestInfo* test_info = testing::UnitTest::GetInstance()->current_test_info(); |
||||
std::string full_test_name = test_info->test_case_name(); |
||||
full_test_name += "."; |
||||
full_test_name += test_info->name(); |
||||
|
||||
const size_t size = static_cast<size_t>(SAMPLING_FREQUENCY); |
||||
float32_t* inSamples = new float32_t[size]; |
||||
memset(inSamples, 0, size * sizeof(float32_t)); |
||||
|
||||
float32_t* outSamplesL = new float32_t[size]; |
||||
float32_t* outSamplesR = new float32_t[size]; |
||||
memset(outSamplesL, 0, size * sizeof(float32_t)); |
||||
memset(outSamplesR, 0, size * sizeof(float32_t)); |
||||
|
||||
ShimmerReverb* shimmer = new ShimmerReverb(SAMPLING_FREQUENCY); |
||||
|
||||
shimmer->setInputGain(0.55f); |
||||
shimmer->setTime(0.75f); |
||||
shimmer->setDiffusion(0.8f); |
||||
shimmer->setLP(0.7f); |
||||
|
||||
shimmer->reset(); |
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
shimmer->processSample( |
||||
inSamples[i],
|
||||
inSamples[i],
|
||||
outSamplesL[i],
|
||||
outSamplesR[i] |
||||
); |
||||
} |
||||
|
||||
saveWaveFile(getResultFile(full_test_name + ".wav", true), outSamplesL, outSamplesR, size, SAMPLING_FREQUENCY, 16); |
||||
|
||||
delete shimmer; |
||||
|
||||
delete[] inSamples; |
||||
|
||||
delete[] outSamplesL; |
||||
delete[] outSamplesR; |
||||
} |
||||
|
||||
TEST(FXShimmerReverb, TransientSilenceWithDirac) |
||||
{ |
||||
const testing::TestInfo* test_info = testing::UnitTest::GetInstance()->current_test_info(); |
||||
std::string full_test_name = test_info->test_case_name(); |
||||
full_test_name += "."; |
||||
full_test_name += test_info->name(); |
||||
|
||||
const size_t size = 4 * static_cast<size_t>(SAMPLING_FREQUENCY); |
||||
float32_t* inSamples = new float32_t[size]; |
||||
memset(inSamples, 0, size * sizeof(float32_t)); |
||||
inSamples[0] = 1.0f; |
||||
|
||||
float32_t* outSamplesL = new float32_t[size]; |
||||
float32_t* outSamplesR = new float32_t[size]; |
||||
memset(outSamplesL, 0, size * sizeof(float32_t)); |
||||
memset(outSamplesR, 0, size * sizeof(float32_t)); |
||||
|
||||
ShimmerReverb* shimmer = new ShimmerReverb(SAMPLING_FREQUENCY); |
||||
|
||||
shimmer->setInputGain(0.55f); |
||||
shimmer->setTime(0.75f); |
||||
shimmer->setDiffusion(0.8f); |
||||
shimmer->setLP(0.7f); |
||||
|
||||
shimmer->reset(); |
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
shimmer->processSample( |
||||
inSamples[i],
|
||||
inSamples[i],
|
||||
outSamplesL[i],
|
||||
outSamplesR[i] |
||||
); |
||||
} |
||||
|
||||
saveWaveFile(getResultFile(full_test_name + ".wav", true), outSamplesL, outSamplesR, size, SAMPLING_FREQUENCY, 16); |
||||
|
||||
delete shimmer; |
||||
|
||||
delete[] inSamples; |
||||
|
||||
delete[] outSamplesL; |
||||
delete[] outSamplesR; |
||||
} |
||||
|
||||
TEST(FXShimmerReverb, TransientNoise) |
||||
{ |
||||
const testing::TestInfo* test_info = testing::UnitTest::GetInstance()->current_test_info(); |
||||
std::string full_test_name = test_info->test_case_name(); |
||||
full_test_name += "."; |
||||
full_test_name += test_info->name(); |
||||
|
||||
const size_t size = static_cast<size_t>(SAMPLING_FREQUENCY); |
||||
float32_t* inSamples = new float32_t[size]; |
||||
for(size_t i = 0; i < size; ++i) inSamples[i] = getRandomValue(); |
||||
|
||||
float32_t* outSamplesL = new float32_t[size]; |
||||
float32_t* outSamplesR = new float32_t[size]; |
||||
memset(outSamplesL, 0, size * sizeof(float32_t)); |
||||
memset(outSamplesR, 0, size * sizeof(float32_t)); |
||||
|
||||
ShimmerReverb* shimmer = new ShimmerReverb(SAMPLING_FREQUENCY); |
||||
|
||||
shimmer->setInputGain(0.55f); |
||||
shimmer->setTime(0.75f); |
||||
shimmer->setDiffusion(0.8f); |
||||
shimmer->setLP(0.7f); |
||||
|
||||
shimmer->reset(); |
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
shimmer->processSample( |
||||
inSamples[i],
|
||||
inSamples[i],
|
||||
outSamplesL[i],
|
||||
outSamplesR[i] |
||||
); |
||||
} |
||||
|
||||
saveWaveFile(getResultFile(full_test_name + ".wav", true), outSamplesL, outSamplesR, size, SAMPLING_FREQUENCY, 16); |
||||
|
||||
delete shimmer; |
||||
|
||||
delete[] inSamples; |
||||
|
||||
delete[] outSamplesL; |
||||
delete[] outSamplesR; |
||||
} |
||||
|
||||
TEST(FXShimmerReverb, TransientMusic) |
||||
{ |
||||
const testing::TestInfo* test_info = testing::UnitTest::GetInstance()->current_test_info(); |
||||
std::string full_test_name = test_info->test_case_name(); |
||||
full_test_name += "."; |
||||
full_test_name += test_info->name(); |
||||
|
||||
size_t size; |
||||
float32_t** inSamples = readWaveFile(AUDIO_SOURCE_FILE, size); |
||||
|
||||
float32_t* outSamplesL = new float32_t[size]; |
||||
float32_t* outSamplesR = new float32_t[size]; |
||||
memset(outSamplesL, 0, size * sizeof(float32_t)); |
||||
memset(outSamplesR, 0, size * sizeof(float32_t)); |
||||
|
||||
ShimmerReverb* shimmer = new ShimmerReverb(SAMPLING_FREQUENCY); |
||||
|
||||
shimmer->setInputGain(0.55f); |
||||
shimmer->setTime(0.75f); |
||||
shimmer->setDiffusion(0.8f); |
||||
shimmer->setLP(0.7f); |
||||
|
||||
shimmer->reset(); |
||||
for(size_t i = 0; i < size; ++i) |
||||
{ |
||||
shimmer->processSample( |
||||
inSamples[0][i],
|
||||
inSamples[1][i],
|
||||
outSamplesL[i],
|
||||
outSamplesR[i] |
||||
); |
||||
} |
||||
|
||||
saveWaveFile(getResultFile(full_test_name + ".wav", true), outSamplesL, outSamplesR, size, SAMPLING_FREQUENCY, 16); |
||||
|
||||
delete shimmer; |
||||
|
||||
delete[] inSamples[0]; |
||||
delete[] inSamples[1]; |
||||
delete[] inSamples; |
||||
|
||||
delete[] outSamplesL; |
||||
delete[] outSamplesR; |
||||
} |
@ -0,0 +1,130 @@ |
||||
#include "test_fx_helper.h" |
||||
|
||||
#include "../fx_dry.h" |
||||
#include "../fx_tube.h" |
||||
#include "../fx_chorus.h" |
||||
#include "../fx_flanger.h" |
||||
#include "../fx_orbitone.h" |
||||
#include "../fx_phaser.h" |
||||
#include "../fx_delay.h" |
||||
#include "../effect_platervbstereo.h" |
||||
#include "../fx_shimmer_reverb.h" |
||||
|
||||
TEST(UnitFXTuning, Dry) |
||||
{ |
||||
Dry fx(SAMPLING_FREQUENCY); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, Tube) |
||||
{ |
||||
Tube fx(SAMPLING_FREQUENCY); |
||||
fx.setOverdrive(0.5f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, Chorus) |
||||
{ |
||||
Chorus fx(SAMPLING_FREQUENCY); |
||||
fx.setRate(0.4f); |
||||
fx.setDepth(0.7f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, Flanger) |
||||
{ |
||||
Flanger fx(SAMPLING_FREQUENCY); |
||||
fx.setRate(0.03f); |
||||
fx.setDepth(0.75f); |
||||
fx.setFeedback(0.5f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, Orbitone) |
||||
{ |
||||
Orbitone fx(SAMPLING_FREQUENCY); |
||||
fx.setRate(0.4f); |
||||
fx.setDepth(0.7f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, Phaser) |
||||
{ |
||||
Phaser fx(SAMPLING_FREQUENCY); |
||||
fx.setRate(0.1f); |
||||
fx.setDepth(1.0f); |
||||
fx.setFeedback(0.5f); |
||||
fx.setNbStages(12); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, Delay) |
||||
{ |
||||
Delay fx(SAMPLING_FREQUENCY); |
||||
fx.setLeftDelayTime(0.25f); |
||||
fx.setLeftDelayTime(0.40f); |
||||
fx.setFeedback(0.55f); |
||||
fx.setFlutterRate(0.01f); |
||||
fx.setFlutterAmount(0.05f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, PlateReverb) |
||||
{ |
||||
AudioEffectPlateReverb fx(SAMPLING_FREQUENCY); |
||||
fx.set_bypass(false); |
||||
fx.size(0.7f); |
||||
fx.hidamp(0.5f); |
||||
fx.lodamp(0.5f); |
||||
fx.lowpass(0.3f); |
||||
fx.diffusion(0.65f); |
||||
fx.level(1.0f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
||||
TEST(UnitFXTuning, ShimmerReverb) |
||||
{ |
||||
ShimmerReverb fx(SAMPLING_FREQUENCY); |
||||
fx.setInputGain(0.65f); |
||||
fx.setTime(0.89f); |
||||
fx.setDiffusion(0.75f); |
||||
fx.setLP(0.8f); |
||||
|
||||
PREPARE_AUDIO_TEST(size, inSamples, outSamples, full_test_name); |
||||
SIMPLE_AUDIO_LOOP(inSamples, outSamples, size, inL, inR, outL, outR, fx); |
||||
SAVE_AUDIO_RESULTS(full_test_name, outSamples, size); |
||||
CLEANUP_AUDIO_TEST(inSamples, outSamples); |
||||
} |
||||
|
Loading…
Reference in new issue