Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
sbl::widgets::mod::Envelope< CurveEngine > Class Template Reference

#include <envelope.hpp>

Collaboration diagram for sbl::widgets::mod::Envelope< CurveEngine >:

Public Member Functions

void set_sample_rate (uint32_t sr)
 
void gate_on ()
 
void gate_off ()
 
void retrigger ()
 
void process (float *out, uint16_t frames)
 Generate envelope output (float [0.0, 1.0]).
 
float level () const
 
bool active () const
 
dsp::SegmentState state () const
 

Static Public Member Functions

static Envelope adsr (float attack_ms, float decay_ms, float sustain, float release_ms, float curve=0.0f)
 
static Envelope ar (float attack_ms, float release_ms, float curve=0.0f)
 Attack-Release envelope (sustain at peak until gate_off).
 
static Envelope ahr (float attack_ms, float hold_ms, float release_ms, float curve=0.0f)
 Attack-Hold-Release envelope (timed hold, no gate sustain).
 
static Envelope ad (float attack_ms, float decay_ms, float curve=0.0f)
 Attack-Decay envelope (one-shot, no sustain or release).
 
static Envelope custom (const dsp::Segment *segments, uint8_t count, int8_t sustain_index=-1)
 Custom multi-segment envelope.
 

Detailed Description

template<typename CurveEngine = dsp::FloatDefaultWarp>
class sbl::widgets::mod::Envelope< CurveEngine >

Definition at line 22 of file envelope.hpp.

Member Function Documentation

◆ active()

template<typename CurveEngine = dsp::FloatDefaultWarp>
bool sbl::widgets::mod::Envelope< CurveEngine >::active ( ) const
inline

Definition at line 111 of file envelope.hpp.

◆ ad()

template<typename CurveEngine = dsp::FloatDefaultWarp>
static Envelope sbl::widgets::mod::Envelope< CurveEngine >::ad ( float  attack_ms,
float  decay_ms,
float  curve = 0.0f 
)
inlinestatic

Attack-Decay envelope (one-shot, no sustain or release).

Definition at line 74 of file envelope.hpp.

◆ adsr()

template<typename CurveEngine = dsp::FloatDefaultWarp>
static Envelope sbl::widgets::mod::Envelope< CurveEngine >::adsr ( float  attack_ms,
float  decay_ms,
float  sustain,
float  release_ms,
float  curve = 0.0f 
)
inlinestatic
Note
All public methods are ISR-safe — bounded computation, no I/O. Attack-Decay-Sustain-Release envelope.
Parameters
sustainSustain level [0.0, 1.0]
curveShape [-1.0, 1.0]: -1 = concave, 0 = linear, 1 = convex

Definition at line 35 of file envelope.hpp.

◆ ahr()

template<typename CurveEngine = dsp::FloatDefaultWarp>
static Envelope sbl::widgets::mod::Envelope< CurveEngine >::ahr ( float  attack_ms,
float  hold_ms,
float  release_ms,
float  curve = 0.0f 
)
inlinestatic

Attack-Hold-Release envelope (timed hold, no gate sustain).

Definition at line 61 of file envelope.hpp.

◆ ar()

template<typename CurveEngine = dsp::FloatDefaultWarp>
static Envelope sbl::widgets::mod::Envelope< CurveEngine >::ar ( float  attack_ms,
float  release_ms,
float  curve = 0.0f 
)
inlinestatic

Attack-Release envelope (sustain at peak until gate_off).

Definition at line 49 of file envelope.hpp.

◆ custom()

template<typename CurveEngine = dsp::FloatDefaultWarp>
static Envelope sbl::widgets::mod::Envelope< CurveEngine >::custom ( const dsp::Segment segments,
uint8_t  count,
int8_t  sustain_index = -1 
)
inlinestatic

Custom multi-segment envelope.

Definition at line 86 of file envelope.hpp.

◆ gate_off()

template<typename CurveEngine = dsp::FloatDefaultWarp>
void sbl::widgets::mod::Envelope< CurveEngine >::gate_off ( )
inline

Definition at line 98 of file envelope.hpp.

◆ gate_on()

template<typename CurveEngine = dsp::FloatDefaultWarp>
void sbl::widgets::mod::Envelope< CurveEngine >::gate_on ( )
inline

Definition at line 97 of file envelope.hpp.

◆ level()

template<typename CurveEngine = dsp::FloatDefaultWarp>
float sbl::widgets::mod::Envelope< CurveEngine >::level ( ) const
inline

Definition at line 110 of file envelope.hpp.

◆ process()

template<typename CurveEngine = dsp::FloatDefaultWarp>
void sbl::widgets::mod::Envelope< CurveEngine >::process ( float *  out,
uint16_t  frames 
)
inline

Generate envelope output (float [0.0, 1.0]).

Definition at line 104 of file envelope.hpp.

◆ retrigger()

template<typename CurveEngine = dsp::FloatDefaultWarp>
void sbl::widgets::mod::Envelope< CurveEngine >::retrigger ( )
inline

Definition at line 99 of file envelope.hpp.

◆ set_sample_rate()

template<typename CurveEngine = dsp::FloatDefaultWarp>
void sbl::widgets::mod::Envelope< CurveEngine >::set_sample_rate ( uint32_t  sr)
inline

Definition at line 95 of file envelope.hpp.

◆ state()

template<typename CurveEngine = dsp::FloatDefaultWarp>
dsp::SegmentState sbl::widgets::mod::Envelope< CurveEngine >::state ( ) const
inline

Definition at line 112 of file envelope.hpp.


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