Classes |
struct | phase |
Public Member Functions |
| ADSR () |
| Constructor.
|
void | update () |
| Updates the internal controls of the ADSR.
|
unsigned int | next () |
| Advances one audio step along the ADSR and returns the level.
|
void | noteOn () |
| Start the attack phase of the ADSR.
|
void | noteOff () |
| Start the release phase of the ADSR.
|
void | setAttackLevel (byte value) |
| Set the attack level of the ADSR.
|
void | setDecayLevel (byte value) |
| Set the decay level of the ADSR.
|
void | setSustainLevel (byte value) |
| Set the sustain level of the ADSR.
|
void | setReleaseLevel (byte value) |
| Set the release level of the ADSR.
|
void | setADLevels (byte attack, byte decay) |
| Set the attack and decay levels of the ADSR.
|
void | setAttackTime (unsigned int msec) |
| Set the attack time of the ADSR in milliseconds.
|
void | setDecayTime (unsigned int msec) |
| Set the decay time of the ADSR in milliseconds.
|
void | setSustainTime (unsigned int msec) |
| Set the sustain time of the ADSR in milliseconds.
|
void | setReleaseTime (unsigned int msec) |
| Set the release time of the ADSR in milliseconds.
|
void | setTimes (unsigned int attack_ms, unsigned int decay_ms, unsigned int sustain_ms, unsigned int release_ms) |
| Set the attack, decay and release times of the ADSR in milliseconds.
|
template<unsigned int CONTROL_UPDATE_RATE>
class ADSR< CONTROL_UPDATE_RATE >
A simple ADSR envelope generator.
- Todo:
- Test whether using the template parameter makes any difference to speed, and rationalise which units which do and don't need them. Template objects are messy when you try to use pointers to them, you have to include the whole template shebang in the pointer handling.
Definition at line 38 of file ADSR.h.
template<unsigned int CONTROL_UPDATE_RATE>
void ADSR< CONTROL_UPDATE_RATE >::setTimes |
( |
unsigned int |
attack_ms, |
|
|
unsigned int |
decay_ms, |
|
|
unsigned int |
sustain_ms, |
|
|
unsigned int |
release_ms |
|
) |
| [inline] |
Set the attack, decay and release times of the ADSR in milliseconds.
The actual times will be resolved within the resolution of CONTROL_RATE.
- Parameters:
-
attack_ms | the new attack time in milliseconds. |
decay_ms | the new decay time in milliseconds. |
decay_ms | the new sustain time in milliseconds. |
release_ms | the new release time in milliseconds. |
Definition at line 295 of file ADSR.h.