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

One trigger in, a burst of N triggers out, with a spacing curve and a level ramp. More...

#include <trigger.hpp>

Classes

struct  Hit

Public Member Functions

void prepare (double sample_rate)
void set_count (int n)
 Changing the count while the burst is idle keeps it idle: next_index_ marks "finished" by sitting at the count, so growing the count without this guard would resume a finished burst and fire hits no trigger asked for.
int count () const
void set_spacing_ms (double ms)
void set_spacing_curve (float c)
void set_levels (SampleType first, SampleType last)
void set_interval_ms (double ms)
double interval_ms () const
void reset ()
Hit process (bool trigger)
 At most one hit fires per sample.
bool process (SampleType trigger)
long long hit_offset_samples (int index) const
 Sample offset of hit index from the burst's trigger.
bool active () const
bool busy () const

Static Public Attributes

static constexpr int kMinCount = 1
static constexpr int kMaxCount = 64
static constexpr int kDefaultCount = 4
static constexpr double kMinIntervalMs = 1.0
static constexpr double kMaxIntervalMs = 2000.0
static constexpr double kDefaultIntervalMs = 50.0

Detailed Description

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

One trigger in, a burst of N triggers out, with a spacing curve and a level ramp.

Hit i of count fires at span * stage_curve(i / (count - 1), spacing_curve), where span = (count - 1) * spacing_ms. The curve is the shared stage-shaping law, so spacing_curve = 0 is even spacing, +1 accelerates (gaps shrink — a bouncing ball landing), and -1 decelerates (gaps grow — a drag).

RT contract: fixed scalar state; process() and reset() allocate nothing.

USE: ratchet fills; strum-like event fans; bouncing-ball gestures. Feed the output to LpgT::strike() with the per-hit level and you have a playable percussion roll from two primitives.

Member Function Documentation

◆ active()

template<typename SampleType = float>
bool pulp::signal::BurstGenT< SampleType >::active ( ) const
inline

◆ busy()

template<typename SampleType = float>
bool pulp::signal::BurstGenT< SampleType >::busy ( ) const
inline

◆ count()

template<typename SampleType = float>
int pulp::signal::BurstGenT< SampleType >::count ( ) const
inline

◆ hit_offset_samples()

template<typename SampleType = float>
long long pulp::signal::BurstGenT< SampleType >::hit_offset_samples ( int index) const
inline

Sample offset of hit index from the burst's trigger.

Exposed so tests and sequencer previews can check against the same closed form the generator uses.

◆ interval_ms()

template<typename SampleType = float>
double pulp::signal::BurstGenT< SampleType >::interval_ms ( ) const
inline

◆ prepare()

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

◆ process() [1/2]

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

At most one hit fires per sample.

A spacing curve steep enough to put two hits on the same sample therefore spreads them one sample apart rather than dropping one — a bounded, audible-as-nothing correction.

◆ process() [2/2]

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

◆ reset()

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

◆ set_count()

template<typename SampleType = float>
void pulp::signal::BurstGenT< SampleType >::set_count ( int n)
inline

Changing the count while the burst is idle keeps it idle: next_index_ marks "finished" by sitting at the count, so growing the count without this guard would resume a finished burst and fire hits no trigger asked for.

◆ set_interval_ms()

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

◆ set_levels()

template<typename SampleType = float>
void pulp::signal::BurstGenT< SampleType >::set_levels ( SampleType first,
SampleType last )
inline

◆ set_spacing_curve()

template<typename SampleType = float>
void pulp::signal::BurstGenT< SampleType >::set_spacing_curve ( float c)
inline

◆ set_spacing_ms()

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

Member Data Documentation

◆ kDefaultCount

template<typename SampleType = float>
int pulp::signal::BurstGenT< SampleType >::kDefaultCount = 4
staticconstexpr

◆ kDefaultIntervalMs

template<typename SampleType = float>
double pulp::signal::BurstGenT< SampleType >::kDefaultIntervalMs = 50.0
staticconstexpr

◆ kMaxCount

template<typename SampleType = float>
int pulp::signal::BurstGenT< SampleType >::kMaxCount = 64
staticconstexpr

◆ kMaxIntervalMs

template<typename SampleType = float>
double pulp::signal::BurstGenT< SampleType >::kMaxIntervalMs = 2000.0
staticconstexpr

◆ kMinCount

template<typename SampleType = float>
int pulp::signal::BurstGenT< SampleType >::kMinCount = 1
staticconstexpr

◆ kMinIntervalMs

template<typename SampleType = float>
double pulp::signal::BurstGenT< SampleType >::kMinIntervalMs = 1.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