38 using namespace Nsound;
48 hi_f_(high_frequency),
49 lo_f_( low_frequency){}
61 y <<
play(0.6, 120.0, 51.0)
62 <<
play(0.6, 120.0, 51.0)
63 <<
play(0.6, 120.0, 51.0)
64 <<
play(0.6, 120.0, 51.0);
90 << square.
drawLine(duration - 0.08, low_freq, low_freq);
92 Buffer signal = -0.5 * square.
generate(duration, signal_freqs) << 0.0;
96 << square.
drawLine(duration * 0.5, 0.2, 0.0);
98 filter_freqs *= 2.0 * signal_freqs;
114 y = f1.
filter(signal, filter_freqs);
118 y[0][1] = std::atan(y[0][i] * 20.0);
121 y = f2.
filter(y, signal_freqs * 3.0);
132 const Buffer & high_frequency,
133 const Buffer & low_frequency)
137 return play(duration, high_frequency[0], low_frequency[0]);
Implementation of Zoelzer's parametric equalizer filters, with some modifications by the author...
AudioStream play()
Plays a demo for this instrument.
uint32 getLength() const
Returns the number of samples of audio data in the stream.
DrumKickBass(const float64 &sample_rate, const float64 &high_frequency, const float64 &low_frequency)
Creates a Bass Kick Drum.
AudioStream filter(const AudioStream &x)
~DrumKickBass()
Destructor.
virtual float64 generate(const float64 &frequency)
This is a real-time method for the wavetable oscillator.
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.
The Nsound Instrument baseclass. All Nsound instruments extend this class.
A Buffer for storing audio samples.
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.