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

The event-domain kit: edge detection, gate generation, clock division and multiplication, bursts, and trigger delay. More...

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

Go to the source code of this file.

Classes

class  pulp::signal::HystereticTriggerDetectT< SampleType >
 Hysteretic continuous-CV edge detector. More...
class  pulp::signal::TriggerDetectT< SampleType >
 Rising-edge detector with a refractory period. More...
class  pulp::signal::GateGenT< SampleType >
 Trigger in, fixed-length gate out. More...
class  pulp::signal::ClockDividerT< SampleType >
 Pass every Nth trigger. More...
class  pulp::signal::ClockMultT
 Emit N evenly spaced event triggers per measured input period. More...
class  pulp::signal::SignalClockMultT< SampleType >
 Continuous-signal clock multiplier. More...
class  pulp::signal::BurstGenT< SampleType >
 One trigger in, a burst of N triggers out, with a spacing curve and a level ramp. More...
struct  pulp::signal::BurstGenT< SampleType >::Hit
class  pulp::signal::TrigDelayT< SampleType >
 Delay a trigger by a fixed time, through a small fixed-capacity queue. More...

Namespaces

namespace  pulp
namespace  pulp::signal
namespace  pulp::signal::round2
 Migration namespace for the unshipped Round-2 spelling whose template arity conflicts with the established slot matrix.

Typedefs

using pulp::signal::HystereticTriggerDetect = HystereticTriggerDetectT<float>
using pulp::signal::HystereticTriggerDetect64 = HystereticTriggerDetectT<double>
using pulp::signal::TriggerDetect = TriggerDetectT<float>
using pulp::signal::TriggerDetect64 = TriggerDetectT<double>
using pulp::signal::GateGen = GateGenT<float>
using pulp::signal::GateGen64 = GateGenT<double>
using pulp::signal::ClockDivider = ClockDividerT<float>
using pulp::signal::ClockDivider64 = ClockDividerT<double>
using pulp::signal::ClockMult = ClockMultT
 Backward-compatible name for the already-decoded event adapter.
using pulp::signal::ClockMult64 = ClockMultT
using pulp::signal::EventClockMult = ClockMultT
using pulp::signal::EventClockMult64 = ClockMultT
template<typename SampleType = float>
using pulp::signal::round2::ClockMultT = ::pulp::signal::ClockMultT
using pulp::signal::SignalClockMult = SignalClockMultT<float>
using pulp::signal::SignalClockMult64 = SignalClockMultT<double>
using pulp::signal::BurstGen = BurstGenT<float>
using pulp::signal::BurstGen64 = BurstGenT<double>
using pulp::signal::TrigDelay = TrigDelayT<float>
using pulp::signal::TrigDelay64 = TrigDelayT<double>

Variables

constexpr double pulp::signal::kTriggerHighThreshold = 0.5
constexpr double pulp::signal::kTriggerLowThreshold = 0.25

Detailed Description

The event-domain kit: edge detection, gate generation, clock division and multiplication, bursts, and trigger delay.

RT contract: every type here holds fixed scalar state — TrigDelayT's queue is a fixed-capacity array — and owns no memory. prepare() and the set_*() setters are control-side calls; process() and reset() allocate nothing and are audio-thread safe.

USE: complex patches need event plumbing, not only smooth signals. The vocabulary is the modular one: a trigger is a one-sample event, a gate is a boolean with a duration. ComparatorT turns any continuous signal into a gate; these six primitives turn gates and triggers into each other. Every one of them composes with the envelope family, which is what makes "a kick drum's transient fires a ratcheted filter ping" three lines of wiring rather than a bespoke state machine.