Nsound
0.9.4
|
#include <Nsound/EnvelopeAdsr.h>
Public Member Functions | |
EnvelopeAdsr (const float64 &sample_rate, const float64 &attack_time, const float64 &delay_time, const float64 &sustain_amplitude, const float64 &release_time) | |
Constructor. More... | |
void | reset () |
void | setAttackTime (const float64 &time) |
void | setDelayTime (const float64 &time) |
void | setSustainAmplitude (const float64 &) |
void | setReleaseTime (const float64 &time) |
AudioStream | shape (const AudioStream &as) |
Shapes the AudioStream inplace. More... | |
Buffer | shape (const Buffer &buf) |
Shapes the Buffer inplace. More... | |
float64 | shape (float64 sample, bool key_on) |
Realtime interface. More... | |
bool | is_done () const |
Protected Types | |
enum | Mode { attacking, delaying, sustaining, releasing, done } |
Definition at line 69 of file EnvelopeAdsr.h.
|
protected |
Enumerator | |
---|---|
attacking | |
delaying | |
sustaining | |
releasing | |
done |
Definition at line 110 of file EnvelopeAdsr.h.
EnvelopeAdsr::EnvelopeAdsr | ( | const float64 & | sample_rate, |
const float64 & | attack_time, | ||
const float64 & | delay_time, | ||
const float64 & | sustain_amplitude, | ||
const float64 & | release_time | ||
) |
Constructor.
Definition at line 39 of file EnvelopeAdsr.cc.
References M_ASSERT_VALUE, setAttackTime(), setDelayTime(), and setReleaseTime().
void EnvelopeAdsr::reset | ( | ) |
void EnvelopeAdsr::setAttackTime | ( | const float64 & | time | ) |
Definition at line 81 of file EnvelopeAdsr.cc.
References attack_slope_, attack_time_, M_ASSERT_VALUE, and sample_rate_.
Referenced by EnvelopeAdsr().
void EnvelopeAdsr::setDelayTime | ( | const float64 & | time | ) |
Definition at line 97 of file EnvelopeAdsr.cc.
References delay_slope_, delay_time_, M_ASSERT_VALUE, and sample_rate_.
Referenced by EnvelopeAdsr().
void EnvelopeAdsr::setSustainAmplitude | ( | const float64 & | amp | ) |
void EnvelopeAdsr::setReleaseTime | ( | const float64 & | time | ) |
Definition at line 122 of file EnvelopeAdsr.cc.
References M_ASSERT_VALUE, release_slope_, release_time_, and sample_rate_.
Referenced by EnvelopeAdsr().
AudioStream EnvelopeAdsr::shape | ( | const AudioStream & | as | ) |
Shapes the AudioStream inplace.
Definition at line 138 of file EnvelopeAdsr.cc.
References Nsound::AudioStream::getNChannels(), and Nsound::AudioStream::getSampleRate().
Referenced by shape().
Shapes the Buffer inplace.
Definition at line 152 of file EnvelopeAdsr.cc.
References attack_time_, attacking, Nsound::Buffer::begin(), delay_time_, Nsound::Buffer::end(), Nsound::Buffer::getLength(), is_done(), mode_, release_time_, sample_rate_, shape(), and sustaining.
Realtime interface.
Definition at line 202 of file EnvelopeAdsr.cc.
References attack_slope_, attacking, delay_slope_, delaying, done, M_ASSERT_VALUE, mode_, release_slope_, releasing, scale_, sustain_amp_, and sustaining.
|
inline |
|
protected |
Definition at line 100 of file EnvelopeAdsr.h.
Referenced by setAttackTime(), setDelayTime(), setReleaseTime(), and shape().
|
protected |
Definition at line 101 of file EnvelopeAdsr.h.
Referenced by setAttackTime(), and shape().
|
protected |
Definition at line 102 of file EnvelopeAdsr.h.
Referenced by setAttackTime(), and shape().
|
protected |
Definition at line 103 of file EnvelopeAdsr.h.
Referenced by setDelayTime(), and shape().
|
protected |
Definition at line 104 of file EnvelopeAdsr.h.
Referenced by setDelayTime(), and shape().
|
protected |
Definition at line 105 of file EnvelopeAdsr.h.
Referenced by setSustainAmplitude(), and shape().
|
protected |
Definition at line 106 of file EnvelopeAdsr.h.
Referenced by setReleaseTime(), and shape().
|
protected |
Definition at line 107 of file EnvelopeAdsr.h.
Referenced by setReleaseTime(), and shape().
|
protected |
Definition at line 108 of file EnvelopeAdsr.h.
|
protected |
Definition at line 112 of file EnvelopeAdsr.h.