Skip to content

Class daisysp::AdEnv

ClassList > daisysp > AdEnv

More...

  • #include <adenv.h>

Public Functions

Type Name
AdEnv ()
uint8_t GetCurrentSegment ()
float GetValue () const
void Init (float sample_rate)
bool IsRunning () const
float Process ()
void SetCurve (float scalar)
void SetMax (float max)
void SetMin (float min)
void SetTime (uint8_t seg, float time)
void Trigger ()
~AdEnv ()

Detailed Description

Trigger-able envelope with adjustable min/max, and independent per-segment time control.

Author:

shensley

Todo

  • Add Cycling

  • Implement Curve (its only linear for now).

  • Maybe make this an ADsr_ that has AD/AR/Asr_ modes.

Public Functions Documentation

function AdEnv

inline daisysp::AdEnv::AdEnv () 

function GetCurrentSegment

inline uint8_t daisysp::AdEnv::GetCurrentSegment () 

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


function GetValue

inline float daisysp::AdEnv::GetValue () const

Returns the current output value without processing the next sample


function Init

void daisysp::AdEnv::Init (
    float sample_rate
) 

Initializes the ad envelope.

Defaults: * current segment = idle * curve = linear * phase = 0 * min = 0 * max = 1

Parameters:

  • sample_rate sample rate of the audio engine being run

function IsRunning

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

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


function Process

float daisysp::AdEnv::Process () 

Processes the current sample of the envelope. This should be called once per sample period.

Returns:

the current envelope value.


function SetCurve

inline void daisysp::AdEnv::SetCurve (
    float scalar
) 

Sets the amount of curve applied. A positve value will create a log curve. Input range: -100 to 100. (or more)


function SetMax

inline void daisysp::AdEnv::SetMax (
    float max
) 

Sets the maximum value of the envelope output. Input range: -FLTmax_, to FLTmax_


function SetMin

inline void daisysp::AdEnv::SetMin (
    float min
) 

Sets the minimum value of the envelope output. Input range: -FLTmax_, to FLTmax_


function SetTime

inline void daisysp::AdEnv::SetTime (
    uint8_t seg,
    float time
) 

Sets the length of time (in seconds) for a specific segment.


function Trigger

inline void daisysp::AdEnv::Trigger () 

Starts or retriggers the envelope.


function ~AdEnv

inline daisysp::AdEnv::~AdEnv () 


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