38 using namespace Nsound;
46 n_smooth_samples_(n_smooth_samples)
66 <<
drawLine(duration - (1.0 / frequency), 0.0, 0.0)
79 for(
uint32 n = 0; n < n_samples; ++n)
84 delay.
write(x[n] + y[n]);
float64 sample_rate_
Used to determine when to create a sync sample.
Pluck(const float64 &sample_rate, uint32 n_smooth_samples)
void smooth(uint32 n_passes, uint32 n_samples_per_average)
Applies a moving average filter to smooth this Buffer.
void normalize()
Multiplies the Buffer by a constant gain so the peak sample has magnitude 1.0.
A Buffer for storing audio samples.
Buffer whiteNoise(const float64 &duration) const
This method generates noise from a uniform distribution.
AudioStream filter(const AudioStream &x)
Buffer generate(const float64 &duration, const float64 &frequency)
Implements simple Karplus-Strong plucked string.
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.
AudioStream filter(const AudioStream &x)
A class the provides draw utilities and a wavetable oscillator.