|
JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins
« « « Anklang Documentation |
A very simple ADSR envelope class. More...
#include "juce_ADSR.h"
Classes | |
| struct | Parameters |
| Holds the parameters being used by an ADSR object. More... | |
Public Member Functions | |
| void | setParameters (const Parameters &newParameters) |
| Sets the parameters that will be used by an ADSR object. | |
| const Parameters & | getParameters () const noexcept |
| Returns the parameters currently being used by an ADSR object. | |
| bool | isActive () const noexcept |
| Returns true if the envelope is in its attack, decay, sustain or release stage. | |
| void | setSampleRate (double newSampleRate) noexcept |
| Sets the sample rate that will be used for the envelope. | |
| void | reset () noexcept |
| Resets the envelope to an idle state. | |
| void | noteOn () noexcept |
| Starts the attack phase of the envelope. | |
| void | noteOff () noexcept |
| Starts the release phase of the envelope. | |
| float | getNextSample () noexcept |
| Returns the next sample value for an ADSR object. | |
| template<typename FloatType > | |
| void | applyEnvelopeToBuffer (AudioBuffer< FloatType > &buffer, int startSample, int numSamples) |
| This method will conveniently apply the next numSamples number of envelope values to an AudioBuffer. | |
A very simple ADSR envelope class.
To use it, call setSampleRate() with the current sample rate and give it some parameters with setParameters() then call getNextSample() to get the envelope value to be applied to each audio sample or applyEnvelopeToBuffer() to apply the envelope to a whole buffer.
Do not change the parameters during playback. If you change the parameters before the release stage has completed then you must call reset() before the next call to noteOn().
@tags{Audio}
Definition at line 40 of file juce_ADSR.h.
| juce::ADSR::ADSR | ( | ) |
Definition at line 44 of file juce_ADSR.h.
| void juce::ADSR::applyEnvelopeToBuffer | ( | AudioBuffer< FloatType > & | buffer, |
| int | startSample, | ||
| int | numSamples | ||
| ) |
This method will conveniently apply the next numSamples number of envelope values to an AudioBuffer.
Definition at line 219 of file juce_ADSR.h.
|
noexcept |
Returns the next sample value for an ADSR object.
Definition at line 158 of file juce_ADSR.h.
|
noexcept |
Returns the parameters currently being used by an ADSR object.
Definition at line 93 of file juce_ADSR.h.
|
noexcept |
Returns true if the envelope is in its attack, decay, sustain or release stage.
Definition at line 96 of file juce_ADSR.h.
|
noexcept |
Starts the release phase of the envelope.
Definition at line 137 of file juce_ADSR.h.
|
noexcept |
Starts the attack phase of the envelope.
Definition at line 118 of file juce_ADSR.h.
|
noexcept |
Resets the envelope to an idle state.
Definition at line 111 of file juce_ADSR.h.
| void juce::ADSR::setParameters | ( | const Parameters & | newParameters | ) |
Sets the parameters that will be used by an ADSR object.
You must have called setSampleRate() with the correct sample rate before this otherwise the values may be incorrect!
Definition at line 80 of file juce_ADSR.h.
Sets the sample rate that will be used for the envelope.
This must be called before the getNextSample() or setParameters() methods.
Definition at line 103 of file juce_ADSR.h.