![]() |
fsh::stk
fantastic spatial holophonic synthesis toolkit
|
#include <ADSR.h>
Classes | |
struct | Params |
Envelope parameters. More... | |
Public Member Functions | |
void | setSampleRate (double) |
Set the sample rate in Hz. | |
void | setParams (const Params &) |
Set the envelope's parameters. | |
auto | isActive () const -> bool |
Returns true if the envelope is currently in a non-idle state. | |
auto | getNextValue () -> double |
Compute the envelope's next value. | |
void | noteOn () |
Start the envelope's attack phase. | |
void | noteOff () |
Trigger the envelope's release phase. | |
void | reset () |
Reset the envelope to its idle state. | |
ADSR envelope.
Before using: set the sample rate using setSampleRate() and set the envelope's parameters using setParams().
To use: start the envelope's attack phase with noteOn(), trigger the release phase using noteOff(), and get the envelope's current value using getNextValue().
This class is loosely based on code from the JX10 synthesizer by Matthijs Hollemans.