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

Trigger in, fixed-length gate out. More...

#include <trigger.hpp>

Public Types

enum class  Retrigger : std::uint8_t { restart , ignore , extend }

Public Member Functions

void prepare (double sample_rate)
void set_length_ms (double ms)
double length_ms () const
void set_length_samples (double samples)
 Direct sample length, for synced use via units::division_to_samples().
void set_retrigger (Retrigger policy)
void set_levels (SampleType low_level, SampleType high_level)
void reset ()
bool process (bool trigger)
SampleType process (SampleType trigger)
bool gate () const
bool open () const

Static Public Attributes

static constexpr double kMinLengthMs = 0.1
static constexpr double kMaxLengthMs = 10000.0
static constexpr double kDefaultLengthMs = 10.0

Detailed Description

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

Trigger in, fixed-length gate out.

RT contract: prepare() and setters are control-side; process() and reset() allocate nothing.

USE: choke windows; trance-gate shapes driving a VcaT; giving an ArT or AdT a gate whose length is a musical value rather than however long a pad was held. The retrigger policy is the interesting control — restart is a machine gun, ignore protects the first hit, extend accumulates a roll into one long gate.

Member Enumeration Documentation

◆ Retrigger

template<typename SampleType = float>
enum class pulp::signal::GateGenT::Retrigger : std::uint8_t
strong
Enumerator
restart 

Reset the countdown to full length.

The default: a new event means a new gate.

ignore 

Drop triggers while the gate is high.

extend 

Add another full length to whatever remains.

Member Function Documentation

◆ gate()

template<typename SampleType = float>
bool pulp::signal::GateGenT< SampleType >::gate ( ) const
inline

◆ length_ms()

template<typename SampleType = float>
double pulp::signal::GateGenT< SampleType >::length_ms ( ) const
inline

◆ open()

template<typename SampleType = float>
bool pulp::signal::GateGenT< SampleType >::open ( ) const
inline

◆ prepare()

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

◆ process() [1/2]

template<typename SampleType = float>
bool pulp::signal::GateGenT< SampleType >::process ( bool trigger)
inline
Returns
the gate state for this sample.

◆ process() [2/2]

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

◆ reset()

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

◆ set_length_ms()

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

◆ set_length_samples()

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

Direct sample length, for synced use via units::division_to_samples().

Call it after prepare(): it stores the equivalent time using the prepared sample rate, and a later prepare() re-derives the sample count from that time.

◆ set_levels()

template<typename SampleType = float>
void pulp::signal::GateGenT< SampleType >::set_levels ( SampleType low_level,
SampleType high_level )
inline

◆ set_retrigger()

template<typename SampleType = float>
void pulp::signal::GateGenT< SampleType >::set_retrigger ( Retrigger policy)
inline

Member Data Documentation

◆ kDefaultLengthMs

template<typename SampleType = float>
double pulp::signal::GateGenT< SampleType >::kDefaultLengthMs = 10.0
staticconstexpr

◆ kMaxLengthMs

template<typename SampleType = float>
double pulp::signal::GateGenT< SampleType >::kMaxLengthMs = 10000.0
staticconstexpr

◆ kMinLengthMs

template<typename SampleType = float>
double pulp::signal::GateGenT< SampleType >::kMinLengthMs = 0.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