Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::widgets::SegmentGenerator< CurveEngine > Class Template Reference

Detailed Description

template<typename CurveEngine = primitives::FloatDefaultWarp>
class sbl::dsp::widgets::SegmentGenerator< CurveEngine >

Definition at line 48 of file segment.hpp.

#include <segment.hpp>

Public Member Functions

void configure (const Segment *segments, uint8_t count, int8_t sustain_index=-1)
 
void gate_on ()
 
void gate_on (float velocity)
 Start with velocity — sets gate_strength to the given value.
 
void gate_off ()
 
void set_gate_su (float gate)
 
void retrigger ()
 Retrigger: restart from current level without requiring gate_off first.
 
void process (float *out, uint16_t frames)
 Fill output buffer with envelope levels (float [0.0, 1.0]).
 
float level () const
 
float gate_strength () const
 
bool active () const
 
SegmentState state () const
 
uint8_t current_segment_index () const
 

Static Public Attributes

static constexpr uint8_t MAX_SEGMENTS = 8
 

Member Function Documentation

◆ configure()

template<typename CurveEngine = primitives::FloatDefaultWarp>
void sbl::dsp::widgets::SegmentGenerator< CurveEngine >::configure ( const Segment *  segments,
uint8_t  count,
int8_t  sustain_index = -1 
)
inline

Configure the segment sequence.

Parameters
segmentsArray of segments (copied internally, up to MAX_SEGMENTS)
countNumber of segments
sustain_indexSegment index to hold at (-1 = no sustain)

Definition at line 60 of file segment.hpp.

References sbl::dsp::widgets::SegmentGenerator< CurveEngine >::MAX_SEGMENTS.

◆ gate_on() [1/2]

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

Start the envelope from segment 0. If already running, restarts from the current level (retrigger behavior).

Definition at line 73 of file segment.hpp.

References sbl::dsp::widgets::Idle, and sbl::dsp::widgets::Running.

◆ gate_on() [2/2]

template<typename CurveEngine = primitives::FloatDefaultWarp>
void sbl::dsp::widgets::SegmentGenerator< CurveEngine >::gate_on ( float  velocity)
inline

Start with velocity — sets gate_strength to the given value.

Definition at line 83 of file segment.hpp.

References sbl::dsp::widgets::Idle, and sbl::dsp::widgets::Running.

◆ gate_off()

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

Release the envelope. If in sustain, jumps to the next segment (typically release). If running pre-sustain, jumps to release. If no sustain configured, does nothing.

Definition at line 95 of file segment.hpp.

References sbl::dsp::widgets::Running, and sbl::dsp::widgets::Sustain.

◆ set_gate_su()

template<typename CurveEngine = primitives::FloatDefaultWarp>
void sbl::dsp::widgets::SegmentGenerator< CurveEngine >::set_gate_su ( float  gate)
inline

Accept a normalized gate signal. Detects edges to trigger/release. The gate value is stored for strength access (velocity/amplitude).

Definition at line 114 of file segment.hpp.

References sbl::dsp::widgets::Idle, sbl::dsp::widgets::Running, and sbl::dsp::widgets::Sustain.

◆ retrigger()

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

Retrigger: restart from current level without requiring gate_off first.

Definition at line 144 of file segment.hpp.

References sbl::dsp::widgets::Running.

◆ process()

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

Fill output buffer with envelope levels (float [0.0, 1.0]).

Definition at line 154 of file segment.hpp.

References sbl::dsp::widgets::Running, and sbl::dsp::widgets::Segment::target.

◆ level()

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

Definition at line 174 of file segment.hpp.

◆ gate_strength()

template<typename CurveEngine = primitives::FloatDefaultWarp>
float sbl::dsp::widgets::SegmentGenerator< CurveEngine >::gate_strength ( ) const
inline

Definition at line 175 of file segment.hpp.

◆ active()

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

Definition at line 177 of file segment.hpp.

References sbl::dsp::widgets::Complete, and sbl::dsp::widgets::Idle.

◆ state()

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

Definition at line 181 of file segment.hpp.

◆ current_segment_index()

template<typename CurveEngine = primitives::FloatDefaultWarp>
uint8_t sbl::dsp::widgets::SegmentGenerator< CurveEngine >::current_segment_index ( ) const
inline

Definition at line 182 of file segment.hpp.

Member Data Documentation

◆ MAX_SEGMENTS

template<typename CurveEngine = primitives::FloatDefaultWarp>
constexpr uint8_t sbl::dsp::widgets::SegmentGenerator< CurveEngine >::MAX_SEGMENTS = 8
staticconstexpr
Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 52 of file segment.hpp.

Referenced by sbl::dsp::widgets::SegmentGenerator< CurveEngine >::configure().


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