fsh::stk
fantastic spatial holophonic synthesis toolkit
Loading...
Searching...
No Matches
fsh::synth::ADSR Class Reference

ADSR envelope. More...

#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.
 

Detailed Description

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.


The documentation for this class was generated from the following files: