Defines the numeric range of a parameter, including normalization. More...
#include <parameter.hpp>
Public Member Functions | |
| bool | is_linear () const |
| True when this range is a plain affine (linear) map — the common case. | |
| float | normalize (float value) const |
| Map a real value to the normalized [0, 1] range. | |
| float | denormalize (float normalized) const |
| Map a normalized [0, 1] value back to the real range. | |
Static Public Member Functions | |
| static ParamRange | linear (float lo, float hi, float def=0.0f, float step_value=0.0f) |
| Build a linear range covering [lo, hi] with the given default and step. | |
| static ParamRange | with_center (float lo, float hi, float center, float def=0.0f, float step_value=0.0f) |
Build a shaped range whose normalized midpoint (0.5) maps to center. | |
Public Attributes | |
| float | min = 0.0f |
| float | max = 1.0f |
| float | default_value = 0.0f |
| float | step = 0.0f |
| Quantization step. 0 = continuous. | |
| float | skew = 1.0f |
| 1 = linear, <1 weights min, >1 weights max. | |
| bool | symmetric_skew = false |
| Mirror the curve around the center (bipolar). | |
Defines the numeric range of a parameter, including normalization.
Normalization maps the [min, max] range to [0, 1] for host automation. If step is non-zero, denormalized values snap to the nearest step.
skew and symmetric_skew give the range a non-linear curve between the [0, 1] host-automation domain and the [min, max] parameter domain:
The shaping convention matches SkewedRange<T> below, which shares the same math. Use ParamRange::with_center() to derive the skew that places a chosen real value at the normalized midpoint (0.5).
|
inline |
Map a normalized [0, 1] value back to the real range.
Applies step quantization if step > 0.
| normalized | Value in [0, 1]. |
|
inline |
True when this range is a plain affine (linear) map — the common case.
Used to take a bit-identical fast path that bypasses the skew math.
|
inlinestatic |
Build a linear range covering [lo, hi] with the given default and step.
Provided so call sites can be explicit about the linear case alongside the shaped factories below.
|
inline |
Map a real value to the normalized [0, 1] range.
| value | Raw parameter value in [min, max]. |
|
inlinestatic |
Build a shaped range whose normalized midpoint (0.5) maps to center.
Equivalent to choosing the skew that satisfies denormalize(0.5) == center. Falls back to a linear range when center is not strictly inside the open interval (min, max).
| float pulp::state::ParamRange::default_value = 0.0f |
| float pulp::state::ParamRange::max = 1.0f |
| float pulp::state::ParamRange::min = 0.0f |
| float pulp::state::ParamRange::skew = 1.0f |
1 = linear, <1 weights min, >1 weights max.
| float pulp::state::ParamRange::step = 0.0f |
Quantization step. 0 = continuous.
| bool pulp::state::ParamRange::symmetric_skew = false |
Mirror the curve around the center (bipolar).