36 using namespace Nsound;
43 #define THIS_FILE "test_pluck.cc"
45 int main(
int argc,
char ** argv)
47 Pluck pluck(44100, 1024);
52 <<
"pluck.generate() ..." << flush;
58 cout <<
" " <<
Toc() <<
" seconds" << endl << flush;
64 <<
"pluck.generate(): plucking 6 strings: guitar chord E ..."
82 final.
add(string5, offset );
83 final.add(string4, offset * 2);
84 final.add(string3, offset * 3);
85 final.add(string2, offset * 4);
86 final.add(string1, offset * 5);
90 cout <<
" " <<
Toc() <<
" seconds" << endl << flush;
96 output >>
"test_pluck.wav";
Implements a simple Karplus-Strong String Synthesis algorithim.
int main(int argc, char **argv)
Buffer silence(const float64 &duration) const
This method generates silence.
A Buffer for storing audio samples.
Buffer generate(const float64 &duration, const float64 &frequency)
Implements simple Karplus-Strong plucked string.
void add(const Buffer &buffer, uint32 offset=0, uint32 n_samples=0)
This method adds buffer to *this.
AudioStream getReverse() const
Reverses the samples in the AudioStream.