|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <segment.hpp>
Public Member Functions | |
| void | configure (const Segment *segments, uint8_t count, int8_t sustain_index=-1) |
| void | set_sample_rate (uint32_t sr) |
| void | gate_on () |
| void | gate_off () |
| 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 |
| bool | active () const |
| SegmentState | state () const |
| uint8_t | current_segment_index () const |
Static Public Attributes | |
| static constexpr uint8_t | MAX_SEGMENTS = 8 |
Definition at line 46 of file segment.hpp.
|
inline |
Definition at line 130 of file segment.hpp.
References sbl::dsp::Complete, and sbl::dsp::Idle.
|
inline |
Configure the segment sequence.
| segments | Array of segments (copied internally, up to MAX_SEGMENTS) |
| count | Number of segments |
| sustain_index | Segment index to hold at (-1 = no sustain) |
Definition at line 58 of file segment.hpp.
References sbl::dsp::SegmentGenerator< CurveEngine >::MAX_SEGMENTS.
|
inline |
Definition at line 135 of file segment.hpp.
|
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 83 of file segment.hpp.
References sbl::dsp::Running, and sbl::dsp::Sustain.
|
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::Idle, and sbl::dsp::Running.
|
inline |
Definition at line 128 of file segment.hpp.
|
inline |
Fill output buffer with envelope levels (float [0.0, 1.0]).
Definition at line 108 of file segment.hpp.
References sbl::dsp::Running, and sbl::dsp::Segment::target.
|
inline |
Retrigger: restart from current level without requiring gate_off first.
Definition at line 98 of file segment.hpp.
References sbl::dsp::Running.
|
inline |
Definition at line 67 of file segment.hpp.
|
inline |
Definition at line 134 of file segment.hpp.
|
staticconstexpr |
Definition at line 50 of file segment.hpp.
Referenced by sbl::dsp::SegmentGenerator< CurveEngine >::configure().