libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::Parameter Class Reference

Detailed Description

Simple parameter mapping tool that takes a 0-1 input from an hid_ctrl.

#include <parameter.h>

Public Types

enum  Curve {
  LINEAR , EXPONENTIAL , LOGARITHMIC , CUBE ,
  LAST
}
 

Public Member Functions

 Parameter ()
 
 ~Parameter ()
 
void Init (AnalogControl input, float min, float max, Curve curve)
 
float Process ()
 
float Value ()
 

Member Enumeration Documentation

◆ Curve

Curves are applied to the output signal

Enumerator
LINEAR 

Linear curve

EXPONENTIAL 

Exponential curve

LOGARITHMIC 

Logarithmic curve

CUBE 

Cubic curve

LAST 

Final enum element.

Constructor & Destructor Documentation

◆ Parameter()

daisy::Parameter::Parameter ( )
inline

Constructor

◆ ~Parameter()

daisy::Parameter::~Parameter ( )
inline

Destructor

Member Function Documentation

◆ Init()

void daisy::Parameter::Init ( AnalogControl  input,
float  min,
float  max,
Curve  curve 
)

initialize a parameter using an hid_ctrl object.

Parameters
input- object containing the direct link to a hardware control source.
min- bottom of range. (when input is 0.0)
max- top of range (when input is 1.0)
curve- the scaling curve for the input->output transformation.

◆ Process()

float daisy::Parameter::Process ( )

processes the input signal, this should be called at the samplerate of the hid_ctrl passed in.

Returns
a float with the specified transformation applied.

◆ Value()

float daisy::Parameter::Value ( )
inline
Returns
the current value from the parameter without processing another sample. this is useful if you need to use the value multiple times, and don't store

the output of process in a local variable.


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