Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::TrigDelayT< SampleType > Class Template Reference

Delay a trigger by a fixed time, through a small fixed-capacity queue. More...

#include <trigger.hpp>

Public Member Functions

void prepare (double sample_rate)
void set_delay_ms (double ms)
double delay_ms () const
void set_delay_samples (double samples)
 Direct sample delay, for synced use.
void reset ()
bool process (bool trigger)
bool process (SampleType trigger)
long long dropped () const
 Triggers discarded because the queue was full since the last reset().

Static Public Attributes

static constexpr int kCapacity = 8
 Eight in-flight triggers covers flams, doubles, and a full BurstGenT burst passing through; more would be a delay line, not a trigger delay.
static constexpr double kMinDelayMs = 0.0
static constexpr double kMaxDelayMs = 10000.0
static constexpr double kDefaultDelayMs = 0.0

Detailed Description

template<typename SampleType = float>
class pulp::signal::TrigDelayT< SampleType >

Delay a trigger by a fixed time, through a small fixed-capacity queue.

Capacity is kCapacity in-flight triggers. A trigger arriving with the queue full is dropped and counted rather than silently overwriting one — dropping is the honest behavior for a bounded queue, and the counter is there so a caller can notice.

RT contract: a fixed-size array of counters. process() costs kCapacity integer operations per sample and allocates nothing.

USE: flams — run the dry trigger and a 15 ms delayed copy into two voices. Echo-triggering a second layer. Nudging one element of a drum pattern off the grid without touching the sequencer.

Member Function Documentation

◆ delay_ms()

template<typename SampleType = float>
double pulp::signal::TrigDelayT< SampleType >::delay_ms ( ) const
inline

◆ dropped()

template<typename SampleType = float>
long long pulp::signal::TrigDelayT< SampleType >::dropped ( ) const
inline

Triggers discarded because the queue was full since the last reset().

◆ prepare()

template<typename SampleType = float>
void pulp::signal::TrigDelayT< SampleType >::prepare ( double sample_rate)
inline

◆ process() [1/2]

template<typename SampleType = float>
bool pulp::signal::TrigDelayT< SampleType >::process ( bool trigger)
inline
Returns
true on samples where at least one delayed trigger fires.

◆ process() [2/2]

template<typename SampleType = float>
bool pulp::signal::TrigDelayT< SampleType >::process ( SampleType trigger)
inline

◆ reset()

template<typename SampleType = float>
void pulp::signal::TrigDelayT< SampleType >::reset ( )
inline

◆ set_delay_ms()

template<typename SampleType = float>
void pulp::signal::TrigDelayT< SampleType >::set_delay_ms ( double ms)
inline

◆ set_delay_samples()

template<typename SampleType = float>
void pulp::signal::TrigDelayT< SampleType >::set_delay_samples ( double samples)
inline

Direct sample delay, for synced use.

Call it after prepare() — see GateGenT::set_length_samples() for why.

Member Data Documentation

◆ kCapacity

template<typename SampleType = float>
int pulp::signal::TrigDelayT< SampleType >::kCapacity = 8
staticconstexpr

Eight in-flight triggers covers flams, doubles, and a full BurstGenT burst passing through; more would be a delay line, not a trigger delay.

◆ kDefaultDelayMs

template<typename SampleType = float>
double pulp::signal::TrigDelayT< SampleType >::kDefaultDelayMs = 0.0
staticconstexpr

◆ kMaxDelayMs

template<typename SampleType = float>
double pulp::signal::TrigDelayT< SampleType >::kMaxDelayMs = 10000.0
staticconstexpr

◆ kMinDelayMs

template<typename SampleType = float>
double pulp::signal::TrigDelayT< SampleType >::kMinDelayMs = 0.0
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/trigger.hpp