22#include <cxxtest/TestSuite.h>
41 synth->buffersize = 256;
42 synth->oscilsize = 1024;
46 memset(
outL, 0,
sizeof(
float) *
synth->oscilsize);
47 memset(
outR, 0,
sizeof(
float) *
synth->oscilsize);
52 for(
int i = 0;
i <
synth->buffersize; ++
i)
62 XMLwrapper *wrap =
new XMLwrapper();
64 +
string(
"/guitar-adnote.xmz"));
65 TS_ASSERT(wrap->enterbranch(
"MASTER"));
66 TS_ASSERT(wrap->enterbranch(
"PART", 0));
67 TS_ASSERT(wrap->enterbranch(
"INSTRUMENT"));
68 TS_ASSERT(wrap->enterbranch(
"INSTRUMENT_KIT"));
69 TS_ASSERT(wrap->enterbranch(
"INSTRUMENT_KIT_ITEM", 0));
70 TS_ASSERT(wrap->enterbranch(
"ADD_SYNTH_PARAMETERS"));
71 TS_ASSERT(wrap->enterbranch(
"VOICE", 0));
72 TS_ASSERT(wrap->enterbranch(
"OSCIL"));
73 oscil->getfromXML(wrap);
79 const char testnote = 50;
80 freq = 440.0f * powf(2.0f, (testnote - 69.0f) / 12.0f);
102 TS_ASSERT_DELTA(
outL[23], -0.044547f, 0.0001f);
103 TS_ASSERT_DELTA(
outL[129], -0.018169f, 0.0001f);
104 TS_ASSERT_DELTA(
outL[586], 0.045647f, 0.0001f);
105 TS_ASSERT_DELTA(
outL[1023], -0.038334f, 0.0001f);
111 TS_ASSERT_DELTA(
outR[0], 350.698059f, 0.0001f);
112 TS_ASSERT_DELTA(
outR[1], 228.889267f, 0.0001f);
113 TS_ASSERT_DELTA(
outR[2], 62.187931f, 0.0001f);
114 TS_ASSERT_DELTA(
outR[3], 22.295225f, 0.0001f);
115 TS_ASSERT_DELTA(
outR[4], 6.942001f, 0.0001f);
116 TS_ASSERT_DELTA(
outR[26], 0.015110f, 0.0001f);
117 TS_ASSERT_DELTA(
outR[47], 0.003425f, 0.0001f);
118 TS_ASSERT_DELTA(
outR[65], 0.001293f, 0.0001f);
123 const int samps = 15000;
126 for(
int i = 0;
i < samps; ++
i)
130 printf(
"OscilGenTest: %f seconds for %d prepares.\n",
131 (
static_cast<float>(t_off - t_on)) / CLOCKS_PER_SEC, samps);
134 for(
int i = 0;
i < samps; ++
i)
138 printf(
"OscilGenTest: %f seconds for %d gets.\n",
139 (
static_cast<float>(t_off - t_on)) / CLOCKS_PER_SEC, samps);
SYNTH_T * synth
Definition LocalZynAddSubFx.cpp:47
SYNTH_T * synth
Definition OscilGenTest.h:26
void FFT_cleanup()
Definition FFTwrapper.cpp:82
float * denormalkillbuf
Definition Util.cpp:46
Definition FFTwrapper.h:32
Definition OscilGenTest.h:31
void testSpectrum(void)
Definition OscilGenTest.h:108
float freq
Definition OscilGenTest.h:33
float * outL
Definition OscilGenTest.h:34
FFTwrapper * fft
Definition OscilGenTest.h:35
OscilGen * oscil
Definition OscilGenTest.h:36
void tearDown()
Definition OscilGenTest.h:83
void testInit(void)
Definition OscilGenTest.h:94
float * outR
Definition OscilGenTest.h:34
void testOutput(void)
Definition OscilGenTest.h:99
void setUp()
Definition OscilGenTest.h:38
void testSpeed()
Definition OscilGenTest.h:122
register unsigned i
Definition inflate.c:1575
Definition juce_Uuid.h:141
#define SOURCE_DIR
Definition zynaddsubfx-src.cpp:21