40 using namespace Nsound;
47 static const char *
THIS_FILE =
"Triangle_UnitTest.cc";
65 cout <<
TEST_HEADER <<
"Testing Triangle::generate(1.01, 2.0) ...";
72 gold =
Buffer(
"gold/Triangle_2Hz.wav");
81 <<
"Output did not match gold file!"
84 diff.
plot(
"data - gold");
96 cout << TEST_HEADER <<
"Testing Triangle::generate(1.01, 1.0) ...";
103 gold =
Buffer(
"gold/Triangle_1.0Hz.wav");
112 <<
"Output did not match gold file!"
115 diff.
plot(
"data - gold");
127 cout << TEST_HEADER <<
"Testing Triangle::generate(1.01, frequencies) ...";
136 gold =
Buffer(
"gold/Triangle_1_to_5Hz.wav");
145 <<
"Output did not match gold file!"
148 diff.
plot(
"data - gold");
159 cout << SUCCESS << endl;
static void show()
Acutally draw the plots to the screen.
void plot(const std::string &title="Buffer") const
Requires matplotlib. Creates a plot of this Buffer.
#define TEST_ERROR_HEADER
virtual float64 generate(const float64 &frequency)
This is a real-time method for the wavetable oscillator.
static const char * THIS_FILE
static void setIEEEFloat(boolean flag)
void abs()
Modifies the Buffer by making any negative value positive.
A Buffer for storing audio samples.
static void setDefaultSampleSize(uint32 size)
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.
float64 getMax() const
Returns the maximum sample value in the Buffer.
static const float64 GAMMA