36 using namespace Nsound;
43 const float64 & sustain_amplitude,
46 sample_rate_(sample_rate),
48 attack_time_(attack_time),
50 delay_time_(delay_time),
51 sustain_amp_(sustain_amplitude),
53 release_time_(release_time),
144 out[i] =
shape(as[i]);
159 if(sustain_time < 0) sustain_time = 0;
174 out <<
shape(*itor,
true);
182 while(count < sustain_samples && itor != end)
184 out <<
shape(*itor,
true);
191 while(!
is_done() && itor != end)
193 out <<
shape(*itor,
false);
void setReleaseTime(const float64 &time)
#define M_ASSERT_VALUE(a, op, value)
float64 getSampleRate() const
Returns the sample rate of the stream.
void setSustainAmplitude(const float64 &)
uint32 getLength() const
Returns the number of samples in the Buffer.
iterator end()
Retruns the itreator at the end of the Buffer.
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
EnvelopeAdsr(const float64 &sample_rate, const float64 &attack_time, const float64 &delay_time, const float64 &sustain_amplitude, const float64 &release_time)
Constructor.
FloatVector::const_iterator const_iterator
iterator begin()
Retruns the itreator at the start of the Buffer.
AudioStream shape(const AudioStream &as)
Shapes the AudioStream inplace.
void setAttackTime(const float64 &time)
A Buffer for storing audio samples.
void setDelayTime(const float64 &time)