DaisySP
Loading...
Searching...
No Matches
Public Member Functions | List of all members
daisysp::AdEnv Class Reference

#include <adenv.h>

Public Member Functions

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

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.

Member Function Documentation

◆ GetCurrentSegment()

uint8_t daisysp::AdEnv::GetCurrentSegment ( )
inline

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

◆ GetValue()

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

Returns the current output value without processing the next sample

◆ Init()

void AdEnv::Init ( float sample_rate)

Initializes the ad envelope.

Defaults:

  • current segment = idle
  • curve = linear
  • phase = 0
  • min = 0
  • max = 1
Parameters
sample_ratesample rate of the audio engine being run

◆ IsRunning()

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

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

◆ Process()

float AdEnv::Process ( )

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

Returns
the current envelope value.

◆ SetCurve()

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

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

◆ SetMax()

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

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

◆ SetMin()

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

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

◆ SetTime()

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

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

◆ Trigger()

void daisysp::AdEnv::Trigger ( )
inline

Starts or retriggers the envelope.


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