40 using namespace Nsound;
99 y <<
play(1.0, 1.0,
true);
103 y.
add(
play(1.0, 1.0,
true), 1 * offset);
104 y.
add(
play(1.0, 1.0,
false), 2 * offset);
105 y.
add(
play(1.0, 1.0,
true) , 3 * offset);
107 y.
add(
play(1.0, 1.0,
true) , 4 * offset);
108 y.
add(
play(1.0, 1.0,
true) , 5 * offset);
109 y.
add(
play(1.0, 1.0,
true) , 6 * offset);
110 y.
add(
play(1.0, 1.0,
false), 7 * offset);
112 y.
add(
play(1.0, 1.0,
true) , 8 * offset);
113 y.
add(
play(1.0, 1.0,
true) , 9 * offset);
114 y.
add(
play(1.0, 1.0,
false), 10 * offset);
115 y.
add(
play(1.0, 1.0,
true) , 11 * offset);
117 y.
add(
play(1.0, 1.0,
true) , 12 * offset);
118 y.
add(
play(1.0, 1.0,
true) , 13 * offset);
119 y.
add(
play(1.0, 1.0,
true) , 14 * offset);
120 y.
add(
play(1.0, 1.0,
false), 15 * offset);
122 y.
add(
play(1.0, 1.0,
true) , 16 * offset);
123 y.
add(
play(1.0, 1.0,
true) , 17 * offset);
124 y.
add(
play(1.0, 1.0,
false), 18 * offset);
125 y.
add(
play(1.0, 1.0,
true) , 19 * offset);
127 y.
add(
play(1.0, 1.0,
true) , 20 * offset);
128 y.
add(
play(1.0, 1.0,
true) , 21 * offset);
129 y.
add(
play(1.0, 1.0,
true) , 22 * offset);
130 y.
add(
play(1.0, 1.0,
false), 23 * offset);
132 y.
add(
play(1.0, 0.9,
true) , 24 * offset);
133 y.
add(
play(1.0, 0.8,
true) , 25 * offset);
134 y.
add(
play(1.0, 0.7,
true) , 26 * offset);
135 y.
add(
play(1.0, 0.6,
true) , 27 * offset);
137 y.
add(
play(1.0, 0.5,
true) , 28 * offset);
138 y.
add(
play(1.0, 0.4,
true) , 29 * offset);
139 y.
add(
play(1.0, 0.3,
true) , 30 * offset);
140 y.
add(
play(1.0, 0.2,
true) , 31 * offset);
154 float64 play_duration = duration;
155 float64 silence_duration = 0.0;
157 float64 env_offset = 0.55 * play_duration;
161 play_duration *= 0.06;
162 silence_duration = duration - play_duration;
166 float64 frequency = tune * 530.0;
AudioStream play()
Plays a demo for this instrument.
Hat(const float64 &sample_rate)
Creates a Hat.
Hat & operator=(const Hat &rhs)
Assignment.
A class for filtering audio in the frequecy domain.
Buffer silence(const float64 &duration) const
This method generates silence.
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.
void add(const AudioStream &as, uint32 offset, uint32 n_samples=0)
This method adds the passed AudioStream to this AudioStream.
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.