Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::ClockMultT Class Reference

Emit N evenly spaced event triggers per measured input period. More...

#include <trigger.hpp>

Public Member Functions

void set_multiplier (int n)
int multiplier () const
void reset ()
bool process (bool trigger)
long long period_samples () const
 Measured input period in samples; 0 until two triggers have arrived.

Static Public Attributes

static constexpr int kMaxMultiplier = 16

Detailed Description

Emit N evenly spaced event triggers per measured input period.

The period is measured between consecutive input triggers, so the first input trigger only starts the measurement — multiplied ticks begin with the second. This is unavoidable for any multiplier that is not told the tempo: you cannot subdivide an interval you have not seen yet.

Catch-up is bounded two ways: at most one tick per sample, and at most multiplier ticks per period. A collapsing input period therefore cannot make this emit an unbounded number of events in one block.

RT contract: scalar counters only; process() and reset() allocate nothing.

USE: ratchets and rolls from a slow clock; hi-hats derived from a kick trigger; running a modulation source at 4x the pulse the user is tapping.

Member Function Documentation

◆ multiplier()

int pulp::signal::ClockMultT::multiplier ( ) const
inline

◆ period_samples()

long long pulp::signal::ClockMultT::period_samples ( ) const
inline

Measured input period in samples; 0 until two triggers have arrived.

◆ process()

bool pulp::signal::ClockMultT::process ( bool trigger)
inline
Returns
true on samples where a multiplied tick fires.

◆ reset()

void pulp::signal::ClockMultT::reset ( )
inline

◆ set_multiplier()

void pulp::signal::ClockMultT::set_multiplier ( int n)
inline

Member Data Documentation

◆ kMaxMultiplier

int pulp::signal::ClockMultT::kMaxMultiplier = 16
staticconstexpr

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