39 using namespace Nsound;
47 main(
int argc,
char ** argv)
59 waves_per_grain << 2.0;
64 cout <<
"gran.generate() ... " << flush;
68 output << 0.6 * grains.
generate(5, grain_freqs, waves_per_grain, grains_per_second);
70 cout <<
Toc() <<
" seconds" << endl << flush;
72 output >>
"grains.wav";
Nsound::Buffer generate(const float64 &duration, const float64 &grain_frequency, const float64 &waves_per_grain, const float64 &grains_per_second)
Buffer drawDecay(const float64 &duration, const float64 &alpha=2.0 *M_PI) const
This method draws an exponential curve that decays from 1.0 to 0.0 over the duration.
A Buffer for storing audio samples.
int main(int argc, char **argv)
static void setDefaultSampleRate(const int32 rate)
static void setDefaultSampleSize(uint32 size)