Skip to content

daisy::Parameter

Module: LIBDAISY / HUMAN_INTERFACE / CONTROLS

More...

#include <parameter.h>

Public Types

Name
enum Curve

Public Functions

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

Detailed Description

class daisy::Parameter;

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

Public Types Documentation

enum Curve

Enumerator Value Description
LINEAR Linear curve
EXPONENTIAL Exponential curve
LOGARITHMIC Logarithmic curve
CUBE Cubic curve
LAST Final enum element.

Curves are applied to the output signal

Public Functions Documentation

function Parameter

inline Parameter()

Constructor


function ~Parameter

inline ~Parameter()

Destructor


function Init

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

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.

initialize a parameter using an hid_ctrl object.


function Process

float Process()

Return: a float with the specified transformation applied.

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


function Value

inline float Value()

Return: 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.

---

Updated on 2024-01-03 at 19:41:01 +0000