38 using namespace Nsound;
61 y <<
play(0.600, 261.616)
62 <<
play(0.600, 293.656)
63 <<
play(0.600, 329.609)
64 <<
play(0.600, 349.218)
65 <<
play(0.600, 391.973)
66 <<
play(1.800, 445.000);
75 return play(duration, frequency, 1.8, 1000.0, 0.2);
94 << sin.
drawLine(156.0 / 256.0, 1.0, -1.0)
95 << sin.
drawLine( 20.0 / 256.0, -1.0, -1.0);
97 float64 env_peak = (0.55 + 0.3 * pressure);
100 << sin.
drawLine(duration - 0.015, env_peak, env_peak)
101 << sin.
drawLine(0.01, env_peak, 0.0);
105 Buffer pressurem = vibrato_env * sin.
generate(duration, 5.0) + 1.0;
107 pressurem *= (0.3 * env1);
117 for(
uint32 n = 0; n < n_samples; ++n)
121 float64 x = -1.0 * pressurem[n] - 0.95 * filter_out - reed_stiffness;
127 x *= reed_wave[reed_index];
132 reed_bell = delay2.
read();
134 x = atone.
filter(reed_bell);
149 << sin.
drawLine(duration - 0.02, 1.0, 1.0)
AudioStream play()
Plays a demo for this instrument.
AudioStream filter(const AudioStream &x)
AudioStream substream(uint32 start_index, uint32 n_samples=0) const
A class for filtering audio in the frequecy domain.
uint32 getLength() const
Returns the number of samples in the Buffer.
void normalize()
Multiplies the AudioStream by a constant gain so the peak sample has magnitude 1.0.
virtual float64 generate(const float64 &frequency)
This is a real-time method for the wavetable oscillator.
A class for filtering audio in the frequecy domain.
Clarinet(const float64 &sample_rate)
Creates a Bass Kick Drum.
The Nsound Instrument baseclass. All Nsound instruments extend this class.
A Buffer for storing audio samples.
AudioStream filter(const AudioStream &x)
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.