41 using namespace Nsound;
73 y <<
play(0.12, 219.98, 0.9)
74 <<
play(0.10, 195.99, 0.8)
75 <<
play(0.80, 219.98, 0.7);
78 y.
add(
play(0.16, 195.99, 0.6), 1.20f);
80 y <<
play(0.14, 174.61, 0.5)
81 <<
play(0.12, 164.80, 0.4)
82 <<
play(0.12, 146.83, 0.3)
83 <<
play(0.56, 138.58, 0.4)
84 <<
play(1.20, 146.83, 0.5);
94 y.
add(
play(0.12, 109.99), 2.80f);
96 y <<
play(0.10, 97.99)
97 <<
play(0.80, 109.99);
99 y.
add(
play(0.30, 87.30), 5.00f);
101 y <<
play(0.30, 97.99)
103 <<
play(1.20, 73.41);
115 y.
add(
play(0.12, 55.00), 7.20f);
117 y <<
play(0.10, 49.00)
118 <<
play(0.80, 55.00);
120 y.
add(
play(0.16, 49.00), 8.40f);
122 y <<
play(0.14, 43.65)
126 <<
play(1.20, 36.71);
139 y.
add(
play(2.00, 34.65), 10.5f);
140 y.
add(
play(1.80, 41.20), 10.7f);
141 y.
add(
play(1.60, 49.00), 10.9f);
142 y.
add(
play(1.40, 58.27), 11.1f);
143 y.
add(
play(1.20, 69.29), 11.3f);
144 y.
add(
play(3.20, 36.71), 12.7f);
145 y.
add(
play(3.20, 73.41), 12.7f);
146 y.
add(
play(0.08, 49.00), 12.7f);
161 return play(duration, frequency, 0.5);
180 float64 pan_right = 1.0 - pan_left;
182 float64 op1f = 1.00 * frequency;
183 float64 op2f = 2.01 * frequency;
184 float64 op3f = 3.99 * frequency;
185 float64 op4f = 8.00 * frequency;
186 float64 op5f = 0.50 * frequency;
187 float64 op7f = 16.00 * frequency;
201 << sin.
drawLine(duration - 0.002, 1.0, 1.0)
206 dclick << sin.
drawLine(duration, 1.0, 1.0);
213 << sin.
drawLine(duration - 0.02, 1.0, 1.0)
218 amp1 = sin.
drawLine(duration, 1.0, 1.0);
226 << sin.
drawLine(duration - 0.16, 0.7, 0.7)
231 amp2 = sin.
drawLine(duration, 1.0, 1.0);
239 << sin.
drawLine(duration - 0.08, 0.0, 0.0);
243 amp3 = sin.
drawLine(duration, 1.0, 1.0);
251 << sin.
drawLine(duration -0.21, 0.05, 0.1)
256 amp4 = sin.
drawLine(duration, 1.0, 1.0);
264 out += amp2 * sin.
generate(duration, p1 * op2f);
265 out += amp2 * sin.
generate(duration, op3f);
266 out += amp2 * sin.
generate(duration, op4f);
267 out += amp3 * sin.
generate(duration, 5.0 * op5f);
268 out += amp2 * sin.
generate(duration, op7f);
272 y[0] = out * dclick * pan_left;
273 y[1] = out * dclick * pan_right;
#define M_ASSERT_VALUE(a, op, value)
AudioStream play()
Plays a demo for this instrument.
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.
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.
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.
OrganPipe(const float64 &sample_rate)
Creates an OrganPipe.