HART  0.1.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
SegmentedEnvelope Class Reference

A simple envelope constructed from semgents. More...

#include <hart_segmentedenvelope.hpp>

Inheritance diagram for SegmentedEnvelope:

Public Types

enum class  Shape { linear , exponential , sCurve }
 Determines a shape of ramp curve. More...
 

Public Member Functions

 SegmentedEnvelope (double startValue)
 Creates a segmented envelope instance.
 
void renderNextBlock (size_t blockSize, std::vector< double > &valuesOutput) override
 
void prepare (double sampleRateHz, size_t) override
 
void reset () override
 
SegmentedEnvelopehold (double durationSeconds)
 Adds a flat horizontal section to the envelope.
 
SegmentedEnveloperampTo (double targetValue, double durationSeconds, Shape shape=Shape::linear)
 Adds a transitional section to the envelope.
 
std::unique_ptr< Envelopecopy () const override
 Created a copy of the envelope wrapped in a smart pointer.
 
- Public Member Functions inherited from Envelope
virtual ~Envelope ()=default
 
std::vector< doublerenderNextBlock (size_t blockSize)
 

Detailed Description

A simple envelope constructed from semgents.

Definition at line 15 of file hart_segmentedenvelope.hpp.

Member Enumeration Documentation

◆ Shape

enum class Shape
strong

Determines a shape of ramp curve.

Enumerator
linear 

Linear curve.

exponential 

Exponential curve.

sCurve 

S-curve.

Definition at line 21 of file hart_segmentedenvelope.hpp.

Constructor & Destructor Documentation

◆ SegmentedEnvelope()

SegmentedEnvelope ( double  startValue)
inline

Creates a segmented envelope instance.

Parameters
startValueInitial value of the envelope, in any unit

Definition at line 30 of file hart_segmentedenvelope.hpp.

Member Function Documentation

◆ renderNextBlock()

void renderNextBlock ( size_t  blockSize,
std::vector< double > &  valuesOutput 
)
inlineoverridevirtual

Implements Envelope.

Definition at line 38 of file hart_segmentedenvelope.hpp.

◆ prepare()

void prepare ( double  sampleRateHz,
size_t   
)
inlineoverridevirtual

Implements Envelope.

Definition at line 53 of file hart_segmentedenvelope.hpp.

◆ reset()

void reset ( )
inlineoverridevirtual

Implements Envelope.

Definition at line 61 of file hart_segmentedenvelope.hpp.

◆ hold()

SegmentedEnvelope & hold ( double  durationSeconds)
inline

Adds a flat horizontal section to the envelope.

Parameters
durationSecondsDuration of the new segment in seconds

Definition at line 70 of file hart_segmentedenvelope.hpp.

◆ rampTo()

SegmentedEnvelope & rampTo ( double  targetValue,
double  durationSeconds,
Shape  shape = Shape::linear 
)
inline

Adds a transitional section to the envelope.

Parameters
targetValueValue at the end of transition, in any unit
durationSecondsDuration of the the transition in seconds
shapeShape of the transition ramp curve

Definition at line 81 of file hart_segmentedenvelope.hpp.

◆ copy()

std::unique_ptr< Envelope > copy ( ) const
inlineoverridevirtual

Created a copy of the envelope wrapped in a smart pointer.

Implements Envelope.

Definition at line 90 of file hart_segmentedenvelope.hpp.


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