OpenShot Library | libopenshot-audio 0.2.0
|
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 |
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 sampleRate) |
Sets the sample rate that will be used for the envelope. | |
void | reset () |
Resets the envelope to an idle state. | |
void | noteOn () |
Starts the attack phase of the envelope. | |
void | noteOff () |
Starts the release phase of the envelope. | |
float | getNextSample () |
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.
Definition at line 38 of file juce_ADSR.h.
|
inline |
Definition at line 42 of file juce_ADSR.h.
|
inline |
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 72 of file juce_ADSR.h.
Referenced by juce::SamplerVoice::startNote().
|
inline |
Returns the parameters currently being used by an ADSR object.
Definition at line 87 of file juce_ADSR.h.
|
inlinenoexcept |
Returns true if the envelope is in its attack, decay, sustain or release stage.
Definition at line 90 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 97 of file juce_ADSR.h.
Referenced by juce::SamplerVoice::startNote().
|
inline |
Resets the envelope to an idle state.
Definition at line 105 of file juce_ADSR.h.
Referenced by getNextSample(), noteOff(), and juce::SamplerVoice::stopNote().
|
inline |
Starts the attack phase of the envelope.
Definition at line 112 of file juce_ADSR.h.
Referenced by juce::SamplerVoice::startNote().
|
inline |
Starts the release phase of the envelope.
Definition at line 120 of file juce_ADSR.h.
References juce::ADSR::Parameters::release, and reset().
Referenced by juce::SamplerVoice::stopNote().
|
inline |
Returns the next sample value for an ADSR object.
Definition at line 143 of file juce_ADSR.h.
References reset().
Referenced by applyEnvelopeToBuffer(), and juce::SamplerVoice::renderNextBlock().
|
inline |
This method will conveniently apply the next numSamples number of envelope values to an AudioBuffer.
Definition at line 193 of file juce_ADSR.h.
References getNextSample().