DaisySP
Loading...
Searching...
No Matches
daisysp::Adsr Class Reference

#include <adsr.h>

Public Member Functions

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

Detailed Description

adsr envelope module

Original author(s) : Paul Batchelor

Ported from Soundpipe by Ben Sergentanis, May 2020

Remake by Steffan DIedrichsen, May 2021

Member Function Documentation

◆ GetCurrentSegment()

uint8_t daisysp::Adsr::GetCurrentSegment ( )
inline

get the current envelope segment

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

◆ Init()

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

Initializes the Adsr module.

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

◆ IsRunning()

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

Tells whether envelope is active

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

◆ Process()

float Adsr::Process ( bool gate)

Processes one sample through the filter and returns one sample.

Parameters
gate- trigger the envelope, hold it to sustain

◆ Retrigger()

void Adsr::Retrigger ( bool hard)

\function Retrigger forces the envelope back to attack phase

Parameters
hardresets the history to zero, results in a click.

◆ SetSustainLevel()

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

Sustain level

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

◆ SetTime()

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

Sets time Set time per segment in seconds


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