Skip to content

Class daisysp::Adsr

ClassList > daisysp > Adsr

More...

  • #include <adsr.h>

Public Functions

Type Name
Adsr ()
uint8_t GetCurrentSegment ()
void Init (float sample_rate, int blockSize=1)
bool IsRunning () const
float Process (bool gate)
void Retrigger (bool hard)
void SetAttackTime (float timeInS, float shape=0.0f)
void SetDecayTime (float timeInS)
void SetReleaseTime (float timeInS)
void SetSustainLevel (float sus_level)
void SetTime (int seg, float time)
~Adsr ()

Detailed Description

adsr envelope module

Original author(s) : Paul Batchelor

Ported from Soundpipe by Ben Sergentanis, May 2020

Remake by Steffan DIedrichsen, May 2021

Public Functions Documentation

function Adsr

inline daisysp::Adsr::Adsr () 

function GetCurrentSegment

inline uint8_t daisysp::Adsr::GetCurrentSegment () 

get the current envelope segment

Returns:

the segment of the envelope that the phase is currently located in.


function Init

void daisysp::Adsr::Init (
    float sample_rate,
    int blockSize=1
) 

Initializes the Adsr module.

Parameters:

  • sample_rate - The sample rate of the audio engine being run.

function IsRunning

inline bool daisysp::Adsr::IsRunning () const

Tells whether envelope is active

Returns:

true if the envelope is currently in any stage apart from idle.


function Process

float daisysp::Adsr::Process (
    bool gate
) 

Processes one sample through the filter and returns one sample.

Parameters:

  • gate - trigger the envelope, hold it to sustain

function Retrigger

void daisysp::Adsr::Retrigger (
    bool hard
) 

\function Retrigger forces the envelope back to attack phase

Parameters:

  • hard resets the history to zero, results in a click.

function SetAttackTime

void daisysp::Adsr::SetAttackTime (
    float timeInS,
    float shape=0.0f
) 

function SetDecayTime

void daisysp::Adsr::SetDecayTime (
    float timeInS
) 

function SetReleaseTime

void daisysp::Adsr::SetReleaseTime (
    float timeInS
) 

function SetSustainLevel

inline void daisysp::Adsr::SetSustainLevel (
    float sus_level
) 

Sustain level

Parameters:

  • sus_level - sets sustain level, 0...1.0

function SetTime

void daisysp::Adsr::SetTime (
    int seg,
    float time
) 

Sets time Set time per segment in seconds


function ~Adsr

inline daisysp::Adsr::~Adsr () 


The documentation for this class was generated from the following file external-docs/DaisySP/Source/Control/adsr.h