35 using namespace Nsound;
47 waveform <<
drawLine(third, 0.0, 1.0);
48 waveform <<
drawLine(third, 1.0, -1.0);
49 waveform <<
drawLine(third, -1.0, 0.0);
54 while(waveform.
getLength() < n) waveform << 0.0;
62 ctor(sample_rate, waveform);
79 waveform <<
drawLine(attack_time, 0, 1.0);
82 waveform <<
drawLine(1.0 - attack_time - release_time, 1.0, -1.0);
86 waveform <<
drawLine(release_time, -1.0, 0.0);
89 ctor(sample_rate, waveform);
115 const float64 & percent_lambda_1,
116 const float64 & percent_lambda_2,
118 const float64 & percent_lambda_3,
119 const float64 & percent_lambda_4,
120 const float64 & percent_lambda_5,
122 const float64 & percent_lambda_6)
130 waveform << line.
drawLine(percent_lambda_1,
134 waveform << line.
drawLine(percent_lambda_2 - percent_lambda_1,
138 waveform << line.
drawLine(percent_lambda_3 - percent_lambda_2,
142 waveform << line.
drawLine(percent_lambda_4 - percent_lambda_3,
146 waveform << line.
drawLine(percent_lambda_5 - percent_lambda_4,
150 waveform << line.
drawLine(percent_lambda_6 - percent_lambda_5,
154 waveform << line.
drawLine(1.0 - percent_lambda_6,
164 const float64 & percent_lambda_1,
165 const float64 & percent_lambda_2,
167 const float64 & percent_lambda_3,
168 const float64 & percent_lambda_4,
169 const float64 & percent_lambda_5,
199 ctor(sample_rate, waveform);
Buffer subbuffer(uint32 start_index, uint32 n_samples=0) const
Slice the Buffer.
Triangle(const Nsound::float64 &sample_rate)
#define M_ASSERT_VALUE(a, op, value)
virtual void ctor(const float64 &sample_rate)
DOXME.
uint32 getLength() const
Returns the number of samples in the Buffer.
Buffer drawTriangle(const float64 &sample_rate, const float64 &percent_lambda_1, const float64 &percent_lambda_2, const float64 &litude_2, const float64 &percent_lambda_3, const float64 &percent_lambda_4, const float64 &percent_lambda_5, const float64 &litude_5, const float64 &percent_lambda_6)
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.
A class the provides draw utilities and a wavetable oscillator.