Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
modulation_curve.hpp File Reference

A shared, allocation-free curve vocabulary for modulation segments. More...

#include <pulp/signal/denormal.hpp>
#include <pulp/signal/mod_tools.hpp>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <type_traits>

Go to the source code of this file.

Classes

struct  pulp::signal::ModulationCurve
 Curve strength is dimensionless and legal in [0, 1]. More...

Namespaces

namespace  pulp
namespace  pulp::signal
namespace  pulp::signal::detail
 Round-2 effect-wave vocabulary.

Enumerations

enum class  pulp::signal::ModulationCurveShape : std::uint8_t {
  pulp::signal::linear , pulp::signal::exponential , pulp::signal::logarithmic , pulp::signal::smoothstep ,
  pulp::signal::hold
}

Functions

ModulationCurve pulp::signal::sanitize_modulation_curve (ModulationCurve curve) noexcept
template<typename SampleType>
SampleType pulp::signal::detail::precise_stage_curve (SampleType progress, SampleType curve) noexcept
template<typename SampleType>
SampleType pulp::signal::modulation_curve_progress (SampleType progress, ModulationCurve curve, bool rising) noexcept
template<typename SampleType, typename ProgressType>
SampleType pulp::signal::interpolate_modulation_curve (SampleType start, SampleType end, ProgressType progress, ModulationCurve curve={}) noexcept

Detailed Description

A shared, allocation-free curve vocabulary for modulation segments.

Curves interpolate values expressed in the caller's real unit. They never normalize or clamp endpoints. Progress is normalized and clamped to [0, 1]. Non-finite progress is treated as the segment start; non-finite endpoints return the finite endpoint when exactly one is finite, or zero otherwise.

The exponential and logarithmic shapes reuse the stage law from mod_tools.hpp, so existing envelopes and new breakpoint sources agree on what those musical labels mean. All functions are pure and allocate no memory.