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

Pass every Nth trigger. More...

#include <trigger.hpp>

Public Member Functions

void set_division (int n)
int division () const
void reset_phase ()
 Realign so the next trigger passes.
void reset ()
bool process (bool trigger)
bool process (SampleType clock)

Static Public Attributes

static constexpr int kMinDivision = 1
static constexpr int kMaxDivision = 64
static constexpr int kDefaultDivision = 2

Detailed Description

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

Pass every Nth trigger.

The first trigger after a reset always passes, so a divider that has just been phase-reset is in step with its master rather than N-1 events behind.

RT contract: two ints of state; everything allocates nothing.

USE: half- and quarter-time modulation from one master clock; polymeter by running a divide-by-3 and a divide-by-4 off the same trigger.

Member Function Documentation

◆ division()

template<typename SampleType = float>
int pulp::signal::ClockDividerT< SampleType >::division ( ) const
inline

◆ process() [1/2]

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

◆ process() [2/2]

template<typename SampleType = float>
bool pulp::signal::ClockDividerT< SampleType >::process ( SampleType clock)
inline

◆ reset()

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

◆ reset_phase()

template<typename SampleType = float>
void pulp::signal::ClockDividerT< SampleType >::reset_phase ( )
inline

Realign so the next trigger passes.

◆ set_division()

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

Member Data Documentation

◆ kDefaultDivision

template<typename SampleType = float>
int pulp::signal::ClockDividerT< SampleType >::kDefaultDivision = 2
staticconstexpr

◆ kMaxDivision

template<typename SampleType = float>
int pulp::signal::ClockDividerT< SampleType >::kMaxDivision = 64
staticconstexpr

◆ kMinDivision

template<typename SampleType = float>
int pulp::signal::ClockDividerT< SampleType >::kMinDivision = 1
staticconstexpr

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